Testar is a software solution that helps minimize the duration of running unit tests for Java programs.
The working process of Testar is quite simple. The first time Testar is invoked, it runs all tests in JUnit test suite(s) provided to it. For each testXXX() method, it records code coverage information, which is saved into the Test Database (TDB) along with checksums for application and test classes and methods. In subsequent invocations, Testar uses this saved data to select only those tests that exercise the updated code. It helps save time significantly.
While working with Testar, it should be kept in mind that this tool assumes that all the (changeable) input for the tests is in the test code. It is necessary to give Testar names of these files, i.e., if your tests depend on input from other sources like resource files. When such a file changes, Testar will rerun all or selected tests, depending on additional options specified.
Time savings may vary depending on the amount of changes made to the code and the size of the code you have changed, among other factors. The smaller your changes are (or the more frequently you run Testar), and the more tests you have, the higher will be the relative savings. The author has observed an average 60-70 per cent reduction in time to run tests for large applications.
To use Testar, you need to add specific options to the command line that invokes your test suite. You should add -javaagent:< Path to Testar.jar >=< Testar options >. For example, if normally you invoke your test suite as java -classpath junit.jar:MyApp.jar junit.textui.TestRunner myapp.MyAppTests, you should modify the above line by adding java -javaagent:Testar.jar=tdb=testar.tdb -classpath junit.jar:MyApp.jar junit.textui.TestRunner myapp.MyAppTests, where the tdb option specifies the name of the Testar DB file in which the tool will record information about your tests' code coverage. Testar offers a comprehensive list of options that can be passed as multiple options to the tool by specifying them as option1=value1, option2=value2, and so on.
Version 1.0: N/A