Characterization Tests - lovelejess/trivia GitHub Wiki
“Okay, so we need tests- how do we write them?"
- Tests that document the actual current behavior of the system
- Used to preserve behavior
How To Implement:
- Use a piece of code in a test harness
- Write an assertion that you know will fail
- Let the failure tell you what the behavior is
- Change the test so that it expects the behavior that the code produces
- Repeat.
Try It Out!
- Write a characterization test using the method above to describe what the
roll
method does. Make sure that the output of the game is tested.