Github model for open source

Agile Best Practices

Source : http://xprogramming.com/what-is-extreme-programming/

Why there is coding standard

  • Get your code (patch) accepted
  • Enable team work through readability, conventions
  • Ease maintenance (40% to 80% of the cost of software through its lifecycle)
  • Enforce good practice e.g. reduce complexity
  • Improve quality
  • Work well with automated tools (e.g. counting lines of code, diffs)

Code Review tools

  • Several tools to considered
  • Gerrit is open and compatible with git
    • Created for the Android project
    • Used by big open source projects such as MediaWiki and Qt

Gerrit

Discuss code

Code Review

Image : https://git.eclipse.org/r/Documentation/intro-quick.html

* Quality check * After build & test * Automated tools e.g. Gerrit

How gerrit works

Code review workflow

Image : source

* Typically integrated with a CI/CD pipeline. * If the code builds, then it’s good to go for review.

Gerrit Installation Instructions

Refactoring

  • Classic SDLC is linear: write all the code to specs and send it to QA for testing
  • Refactoring is the idea that code can continuously be rewritten in a better way, do it ASAP, before it is too costly to change anything
  • Reduce code complexity (and improve maintainability)
  • Provide non functional enhancements
  • Extensibility: re-architect the codebase more effectively

Pair programming

  • Gained popularity recently
  • Code quality
  • Developer capacity
  • Developer likes it
  • Pivotal like it

Practical pair programming

##### Original recipe * One computer * 2 keyboards * 2 mouses * 2 chairs * 2 engineers
Do that often, on dedicated workstations.
##### Distributed(remote) * Cloud IDEs such as Codenvy (hosted) and *Eclipse Che* (shared on-prem) * IDEs such as MSFT * Desktop sharing like TeamViewer and webconferencing tools (like microsoft teams)

Lab test - 4 Code Review and Pair programming

Test Driven Development

  • Avoid regression
  • Easier maintenance and error detection
  • Test bite-sized code
  • Release early and often

Types of test

  • Unit testing (for e.g. Mocha for JS)
  • Inegration testing
  • System testing
  • Interface testing
  • Acceptance testing
  • Performance testing
  • Stress testing
  • Reliability testing

The list is long...

TDD Process

  • Start by adding a test
  • Run all tests and make sure the new one fails
  • Write the code
  • Run all tests
  • Refactor as needed

Lab test - 5 Integrating CI/CD