Sunday, March 13, 2016

Stress Testing: the [Almost] Silver Bullet for Debugging | Coursera

  1. It is very important to write programs that work correctly on all the allowed inputs.
  2. Testing is essential to writing correct programs.
  3. First test on a few small manual tests, then test for each type of answer, then test on large test cases for time limit and memory limit, then test on corner cases.
  4. After that, apply stress testing to ensure your program works - it will almost always lead to correct solution. You can do it before your first attempt to submit your solution - and will often get it right from the first attempt!
  5. Stress testing consists of implementing the intended solution, another simple possible slow solution, a test generator and an infinite loop which generates tests and compares answers of the two solutions.
  6. Always try to find the smallest test cases on which your solution fails.
  7. Try different regions of the test space when generating cases for stress testing.