Programmer tests should be sensitive to behavior changes and insensitive to structure changes. If the program’s behavior is stable from an observer’s perspective, no tests should change.
— Kent Beck
Programmer Test Principles
Programmer Test Principles
When you have a lot of tests that are sensitive to structure (they go red when you change the structure) they are structure-cementing tests.
You can combat structure-cementing tests with a TestDsl. This repository contains TestDsl examples in:
-
java-dsl, a simple example where everything is in the same module