What are test smells?
Unit Tests are essential for the quality of life of the Software. However, when these files are not built in a systematic way test code may include anti-patterns due to limiting factors, such as the high complexity of the systems and the constant need for their evolution. Anti-patterns leads to the occurrence of the so-called test smells, which can make it difficult to:
- Compression
- Maintainability
- Code reading
RAIDE Features
The RAIDE Plugin is a tool for analyzing test smells and is a pioneer in automated refactoring of test smells. The first version of the tool supports the test smells Assertion Roulette and Duplicate Assert.
Graphic interface
The RAID tool is used as a plugin in the Eclipse IDE, allowing greater usability for the test analyst during the construction of the tests.
Detailed analysis
The RAIDE plugin analyzes the project and presents each test smell in detail to inform the file path, the test class and the method that were affected by the test smell.
Test Smell Identification
The RAID in its current state identifies the Assertion Roulette and Duplicate Assert test smells. the test smells are identified separately for each type.
Test smell Preview
The RAIDE tells the line or segment where the test smells affect the test code. When clicking on each test smell, the user is redirected to the code with the affected section highlighted.
Refactoring Suggestion
When identifying test smells, RAIDE suggests the possible correction for the anti-standard found according to the literature.
Automated refactoring
The RAIDE in its current state refactor the same test smells that are identified, the Assertion Roulette and the Duplicate Assert.
Demonstration
After completing the installation of the plugin in the Eclipse IDE, follow the steps below to identify and refactor the test smells.
To identify test smells with RAIDE, the user needs to select Test Smells from the Eclipse top menu and select the test smell category she wants to identify, as Step 1 on above figure shows. Then, the user needs to select the project test package (Step 2 on above figure) and click on the symbol corresponding to run the Test Smells identification (Step 3 on above figure).
After detecting the smells, the preview tab shows all smells detected at the given test class, one per line (Step 4 on above figure). By clicking on each line, the tool shows the affected source code line or code snippet (Step 5 on above figure). Then, to apply a refactoring, it is necessary to double-click the line and select the refactor option (Step 6 on above figure).
Development
Railana Santana
Master studentContact email: railanassantana@gmail.com