Skip to content
mentoor

Topic 5 of 5 · 4 min read

Measuring whether CI agents help

Goal: Use acceptance rate, false-positive rate and cost per pull request to decide whether to keep, tune or remove a CI agent.

Keep a CI agent only if its measured benefit beats its measured cost, and decide with numbers from your own repositories, not with the vendor's demo. An agent can feel useful because it posts a lot. Posting is activity; value is comments that people act on.

Check yourself · 1 of 3

Which measure best shows that a review bot's comments are useful?

Choose one answer

Why it matters

A bot costs money (model usage, runner minutes) and attention (every comment someone reads). Without measurement, a noisy bot stays forever because nobody wants to switch it off, and a useful one gets removed after one bad week.

What to measure

  1. Acceptance rate. Of the bot's comments or fixes, what share did people apply or mark helpful? Count it per comment, not per PR.
  2. False-positive rate. What share of comments were dismissed as wrong or irrelevant? This is the noise.
  3. Misses. Bugs a human found later that the bot passed. Sample a handful of merged PRs and re-review them.
  4. Time to merge and review time. Compare PRs with and without the bot, over the same period and similar size. Delivery measures such as lead time and change failure rate (the DORA metrics) show whether quality moved.
  5. Cost per pull request. Model spend plus runner time divided by the PRs it touched.
  6. Human time spent. The minutes people spend reading and dismissing comments.

How to decide

Run the bot on a trial period, write the measures in a table, and set the threshold before you look. For example: keep if acceptance is high and the rate of dismissals is low; tune the rule file if noise is the problem; remove if the cost is higher than the saved review time.

Before and after

Weak claim: "The bot posted 400 comments this month, so it is busy."

Better: "Of 400 comments, 120 were applied, 220 dismissed and 60 ignored. The acceptance rate is 30 percent. Median time to first review fell on small PRs, and did not change on large ones. Cost was a few dollars per PR."

What goes wrong

  • Counting comments, not outcomes.
  • Comparing different periods or PR sizes. A holiday week looks like a win.
  • Ignoring the human time cost.
  • Measuring only the good days, or stopping after one bad week.

Examples

Tune, don't remove

A bot has a low acceptance rate, and most dismissed comments are about naming. The team adds a skip-style rule. Next month acceptance rises and the noise falls. The data pointed at the rule file, not at the tool.

Remove

A bot fixes failing builds. Over a quarter, most of its fixes were reverted or rewritten, and each run cost more than the developer time it saved. The team switches it off and keeps the cheaper review comments.

Key points

  • Measure outcomes such as comments applied, not the number of comments posted.
  • Track false positives, because noise is the main way a bot loses trust.
  • Compare PRs with and without the bot over the same period and at a similar size.
  • Include model spend, runner time and human reading time in the cost per pull request.
  • Set the keep, tune or remove thresholds before you look at the data.

Common mistakes

  • Treating the number of comments as proof of value.
  • Judging after one week of data.
  • Leaving out the time humans spend dismissing comments.
  • Comparing against a period with different PR sizes or staffing.

Check yourself · 2 of 3

A bot has a high dismissal rate, mostly for style nits. What is the best next step?

Choose one answer

Check yourself · 3 of 3

Which cost belongs in cost per pull request for a CI agent?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic