↓ Skip to main content

Testing

Not Unit Tests, but Our Units Are the Problem

·15 mins
Since coding agents produce huge numbers of fine-grained tests, some demand that we give up unit tests. But the problem is not unit tests, it is units that are defined too small: tests that lock in the current class structure make refactoring harder despite high coverage and a high mutation score. As a measure of refactoring safety, both metrics are incomplete without the tested module depth. The article proposes testing domain components through their public API, determining a module-related mutation score and defining test boundaries as part of the architecture.