- For tests, use data that makes the tests easy to read and follow.
- Don’t scatter data values around.
- Differences in data should be meaningful. If there’s no conceptual difference between
1
and2
, use1
. - If system handles multiple inputs, tests should reflect multiple inputs. If there’s no difference between handling list of three items and list of ten items, use the one that is shorter.
- Never use the same constant to mean more than one thing. For example, don’t call
plus(1,1)
, useplus(2,3)
instead.
Realistic data is the alternative to test data.