Downloading, "installing" (well, in this directory anyway), and testing JUnit : $ which java /usr/local/bin/java $ java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing) $ wget http://umn.dl.sourceforge.net/sourceforge/junit/junit3.8.1.zip $ unzip junit3.8.1.zip $ cd junit3.8.1 $ export CLASSPATH=$CLASSPATH:`pwd`/junit.jar:`pwd`/src.jar $ cd .. Here's the test : $ java junit.textui.TestRunner junit.samples.AllTests ......................................... ......................................... ..................................... Time: 0.712 OK (119 tests) And here's the graphical test thingy. (Works under X11 if cs command line is from "ssh -X user@cs".) $ java junit.swingui.TestRunner junit.samples.AllTests # ------------------------------------------------------ And here's my example tests, all in the default (unnamed) package. $ javac *.java $ java RunBinarySearch bs.one is '1' $ java TestBinarySearch ..F Time: 0.007 There was 1 failure: 1) testThatItsZero(TestBinarySearch)junit.framework.AssertionFailedError at TestBinarySearch.testThatItsZero(TestBinarySearch.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at TestBinarySearch.main(TestBinarySearch.java:19) FAILURES!!! Tests run: 2, Failures: 1, Errors: 0 # ------------------------------------------------------- Finally, let's make sure that these versions are saved. $ mkdir BS_versions $ mkdir BS_versions/feb17 $ cp *.java BS_versions/feb17 # ------------------------------------------------------- In class : * implement Programming Perl's stuff in java, using this test framework