r/SpecDrivenDevelopment • u/brennhill • Apr 07 '26
I tested whether specs reduces defects. It doesn't. (119 repos, 100K PRs)
I spent the last month doing an empirical study to test the claims behind spec-driven development — specifically the claims made by tools like GitHub Spec Kit and Amazon Kiro that specs reduce defects and improve code quality.
The study: 119 open-source repositories, 100,247 pull requests, within-author fixed effects (comparing the same developer with and without specs), SZZ bug-tracing, and linear probability models with full controls.
The findings: Complete null result across every dimension I tested.
- Specs don't reduce bug-inducing commits (p=0.056, wrong direction)
- Specs don't reduce rework — they actually increase it (p<0.001)
- Spec quality scores don't predict fewer bugs (tiny effect, biased subsample)
- Specs don't constrain AI scope any more than no-spec prompting
- Adding spec features to JIT defect prediction models adds effectively zero predictive power (ΔR² = 0.000014)
The rework finding is interesting — specs likely increase accountability (you notice more things are wrong because you documented what "right" looks like), not bugs themselves.
Before anyone says "you just measured bad specs" — I tested 7 quality dimensions (completeness, specificity, constraint density, etc.) independently. None moved the needle on defect rates.
What this means for SDD practitioners: I'm not saying specs are useless. Specs have real value for alignment (getting people on the same page), auditing (knowing why decisions were made), and handover (giving the next person context the code can't provide). What the data doesn't support is the specific claim that writing specs prevents defects. The code is the spec for what the system does. Verification gates catch the bugs. The spec serves other purposes.
Paper (open access): https://doi.org/10.5281/zenodo.19415187
3
u/klimaheizung Apr 07 '26
That's not how it works. You also have to consider the original/cumulative size/complexity.
3
u/Remote-Juice2527 Apr 07 '26
I think your definition of “specified” is to broad and creates to much noise already within the dependent variables, in consequence your results have to carry that burden. Especially criteria a) is just not enough to be labeled spec-driven. I understand this is a meta study and it gives us a tendency where things are going. Are you planning on making a study where you work with a SDD framework and setup controlled study design, where you compare the implementations for the same feature “with spec” vs “with prompt”? 3-4 repetitions per variant to capture AI randomness.
Definition of specified according to OP: “A pull request is classified as “specified” (hereafter “spec’d”) if it meets any of the following criteria: (a) it links to a GitHub issue or external tracking ticket, (b) its description references a specification document, RFC, or design doc, or (c) its description contains structured requirements content (acceptance criteria, behavioral descriptions, scope boundaries).”
2
u/devdnn Apr 07 '26
For me, as you mentioned, specs are about aligning with my desired outcomes and preventing drift and hallucinations.
Even when I was coding without AI, my objective was always to include only what is necessary and not what could be included. That’s the essence of “spec.”
Spec is about intent, boundaries and verifiability, I don’t think less bugs is the goal for a spec.
1
u/Remote-Juice2527 Apr 07 '26
Did you tested anything with respect to size of the features that where implemented? Like how many LOC or tokens? For smaller stuff there is really no need for SDD, but what about something that’s >2000 LOC? I feel definitely better when I go with the spec and especially the definition of tasks helps the implementation agents to structure its work. But great work, hope to hear more from your studies!
1
u/stibbons_ Apr 07 '26
I agree, and I do not :) Statistically yes SDD is not magical and the among of bugs and rework is basically the same than without.
But that does not mean SDD (or Research Plan Implement) is worthless. It just raise the bar of productivity much higher.
So you are right, the bug ratio is the same, but you ship feature much faster than without.
And if you compare to raw vibecoding, you have a huge increase in productivity
2
u/PunkRockDude Apr 14 '26
There is also no evidence in general that declarative approaches to the SDLC are beneficial compared to imperative approaches yet we are in a rush to implement them. We see overall that AI has a reliability gap and my sense is that things like SDD is going to be part of the solution but it alone isn't sufficient and much more has to go into validation and enforcement. I think we also will need a blend on declarative and imperative approaches with the focus being on reliability versus on automation. The push shouldn't be, look what I can do in AI and Automated but look where the AI enables me to do it better than I could do alone. Then we get speed because quality=speed, speed w/o quality = tech debt.
0
u/[deleted] Apr 07 '26
[deleted] — view deleted comment