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:

  1. Use a piece of code in a test harness
  2. Write an assertion that you know will fail
  3. Let the failure tell you what the behavior is
  4. Change the test so that it expects the behavior that the code produces
  5. 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.