Jester Hints and Tips

Copyright (2000-2003) Ivan Moore.

Many thanks for all the questions and feedback that have resulted in this documentation, it's much appreciated. (FAQ to be merged into here some time.)

Q) I'm having problems getting Jester to work - what are the most common problems?

A) For the current version of Jester, you need to have everything on the static CLASSPATH. It's a real nuisance and it'll be fixed some time, but for the moment just put everything on the static CLASSPATH - e.g. 'set classpath=%classpath%;allMyLibs.jar;myBinDirectory'

A) Make sure javac is on the PATH - the standard JDK Windows installers add java but not javac to the PATH.

Q) Jester does a mutation that makes my code fail to compile. Why does it do that and I do I work around the problem?

A) Jester's mutations are very simple text search and replace. If you have some code that Jester mutates in such a way that it no longer compiles, Jester will usually keep going, reverting the mutation that caused the compilation failure and carrying on. If Jester fails for some reason because of a particular bit of code, you can get Jester to ignore that bit of code by putting a comment //stopJesting before and //resumeJesting after that bit of code.

Q) How do I make Jester run faster?

A) Your mileage may vary, but generally the time to recompile the modified source code will be a significant proportion of the overall time to run Jester. Therefore, an easy way to make running Jester faster is to use a faster compiler than Sun’s “javac”. A well known fast compiler is “Jikes” from IBM (see http://www.jikes.org). To use Jikes instead of javac:

Running Jester on itself (by making a copy of Jester under a different package – you can’t normally run Jester on itself), using javac took 6 mins and using Jikes took 2 mins (on my machine; again, your mileage may vary).

Q) How do I make Jester run faster if my tests take a long time to run?

A) Use standard optimization techniques such as inspecting the code with a profiler and eliminating redundant code in the unit tests.

A) Make sure you aren't mutating comments.

A) Make sure you aren't mutating untested code such as samples and the tests themselves.

A) Make sure the most expensive tests (e.g. ones that do I/O) show up later in the test suite. You want Jester to try the cheapest (fastest) tests first. If they fail, it doesn't run the more expensive tests because Jester stops running the tests as soon as any fail (it knows that the mutation has been caught by at least one test, which is all Jester is interested in).

Q) How do I get Jester to test only certain files rather than all in a directory.

A) Simple – just delete the source for all the files that you don’t want to test (without deleting the corresponding class files).

Q) How do I run Jester on code that uses “Ant” to build it?

A) Again, the compilation command can be changed:

SourceForge Logo