Empty Test
Definition:
Occurs when a test method has no executable statements. Such methods are possibly created for debugging purposes without being deleted or contain commented-out test statements. An empty test method can be considered problematic and more dangerous than not having a test case at all since JUnit will indicate that the test passes even if there are no executable statements present in the method body. As such, developers introducing behavior-breaking changes into production class, will not be notified of the alternated outcomes as JUnit will report the test as passing.
Code Example:
public void testCredGetFullSampleV1() throws Throwable{
// ScrapedCredentials credentials = innerCredTest(FULL_SAMPLE_v1);
// assertEquals("p4ssw0rd", credentials.pass);
// assertEquals("user@example.com",credentials.user);
}
References:
Quality attributes
- Code Example
- Cause and Effect
- Frequency
- Refactoring
An Exploratory Study on the Refactoring of Unit Test Files in Android Applications
Automatic Identification of High-Impact Bug Report by Product and Test Code Quality
Developers perception on the severity of test smells: an empirical study
Handling Test Smells in Python: Results from a Mixed-Method Study
How are test smells treated in the wild? A tale of two empirical studies
On the Distribution of “Simple Stupid Bugs” in Unit Test Files: An Exploratory Study
On the diffusion of test smells and their relationship with test code quality of Java projects
On the distribution of test smells in open source Android applications: an exploratory study
On the test smells detection: an empirical study on the jnose test accuracy
TestQ: Exploring Structural and Maintenance Characteristics of Unit Test Suites
The secret life of test smells-an empirical study on test smell evolution and maintenance