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.
- If necessary, adapt the versions of the IntelliJ plugin/IDE. (Search for "This version can be changed" in build.gradle)
- 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 IDEA
to complete the installation.
- Open any project in
IntelliJ IDEA
. - Go to
Analyze
->Detect Test Smells
orOther
->Detect Test Smells
(depending on the IntelliJ version) - A dialog with the following options appears
Java Runtime
should point to thert.jar
file;Ivy2
should point to theivy2 cache
(multiple directories should be seperated by:
);SBT Home
should point to theSBT binary
;- any additional
SBT
option can be define inSBT Options
. For example, we recommend to increase the available memory for large projects.
- Press the
Analyze
button 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