Code reviews don't usually find bugs
aviator.co
aviator.co
So, "don't usually" equals 15%. :^)
Deep dive: https://www.michaelagreiler.com/wp-content/uploads/2019/02/C...
I don't know of anyone that regularly does this during code reviews.
In my experience, automated tests help to catch regressions, i.e., they help catch error cases that people have already anticipated. If the system fails in some brand new unexpected way, you won't have tests for it by definition.
Similarly, static analysis can help catch certain classes of bugs, but there's plenty of things they won't be able to spot.
Yes, they're both useful, but neither of these is a replacement for code review. They're all complementary.
Tests find bugs, code reviews look for quality. Sometimes I can spot a bug but it’s not my primary goal.
My counterpoint:
- Most code reviews of my code don't find bugs.
- At least half of the bugs I write are caught during code review.
Both are true.
My friend, who do you think writes the tests, and how do you think they get into the system?
Often we're writing new functionality. There are no tests for it, so they're part of the pull request, and must be reviewed to make sure they're actually testing the right thing!
Edit: or, rather, in my experience the author of the code often finds the bugs when explaining it to the person standing next to them. This goes away in the GitHub-style pull request.
2. This is an ad.
And yes i foster code review in my team and yes its a skill people need to learn.