arieslab / jnose

JNose - Java TestSmells Detection
GNU General Public License v3.0
20 stars 8 forks source link

Fix Sleepy Test detection #27

Closed luana-martins closed 3 years ago

luana-martins commented 3 years ago

Description. Explicitly causing a thread to sleep can lead to unexpected results as the processing time for a task can differ on different devices. Developers introduce this smell when they need to pause execution of statements in a test method for a certain duration (i.e. simulate an external event) and then continuing with execution.

Detection. A test method that invokes the Thread.sleep() method.

Problem. It should detect only the line of the test method where the thread.sleep is being used, not the whole method.