This site contains the replication package for the paper DeltaSpec: Commit-Aware Specification Inference.
Download the artifact from this link and uncompress the downloaded file in your working directory. You will see three folders:
delta-spec: the DeltaSpec tool, for computing commit-relevant specifications.
specfuzzer: the SpecFuzzer tool, used by DeltaSpec for specification inference.
test-gen: scripts for running the Randoop tool, used by DeltaSpec for test generation.
Java 1.8
Maven
Ant
Python3
Install the requirements, and edit the file delta-spec/init_env.sh configuring the proper path for the environment variable BASEDIR (pointing to the just downloaded directory). This path will be used to define other used environment variables, e.g., DELTA_SPEC (pointing to our tool), SPECFUZZER (pointing to the specfuzzer folder), and STATES_GEN (pointing to the test-gen folder). Then, set the env vars:
$ source delta-spec/init_env.sh
Once installed, you can infer commit-relevant specifications for the commons-math commit bfe4623 (motivating example of our paper) running the following commands from within the delta-spec folder:
$ export SUBJECTS_FILE=subjects/d4j_ALL_subjects.csv
$ bash setup.sh commons-math-d4j 206
$ bash compute-delta-specs.sh commons-math-d4j 206
The first script will generate test suites for the pre/post commit versions, while the second script will run DeltaSpec to infer commit-relevant specifications, which will be preserved in the following files:
$ specs/commons-math-d4j-206/delta-added-inferred.txt (added delta specifications)
$ specs/commons-math-d4j-206/delta-removed-inferred.txt (removed delta specifications)
$ specs/commons-math-d4j-206/delta-preserved-inferred.txt (preserved specifications)
To reproduce the experiments, first you will need to download the repositories of the target projects:
$ cd delta-spec/subjects
$ ./download-subjects.sh
The script will clone the repositories of the commons-collections, commons-lang and commons-math projects.
To reproduce the experiments related to the effectiveness of DeltaSpec for inferring commit-relevant specifications (RQ1) follow the instructions on page DeltaSpec Effectiveness.
For the experiments related to a concrete use case of commit-relevant specifications (RQ2 and RQ3), follow the instructions on page Commit-Aware Mutation Testing.