MetPurity: A Learning-Based Tool of Pure Method Identification for Automatic Test Generation

This page provides the prototype and evaluation data of our tool MetPurity of pure method identification via machine learning.

The paper manuscript can be found at paper link. The demo video of our tool can be found at demo video at YouTube and its local copy can be found at local demo video.

1. Prototype of MetPurity

The implementation package of MetPurity can be downloaded at tool link. After downloading the file, you can uncompress the zip file into any directory. Please note that the implementation can only be used in PC platforms with Linux. Besides this, both Oracle Java JDK 1.6 and JDK 1.8 should be installed to support the compatibility of different source code analysis. Then, please run from the directory of the zip file.

Input of MetPurity

(1) Path of JDK 1.6

(2) Path of JDK 1.8

(3) Path of source code: the directory which contains the Java source code files (.java) and dependent libraries (e.g., .jar), e.g., /home/<user>/desktop/project1.

(4) Path of bytecode: the directory of bytecode files (.class), e.g., /home/<user>/desktop/project1/bin. The project can be compiled via ANT or Maven with the configuration file in the project of source code.

(5) Strategy of enhancing test case generation in EvoSuite: 1 - only using predict.csv in test generation; 2 - using both predict.csv and pure-methods.csv in test generation. The .csv files will be explained in the output of MetPurity.

(6) Path of output: the directory of output, e.g., /home/<user>/desktop/output

Output of MetPurity

(1) Pure method collection - pure-methods.csv: a list of automatically identified pure methods via an off-the-shelf tool, ReImInfer (ReImInfer link).

(2) Impure method collection - impure-methods.csv: a list of automatically identified impure methods via MetPurity.

(3) Pure method prediction - predict.csv: a list of predicted pure methods via MetPurity.

(4) Generated test cases by EvoSuite - evosuite-tests: a dictionary which contains enhanced test case generation by EvoSuite.

2. Evaluation data of MetPurity

We conducted experiments on four open-source Java projects. The experimental data can be found at evaluation data link. There are four projects in the zip file. Each file is the result of running MetPurity. A user can run MetPurity to replicate the evaluation results.

Besides the output of MetPurity, we also provide origin data of the number of newly generated assertions and newly killed mutants. These data can be found at assertion.txt and mutant.txt.