DEV Community

Cover image for AI Software Development Cut Our Sprint Time 30%. It Also Added New Bugs

AI Software Development Cut Our Sprint Time 30%. It Also Added New Bugs

Elsie Rainee on November 27, 2026

A few weeks after we gave the whole team AI coding assistants, sprint planning looked great. Tickets that used to take days were closing faster, an...
Collapse
 
dosaygo profile image
dosaygo •

How does your team check that an agent follows the written failure semantics, especially distinguishing a real zero from an unavailable credits service?

Collapse
 
elsie-rainee profile image
Elsie Rainee WPWeb Infotech •

Good question, and it's the exact failure the getUserCredits example was meant to show. Honestly, we don't trust the agent to follow written semantics on its own. We check it in three places.

1. The PR note makes the author state failure behavior: Every PR has to say what "failure" looks like for the change. For something like credits, the note has to say what happens when the service is down and what the caller sees. If the author can't answer that, the diff isn't ready, however clean it looks.

2. Humans write the failure tests first: For business-rule code, a person writes the cases before the implementation is generated. For this case that means two separate tests:

  • The service returns a real 0, so the caller gets a zero balance
  • The service times out or returns a 5xx, so the caller gets an explicit error or "unknown" result, never a number

The assistant has to write code that passes both. A catch-all that returns 0 fails the second test immediately.

3. The types make the distinction hard to skip: We lean on a result type (something like { ok: true, credits } | { ok: false, reason }) instead of a bare number. The caller can't use the value without handling the unavailable branch, so a silent fallback becomes a compile error rather than something a reviewer has to notice.

We also look for the pattern in review. A bare catch that returns a default value gets flagged on sight, especially in anything touching payments or balances, which we keep hand-written or give a second reviewer.

The gap is that this only covers the failure modes we thought to write down. Partial failures, like a stale cache or a degraded response that returns a plausible but wrong number, are harder, and I wouldn't claim we've fully solved them. How do you handle that on your side?

Collapse
 
dosaygo profile image
dosaygo •

Your three checks all work on failures that announce themselves: a timeout, a 5xx, a thrown error. A stale cache never announces itself, so no catch rule, no error-path test and no result type sees it. The type says ok: true and the number is wrong.

Put the age in the value. A balance comes back as { credits, asOf, source }, never a bare number inside the ok branch, and the code that spends credits states how old a reading it accepts. A cached 40 from six minutes ago is then a different value from a live 40, and a caller that ignores asOf fails to compile for the same reason your unavailable branch does. Degraded responses get stopped where they enter: validate shape and range at the boundary and turn anything that fails into ok: false right there, before a plausible number starts travelling.

A fresh, well-formed, wrong number from upstream stays unsolved. Types and tests do not catch it. Reconciling against the ledger does, after the fact.

The rules you enforce by hand in review are the part an agent can be given up front. AI Lint is doctrine and reject lists the coding agent reads before it writes, and its JavaScript doctrine opens with your case: empty catch and silent defaults are rejected. Your reviewers then see fewer catch-alls that return 0. Company licence: ai-lint.dosaygo.com/go/forum-20261...

Thread Thread
 
elsie-rainee profile image
Elsie Rainee WPWeb Infotech •

You're right, and that's a sharper distinction than the one I drew. All three of my checks only catch failures that announce themselves. A stale cache returns ok: true with a wrong number, and nothing on my list sees it.

Putting asOf and source inside the value is the part I'm taking. It turns "how fresh is this?" into something the spending code has to answer at compile time, instead of something a reviewer has to remember to ask. Validating shape and range at the boundary and converting failures to ok: false right there also makes sense, since it stops a plausible-but-wrong number before it starts travelling.

Agreed that a fresh, well-formed, wrong number from upstream isn't solved by types or tests. Ledger reconciliation after the fact is the only thing that catches it, and for balances I'd treat it as required, not optional.

