This repository is a modification of the FAST Approaches to Scalable Similarity-based Test Case Prioritization project, it is based on the following publication:
Breno Miranda, Emilio Cruciani, Roberto Verdecchia, and Antonia Bertolino. 2018. FAST Approaches to Scalable Similarity-based Test Case Prioritization. In Proceedings of ICSE’18: 40th International Conference on Software Engineering, Gothenburg, Sweden, May 27-June 3, 2018 (ICSE’18), 11 pages. DOI: 10.1145/3180155.3180210
It contains materials needed to perform FAST project prioritization for projects developed using Java in conjunction with Maven
In order to replicate the project follow these steps:
-
Have Git installed - Download
-
Have Python version 3 installed - Download
-
Have the PIP installed - How to install pip
-
Clone the repository
git clone https://github.com/DinoSaulo/FAST-parameterized
-
Install the additional python packages required:
pip3 install -r requirements.txt
-
Execute the
prioritize.pyscript-
python3 py/prioritize.py <subject> <algorithm>Example:
python3 py/prioritize.py /home/user/projects/truth FAST-pwThe
<subject>is the path to the project, some examples are: '/home/user/projects/truth' or '../my-projects/calculator'The possible values for
<algorithm>are: FAST-pw, FAST-one, FAST-log, FAST-sqrt and FAST-all. -
To view output results access the folder
<subject>/.fast/output/ -
To see the generated Java prioritization file (FASTPrioritizedSuite.java) access the folder
<subject>/src/test/java/fast
-
-
Add the following snippets to the Maven project
pon.xmlfile<build> ... <plugins> ... <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <includes> <include>**/FASTPrioritizedSuite.java</include> </includes> </configuration> </plugin> ... </plugins> ... </build>
</dependencies> ... <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter --> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform-runner --> <dependency> <groupId>org.junit.platform</groupId> <artifactId>junit-platform-runner</artifactId> <version>1.5.2</version> <scope>test</scope> </dependency> ... </dependencies>
-
Access the project repository
Example:
cd /home/user/projects/truth -
Run the project tests
mvn test
When running the tests prioritized by the FASTPrioritizedSuite.java file, the report generated at runtime of the tests displayed by Maven is no longer displayed due to tool settings.
To make a workarround it is necessary to instrument the project by adding the file FASTTestWatcher.java to the project and adding the following lines to the project's test classes:
import org.junit.jupiter.api.extension.ExtendWith;
import fast.FASTTestWatcher;
...
@ExtendWith(FASTTestWatcher.class)To automatically add instrumentation to the project, just run the command
- python3 tools/project-instrumentation.py <subject> add_instrumentation_to_the_project
Example: python3 tools/project-instrumentation.py /home/user/projects/truth add_instrumentation_to_the_project
To automatically remove instrumentation from the project, just run the command
- python3 tools/project-instrumentation.py <subject> remove_instrumentation_from_the_project
Example: python3 tools/project-instrumentation.py /home/user/projects/truth remove_instrumentation_from_the_project
-
Run the script clean-project.py to clean the environment.
python3 tools/clean-project.py <subject>
Example: python3 tools/clean-project.py /home/user/projects/truth
This is the root directory of the repository. The directory is structured as follows:
FAST
.
|
|--- py/ Implementation of the algorithms and scripts to execute the project.
|
|--- tools/ Util scripts, e.g. clean environment, project instrumentation.