arieslab / jnose

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

Fix test smell detection: Conditional Test Logic #4

Closed danielevalverde closed 4 years ago

danielevalverde commented 4 years ago

Definition: conditional Test Logic (CTL): Occurs when a test method contains conditional expressions or loop structures

Detection: A test method that contains one or more control statements (i.e if, switch, conditional expression, for, foreach and while statement).

BUG: the test smell is not being identified if the conticional structure is "do while"

example:

@Test public void conditional_seven() { int i = 0; do { System.out.println(i); i++; } while (i < 2); }

To reproduce: you can Run Jnose on this project and verify the output

https://github.com/danielevalverde/jnose-tests