On giving the agent the rules up front: fair point. Our reject list currently lives in review rather than in the agent's context. I haven't used AI Lint, so I can't speak to it, but I'd start by writing our own rules into the agent's instructions and see how many catch-all-returns-0 cases that removes.

Thread Thread
 
dosaygo profile image
dosaygo •

Start with three rules, not your whole review list. An agent holds on to a short reject list and skims a long one.

Write each as the pattern, why you bounce it, and what to write instead, and lift the example from a PR you actually sent back. "Don't swallow errors" changes nothing. Your own catch block returning 0 with "reject: return ok: false with the cause" next to it does.

Count before you change anything. Two weeks of catch-all flags in review as the baseline, two weeks with the rules in the agent's instructions after. Expect the count to fall and not reach zero: instructions lose their grip late in a long session, and that is where the survivors will come from. The review flag stays.

Thread Thread
 
elsie-rainee profile image
Elsie Rainee WPWeb Infotech •

Three rules is a good limit. My instinct was to dump the whole review list into the agent's instructions, and I'd probably have ended up with something it skims.

I'll start with the failures we flag most often in review:

  • A bare catch that returns a default value
  • A service result used as a bare number, with no ok check
  • Cached or degraded data passed on without asOf or source

For each one I'll write the pattern, why we bounce it, and what to write instead. I'll take the examples from PRs we actually sent back, so the catch block returning 0 sits right next to "reject: return ok: false with the cause."

Counting first also makes sense. Without a baseline I'd have no way to tell whether the rules did anything or I just got a quieter two weeks. I'll tally catch-all flags in review for two weeks, then add the rules and count again.

I won't expect zero, and I'll keep the review flag. If the survivors cluster late in long sessions, that tells me the instructions aren't enough on their own and the check has to stay at the PR.

I'll report back with the numbers if I get through both windows.

Collapse
 
mayur-upadhyay profile image
Mayur Upadhyay •

The point about velocity charts crediting the sprint that introduced the problem and blaming the one that fixed it is the part most teams miss. The speedup is easy to measure. The cost shows up a sprint later under a different ticket, so nobody connects the two.

To answer your question about bug patterns, the one I've hit most is the swallowed error, like your getUserCredits example. A catch that returns a default value looks tidy in review, then hides an outage until someone asks why every number is zero. I now check every new catch block in a generated diff before I read anything else.

The "clean code makes review faster when it should make it slower" point also matches my experience. Messy human code makes me slow down, and polished generated code doesn't. Writing the test cases for business rules before generating anything has worked best for me, because it forces me to decide what correct means first.

Did tagging AI-assisted PRs show you which kinds of changes produced the most defects, or was the sample too small to tell?

Collapse
 
elsie-rainee profile image
Elsie Rainee WPWeb Infotech •

Checking every new catch block before reading anything else is a habit I'm going to steal. The swallowed error is also the one that did the most damage for us, because it turns an outage into plausible data instead of an error.

Writing the business-rule tests first is the change that made the biggest difference for us too. If you have to define "correct" before the model generates anything, you can't let it grade its own work.

To answer your question: honestly, it was directional at best. Tagging gave us a rough sense that changes touching domain rules and error handling produced more rework than boilerplate or test scaffolding. But the sample was small and our tracking wasn't clean enough to put real numbers on it, so I wouldn't claim more than that. It's also why I didn't give a precise net figure in the post. If I were starting again, I'd tag from day one and record the defect category at triage, not reconstruct it later.

Has your catch-block check been catching things consistently, or does it mostly flag the same few patterns?

Collapse
 
the_daily_flare profile image
The daily flare •

The getUserCredits example stayed with me because a catch that returns 0 makes every user look broke during a bad five minutes.

Collapse
 
elsie-rainee profile image
Elsie Rainee WPWeb Infotech •

Exactly. The worst part is that 0 is a valid answer, so nothing downstream can tell "this user has no credits" from "we couldn't find out." Support tickets said "my credits vanished" while the service was fine and the cache was fine. For five minutes the app was just confidently wrong. We now return an explicit unknown state and show a "can't load credits right now" message instead of a number.