Search⌘ K
AI Features

Balancing Automation and Human Review

Understand the complementary roles of automated static code analysis and manual code review in maintaining code quality during test-driven development. Learn about tools like Sonarqube, the limitations of automation, and collaborative practices such as pair programming and mob programming that enhance code design and reduce defects.

This lesson reviews another area surprisingly resistant to automation: checking code quality.

Static code analysis tools for code quality

As we’ve seen throughout this course, TDD is primarily concerned with the design of our code. As we build up a unit test, we define how our code will be used by its consumers. The implementation of that design is of no concern to our test, but it does concern us as software engineers. We want that implementation to perform well and to be easy for the next reader to understand. Code is read many more times than it is written over its life cycle.

Some automated tools exist to help with checking code quality. These are known as static code analysis tools. The name comes from the fact that they do not run code; instead, they perform an automated review of the source code. One popular tool for Java is Sonarqube, which runs a set of rules across a code base. ...