giftBatch size

Batch size measures how much work is bundled up in a change. Swarmia offers tools for evaluating pull request batch size by looking at the total number of changes in a single pull request.

Definition

Batch size is calculated by the lines of code changed (lines added + lines removed) in a given pull request.

Excluding auto-generated files

Repositories often contain generated files, which could be related to e.g. package dependencies. In order to provide an accurate view of the real changes, Swarmia automatically cleans up the total change count of some commonly used generated files.

You can configure these exclusions in Settings > Pull requests > File exclusionsarrow-up-right. Swarmia provides an extensive set of default rules to filter out most common generated files.

Example

A pull request with 541 lines added and 215 lines removed (+541 -215) has a batch size of 756.

Why it matters

Splitting work into small increments is a great way to improve delivery. Small pull requests are easier to plan and review, and less risky to deploy.

Read more in Analyzing pull request batch size

Batch size benchmarks

  • Great: < 200 lines

  • Good: < 500 lines

  • Needs attention: ≥ 500 lines

How to use it

In Swarmia, the chart that shows the pull request size vs cycle time shows a set of pull requests in the selected time frame and charts them based on their individual cycle time and the total number of lines of code changed in the pull request. This chart allows you to see correlations between the size of a pull request and its cycle time.

Pull request size vs. cycle time plot in Swarmia

Seeing the distribution of larger batch sizes and higher cycle times can indicate that your team needs to focus on delivering smaller batch sizes. This change can improve not only your cycle time but also your quality.

See also Analyzing pull request batch size

Where to find it

You can find batch size metrics under Insights → Code → Batch sizearrow-up-right.

Last updated

Was this helpful?