Hacker News new | ask | show | jobs
by johnb 2870 days ago
Author here. The post is largely written from a point of personal experience and philosophy but that's the one statement I'm comfortable saying has empirical backing.

I link to https://blog.codinghorror.com/code-reviews-just-do-it/ in the post which has an excerpt from code complete:

> … software testing alone has limited effectiveness – the average defect detection rate is only 25 percent for unit testing, 35 percent for function testing, and 45 percent for integration testing. In contrast, the average effectiveness of design and code inspections are 55 and 60 percent.

2 comments

As a firm believer in TDD and pair programming, I would caution you that since ultimate goal of programming productivity is unmeasurable, defect rate could also just be a measure of how much slower those practices are.

I don't think that's the case, but really we have no way to prove that it's true. Just a word of caution if you are ever trying to convince someone, it's best to be up front with the possible flaws of those studies.

My experience is that having a really great design eliminates a lot of bugs (60% is perhaps not unreasonable, although pretty hard to measure), but having an awesome design is not even close to being the same thing as doing regular code reviews.

I'm often thrown in to a project with bad to mediocre design and I am not able to just change the design to become "good" just by reviewing PRs. I can only attempt to push the design into a slightly better direction over a long period of time.

Similarly, just because it's reviewed doesn't mean that the design is great.

I am probably able to hit something approaching 45% defect detection rate with integration testing on most projects though.

With code reviews I'd say it's about 1 or 2%. Bug-wise, I usually only spot fairly obvious "language" gotchas (e.g. initializing an empty list in a method signature in python).