[brailleblaster] JUnit and other approaches to testing

  • From: "Susan Jolly" <easjolly@xxxxxxxxxxxxx>
  • To: <brailleblaster@xxxxxxxxxxxxx>
  • Date: Mon, 20 Dec 2010 17:48:35 -0700

I was able to get JUnit working very quickly after reading this simple tutorial:

http://code.google.com/p/t2framework/wiki/JUnitQuickTutorial

My impression is that JUnit works best on very modular code where you know what the right result for a method is. A more comprehensive approach is the t2 tool referenced in the tutorial. This tool tests an entire class by generating lots of random method calls and field updates.

Since I haven't been using JUnit, I typically add a main method to each class while I'm developing it. The purpose of the main method is to test for straightforward errors such as typos and simple mistakes in logic. These tests could be easily refactored to JUnit tests which has the advantage of eliminating clutter.

SusanJ

Other related posts: