arieslab / jnose

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

Fix test smell detection: Exception Catching Throwing #8

Closed luana-martins closed 4 years ago

luana-martins commented 4 years ago

Description: Exception Catching Throwing (ECT) occurs when a test method explicitly a passing or failing of a test method is dependent on the production method throwing an exception. Developers should utilize JUnit's exception handling to automatically pass/fail the test instead of writing custom exception handling code or throwing an exception.

Detection: A test method that contains either a throw statement or a catch clause.

Problem: Only one ECT is detected in the test method, even if the test method has multiple try-catch blocks. Fix the test smell detection to count each of its instances and to point the location of the try-catch block.