SoCRATES is an IntelliJ IDEA plugin to detect test smells in Scala/SBT projects.
It automatically detects and reports on 6 test smells including 4 variants of General Fixture.
| Test class smells | Test case smells |
|---|---|
| Global Fixture (General Fixture) | Assertion Roulette |
| Lazy Test | Sensitive Equality |
| Eager Test | |
| Loan Fixture (General Fixture) | |
| With Fixture (General Fixture) | |
| Fixture Context (General Fixture) | |
| Mystery Guest |
- Clone the project to
~/socrates. - Open the project in IntelliJ IDEA.
- Execute the Gradle task
assembly. - A succesful compilation results in a .zip file located at
~/socrates/build/distributions/socrates-1.0-SNAPSHOT.zip.
- Go to
IntelliJ IDEA->Preferences->Plugins->Install Plugin from Disk... - Navigate to
~/socrates/build/distributions/socrates-1.0-SNAPSHOT.zip. - Restart
IntelliJ IDEAto complete the installation.
- Open any project in
IntelliJ IDEA. - Go to
Analyze->Detect Test Smells. - A dialog with the following options appears
Java Runtimeshould point to thert.jarfile;Ivy2should point to theivy2 cache(multiple directories should be seperated by:);SBT Homeshould point to theSBT binary;- any additional
SBToption can be define inSBT Options. For example, we recommend to increase the available memory for large projects.
- Press the
Analyzebutton to scan the project. - After the analysis, the plugin shows a table with the detected smells for each test class and test case. The table can be sorted and filtered to easily spot test smells.
Assessing Diffusion and Perception of Test Smells in Scala Projects
Jonas De Bleser, Dario Di Nucci, Coen De Roover
Mining Software Repositories 2019 (MSR 2019), Montreal, Canada
Pre-print: http://soft.vub.ac.be/Publications/2019/vub-soft-tr-19-06.pdf