VTR

Validator of Test Cases for Software Releases

We have five "test-case modifications towards software release" patterns. Here we describe how VTR validate given test cases according to these patterns.

VTR monitors JUnit version updates in a Maven-based software project. Since Developers describe dependencies among libraries such as JUnit in a project object model (POM) file in the XML form, VTR parses the XML file to specify the JUnit version used in this project. If the version equals 4.x, VTR then searches Java files located under a "/src/test/java" directory. By parsing these files, VTR finds "public void test*" methods without a Test annotation. If any, VTR suggests developers to add the annotation to these found methods.

To obtain test cases that causing warnings, VTR compile test cases ("$ mvn test-compile"). It then parses the compilation results and finds test cases causing warnings. However, Maven tells only the existence of these warnings, VTR compile each the test case ("$ javac -cp ${CLASSPATH} ${TEST_CASE}") and specify warning information in detail, such as warning type and code location. Note that this pattern is related to the pattern #5.

This pattern has two strategies, as follows.

VTR parses the source code of test cases (methods) and detects "try...catch" statements. If the test cases call the JUnit "fail" method, VTR then detect the catch statements and obtains types of expected exception. It finally suggests these test cases to be modified according to this patterns.

It is difficult to determine whether test cases can be timeouted. We implemented a strategy for this pattern based on our strong heuristics. If VTR finds test cases reading static "*TIMEOUT*" variables, it deals with them as the unexpected timeout test cases.

VTR parses the source code of test cases (methods). If it found any annotations in the method bodies, it deals with them as test cases to be modified according to this pattern.

A strategy for this pattern is similar as that of the pattern #2. From the compilation results of test cases, VTR finds test cases that causing warnings. If the locations indicate JUit assertions, VTR categorizes them into test cases to be modified according to this patterns.