The system under test has a problem
or is incomplete
.
The test itself is flawed
.
Test body contains all of the information
a reader needs to understand it arrives at its results.
Test contains no other distracting or irrelevant information
.
Bad example
Problem:
The test is passing a lot of irrelevant information into the constructor
, and the actual important parts
of the test are hidden inside of a helper method
.
Good example
Solution:
The test can be made more complete by clarifying the inputs of the helper method
Using another helper to hide the irrelevant details
of constructing the calculator.
newCalculator hides irrelevant details.