Code Management

Best Practices

  1. Build an abstract Layer between your Version Control System system and the entire SCM Toolkit.
  2. Atomicity, so every operation is atomic, 0 or 1, True or False, there are no states in between.
  3. Avoid storing different types of data than the actual source code (no binfiles, media, etc..).

Common Problems

Pull Request VS Code Review

Choosing VCS System

Branching

Performance & Scaling

Binary Files

For every Distributed Version Control System (DVCS) handling (especially large) binary files is an issue.

Creating Workspace

For every Distributed Version Control System (DVCS) creating a workspace operation may be an issue, especially for big repositories or repositories with a big number of projets (subrepositories).

  • Facebook: “it takes about 10 minutes to begin discovering commits in Facebook’s 350,000-commit primary repository, and about 18 hours to import it all with 64 taskmasters on modern hardware.” Source: facebook-creating-workspace.

VCS/DVCS Migrations

Large Changes in Code Review

Most of Code Review tools do not support large changes.

Versioning

Android

Starting with Cupcake, individual builds are identified with a short build code, e.g. FRF85B. The first letter is the code name of the release family, e.g. F is Froyo. The second letter is a branch code that allows Google to identify the exact code branch that the build was made from, and R is by convention the primary release branch. The next letter and two digits are a date code. The letter counts quarters, with A being Q1 2009. Therefore, F is Q2 2010. The two digits count days within the quarter, so F85 is June 24 2010. Finally, the last letter identifies individual versions related to the same date code, sequentially starting with A; A is actually implicit and usually omitted for brevity.

Tools

Centralized VS Distributed

Git, Mercurial and Bazaar domination

Git

Tools and Plugins

Git Propaganda

Git Branching

Git on Windows

Git & Multiple Projects

Git Tools

Git Use Cases

Online Tutorials

Git Presentations

Git cheatsheets

Best Practices

Git and Android

Gerrit

Cross Repo Dependencies

Gerrit Server - public instances

Tips and Tricks

Mercurial

Propaganda

  • Google announces Mercurial support:
  • CodePlex announces Mercurial support:

Architecture

  • Mercurial Architecture: ols-mercurial-paper.pdf

Veracity

Fossil

Boar

VCS

VCS is an abstraction layer over various version control systems: vcs-homepage. Project seems to be dead.

Commercial

Perforce

Code Review

Phabricator

Phabircator is developed and used by Facebook (and many other companies.. )

  • Homepage: phabricator-homepage

Rietveld

Code Review Use Cases

Tips and Tricks

Resources

Software Development KPIs

Development KPIs

  • Lines of code per developer
  • Build test failures
  • Unit test failures
  • Number of bugs found in their code
  • Number of bugs fixed
  • Actual time to finish a task based against their own estimate
  • Number of developers and commits by organization, site or country (Bangalore, Brugge)
  • Number of revisions merged per contributor
  • Number of revisions abandoned per contributor
  • Number of revisions merged per organization, site, country
  • Number of revisions abandoned per organization, site, country
  • Ratios merged/abandoned
  • Number of new contributors with 1 / 2-5 / 6+ changes submitted in the past 3 months
  • Number of contributors stopping contributing or decreasing continuously in the past 3 months.

Gerrit KPIs

  • Number of Code review comments
  • Average time spent on Code Review
  • Number of commits reviewed in <2 days, <1 week, <1 month, <3 months, >3 months or unreviewed
  • Code Review queue size
  • How many new users registered (per day, per month, per year)

SCM Team KPIs

  • Time to set up an environment
  • Time from change request to release
  • Mean time to resolution

JIRA Related KPIs:

  • Average time for an accepted bug report between bug creation date and PATCH_TO_REVIEW status being set
  • Average time for an accepted bug report between PATCH_TO_REVIEW status being set and RESOLVED FIXED status being set.
  • Average time for an accepted bug report between bug creation date and first comment by not the reporter her/himself.

Deployment KPIs:

  • Speed of deployment
  • Deployment success rate
  • How quickly service can be restored after a failed deployment