arieslab / jnose

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

Fix test smell detection: PrintStatement #7

Closed luana-martins closed 4 years ago

luana-martins commented 4 years ago

Definition: Print statements in unit tests are redundant as unit tests are executed as part of an automated process with little to no human intervention. Print statements are possibly used by developers for traceability and debugging purposes and then forgotten.

Detection: A test method that invokes either the print or println or printf or write method of the System class.

Problem: Only one PrintStatement is detected in the test method, even if the test method has multiple print statements. Fix the test smell detection to count each of its instances and to point the line where it is located.

danielevalverde commented 4 years ago

Hey, @luana-martins :) Reopening this issue because the result of the detection to this test smell is wrong:

The colum: "testSmellMethod" is returning the type of print like "printf" instead of the name of the method.