Test Smell Detector

Fork me on GitHub

Tool Usage

Download

Download the latest release from here.

Input

Prior to executing the tool, an CSV file needs to be created. The CSV file specifies the list of test files (and their associated production file). This file will be used as input to the tool. The format of the file should be:

                    appName,pathToTestFile,pathToProductionFile
                

Example:

                    myCoolApp,F:\Apps\myCoolApp\code\test\GraphTest.java,F:\Apps\myCoolApp\code\src\Graph.java
                    myCoolApp,F:\Apps\myCoolApp\code\test\EmployeeTest.java,F:\Apps\myCoolApp\code\src\Employee.java
                    myCoolApp,F:\Apps\myCoolApp\code\test\EmployeeRelationship.java
                
Note: In the event a production file is not associated with a test file, then detection for test smells that require production files are not run.

Execution

Once the CSV file has been created, the path to the CSV file need to be passed as an argument when executing the jar.

                    java -jar .\TestSmellDetector.jar pathToInputFile.csv
                

Example:

                    java -jar .\TestSmellDetector.jar "F:\Projects\TestSmellDetector\inputFile.csv"
                

Output

The tool outputs a CSV file containing the results of the execution. The output CSV file will be created in the same location as the jar. The CSV file contains the path of the test files (and their associated production file) along with the detection status for each smell. A detection of status of 'true' indicates that the associated smell exists in the test file.

Tool Correctness

tsDetect is able to correctly detect test smells with a precision score ranging from 85% to 100% and a recall score from 90% to 100% with an average F-score of 96.5%. Click to read more

Architecture & Design

Details about the architecture of tsDetect along with information about test file and production file identification are available here.

UML class diagrams of the tool are available here, here and here

Demo

Supplementary Tools

Detect unit test files in the project structure
Detect production files associated with a unit test file