by shigemk2


97 Things Every Programmer Should Know 95 Write Tests for People

YOU ARE WRITING AUTOMATED TESTS for some or all of your production code.

Good tests act as documentation for the code they are testing.

  • Describe the context, starting point, or preconditions that must be satisfied
  • Illustrate how the software is invoked
  • Describe the expected results or postconditions to be verified

Each test should clearly illustrate the cause-and-effect relationship among these three parts.

Make sure they report errors in a helpful and meaningful way.

The only way to do this is to have someone who isn't familiar with your code read your tests and tell you what she learned.