Modern Software Development

Slides: http://bit.ly/msd-workshop

Introduction

  • What makes a good software
  • How to prototype fully functional software quickly
  • Utilise free and OSS tools to make them do your work for you

Programming Myths

  • Programmers sit all day and write code
  • Most important skill for a programmer is knowledge of programming language
  • Testing is not a programmer’s job, it’s a tester’s job
  • What you learn in college is mostly obsolete

Programming is like Writing

  • Documentation -> Humans. Code -> Computers.
  • What makes a good writer?
    • Knowledge of English?
    • Ability to type fast?
    • Knowledge of MS Word/Google Docs?

No.

Prerequisites

git

Revision Control

  • Collaboration
  • Accurate version tracking, and restoring to previous versions
  • Code Archeology - Auditable history of who did what, and why.
  • Backup - more than one copy of code and its history

Git

  • Distributed - all history and files travel with checkouts
  • Immutable - Nothing can alter historical commits, increasing auditability.
  • Fast
  • Widely used, popular
  • Flexible workflows

Workshop Template

  • Clone the codebase from your fork
  • Open git bash

    git clone https://github.com/<your-username>/emi-calculator.git
    cd emi-calculator
    npm install
    

Getting Familiar With The Code

(Both the workshop codebase and VS Code)

Unit Tests

Does it work? Is anything missing?

Negative test case

git checkout -b <branch-name>

Add new test case to tests/emi.test.js

test('Should throw an error on negative interest rate', () => {
  expect(() => EMI.Loan(10000, -1, 10)).toThrowError('wrong parameters: 10000 -1 10')
});

Run tests

npm test

Negative test case

Commit

git add tests/*.test.js
git commit -m "Add test to validate whether Loan() allows negative values"

Linting

npm run lint
  • Remove extra semicolons, and commit again

    ./node_modules/.bin/eslint --fix .
    

Fix code

js // function Loan if (!amount || amount <= 0 || !installmentsNumber || installmentsNumber <= 0 || !interestRate || interestRate <= 0) { throw new Error(`wrong parameters: ${amount} ${installmentsNumber} ${interestRate}`) } `

Commit and push

git add src/emi.js
git commit -m "Disallow negative value for all parameters"
git push origin <branch-name>

Contributing Back

  • Create a Pull Request from <branch-name> to master
  • Watch CI job run and succeed

Open Source Software

Open Source all your projects

  • You learn from each other.
  • You get to practice how to build software the way startups and large companies build it.
  • You get to use state-of-the-art tooling. For free!
  • It’s like a resume. Your work speaks for you.

Project Tips

  • Address a need. Build something that you wish existed.
  • Don’t jump directly to writing code. Understand the problem.
  • Use Github and other free tools. Some of the most useful ones are:
    • Zeit Now (Build Previews and zero-config Serverless Deployments)
    • AWS/GCP/Azure has free tier/credits for new registrations
    • Firebase (Mobile app backend)
  • Use frameworks/boilerplate wherever feasible.

Thanks!

Rakshit Menpara

CTO, Improwised Technologies Private Limited

improwised.com

Feedback: http://bit.ly/sd-workshop