Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

What is Time to Merge?

Time to Merge measures how long your team takes to create, review and merge a Pull Request (PR) to a single branch.

Why Time to Merge matters

Code reviews are an important part of the software development lifecycle because they provide the ability for code written by team members to be peer reviewed and assured for quality before the code is merged to a single branch. Reviewing pull requests can also be one of the most time consuming activities of a team’s software development process.

We measure Time to Merge because code reviews can often get blocked, impacting how fast you can ship your product to your customers (additional insight that can be gleaned from viewing your team’s Cycle Time).

Optimising Time to Merge will improve the time it takes your team to deliver value to your customers, as well as improving the quality of the value you deliver. When done well, the code commits and their attched messages within a Pull request tell a story to people examining code at a later date, improveing maintainability and serviceability of the code base.

What ‘good’ Time to Merge looks like

Small pull requests are easier to review, making it more likely for code to be thoroughly reviewed before approval. It helps to speed up the review, reduces risk of introducing bugs into the codebase, helps not block other developments and speeds up the product development process.

Common practice suggest developers should review Pull Requests no more than 200-400 lines of code (LOC) at a time. The brain can only process so much information at a time. Beyond 400 LOC, the ability to find defects diminishes.

Research also indicates that a review of 200-400 LOC over 6-90 minutes should yield70-90% defect discovery.

Large pull requests tend to be glazed over and rubber stamped, limiting the effectiveness of defect detection.

How Umano measures Time to Merge

Umano measures Time to Merge by observing for each Pull Request merged during the given interval, the time from when the Pull Request was created to the time when it was merged into master.

Practices that influence Time to Merge

  • Number of comments on a PR

  • Number of tasks on a PR

  • Size of the PR

  • Number of issues addressed in a PR

  • Number of time a PR has reviewed (approvals)

  • Time to first review

What’s included?

Each model looks and specific activities within the tools. Below a list of activities that contribute to Balance of Communication and activities that do not have an impact on this metric.

Included

Not included

All Pull Requests in selected repositories

x

Tips for improving Time to Merge

Aim for one succinct commit

Describe your changes well in each commit

Reviewers should ensure the commit history is excellent, that good changes are made quickly, that the code review is performed and that they understand what is being changed, from the perspective of someone examining code in the future.

Encourage a culture where all team members can share in the responsibility of being a reviewer

Ensure there is a balance between flow and ensuring the quality of your team’s PRs

Resources

  1. Dias, H., The anatomy of a perfect pull request, 2018, <https://medium.com/@hugooodias/the-anatomy-of-a-perfect-pull-request-567382bb6067 >

  2. Osepchuk, B., Optimal pull request size, 2017, <https://smallbusinessprogramming.com/optimal-pull-request-size/>

  3. Riosa, B. The (written) unwritten guide to pull requests, 2016, <https://www.atlassian.com/blog/git/written-unwritten-guide-pull-requests

  4. Dias, H., The anatomy of a perfect pull request, 2018, <https://opensource.com/article/18/6/anatomy-perfect-pull-request

  5. Hewa, G., How Big is Your Pull Request?, 2017, <https://hackernoon.com/how-big-is-your-pr-32c4d67ad76c

  6. Yu, Y., Wang, H., Filkov, V., Devanbu, P. and Vasilescu, B., 2015, May. Wait for it: Determinants of pull request evaluation latency on GitHub. In Mining software repositories (MSR), 2015 IEEE/ACM 12th working conference on (pp. 367-371). IEEE.

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.