Testing Tips

  • Plan your testing at an early stage. This will enable you to design and code with the tests in mind. Your validation is likely to improve as a result.
  • Try to "break" your code rather than demonstrate that it works. A good test has a reasonable chance of finding an error. (There is a tendency to want to show how well your code works rather than to find bugs that you will then need to eliminate).
  • Every time you make a change to tested code, you need to test thoroughly again. (Changes are often made too quickly, with unforeseen consequences to other code).
  • Consider some automated testing in order to facilitate regression testing.
  • White box testing only tests the code that has been written. Your code will not meet the specification if you have forgotten to code some of the functionality.
  • Be aware that black box testing may reveal errors that are difficult to locate.
  • Ask someone else to test your code. A fellow student often manages to find a bug remarkably quickly!
Programming - a skill for life!

White and black box testing, test cases, automated testing with and without TestRunner