Extreme Programming Perspectives
Extreme Programmers have confidence in code if it passes tests and have confidence in tests if they catch errors [Beck2000]. Many Extreme Programmers temporarily put deliberate errors in their code to check that their tests catch those errors, before correcting the code to pass the tests. In some project teams, a project saboteur is appointed, whose role is to verify that errors that they deliberately introduce into a copy of the code base are caught by the tests [Hunt+1999]. Jester performs similar test testing mechanically, by making some change to a source file, recompiling that file, running the tests, and if the tests pass, displaying a message saying what it changed. Jester makes its changes one at a time, to every source file in a directory tree, making many different changes to each source file. (The different types of changes made are discussed later.) Note that each change is undone before the next change is made that is, changes are made independently of each other. Jester can modify not only the code that the tests are testing, but also the test code itself. If a test is modified but does not fail when run, the test may be redundant or erroneous. The initial version of Jester worked only for Java code with JUnit tests; the same approach can be used for other languages and test frameworks.1[1] A version of Jester, called Pester, has been built for Python code and PyUnit tests.2[2] Java and JUnit were chosen for the initial version because the author uses both, and JUnit is probably the unit test framework most widely used by Extreme Programmers [Gamma+1998]. [1] See http://www.junit.org. [2] See http://www.jesterinfo.co.uk, http://www.python.org, and http://pyunit.sf.net. The ideas of mutation analysis [Friedman+1995] or automated error seeding [Meek+1989] are not new, but Jester is able to be more widely applicable than other tools because of the widespread use of JUnit. For Jester, or any similar tool, to work, it needs to be able to run the tests programmatically, and that is what makes the use of JUnit so important to both the simple implementation of Jester and its wide applicability. |