Chapter 5. Code Quality, Testing, and Dependencies
Coding agents produce and change code faster than anyone can review it. They’ll confidently modify a method with a cyclomatic complexity of 47, zero test coverage, and 200 call sites depending on it, where a careful engineer would just leave it alone. And an agent not only runs into code like this, but it also generates it. The same data on quality that steers an agent away from risky code catches the risky code it just wrote.
Quality dashboards, coverage reports, and dependency scans all live on a server for a human to review. To an agent that opens a repo and acts in seconds, information that isn’t clearly accessible is, functionally, information that doesn’t exist (or must be inferred). This chapter is about three categories of codebase knowledge—quality, tests, and dependencies—and why agents and humans both need them as real-time data, resolved from the code itself and current at the moment of the next change.
Code Quality as Continuous Signal
Code quality used to be a question of whether the code was readable, testable, and understandable by the next engineer. That still holds. But agents add a more urgent question: What is the health of the codebase at the moment the next change starts? A 78% maintainability score on a dashboard doesn’t help an agent that just opened a 2000-line class.
Complete quality data needs to answer questions at three altitudes, because problems at one level are usually symptoms at another:
- Method ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access