Unknown Test
Definition:
An assertion statement is used to declare an expected boolean condition for a test method. By examining the assertion statement it is possible to understand the purpose of the test method. However, It is possible for a test method to written sans an assertion statement, in such an instance JUnit will show the test method as passing if the statements within the test method did not result in an exception, when executed. New developers to the project will find it difficult in understanding the purpose of such test methods (more so if the name of the test method is not descriptive enough).
Code Example:
@Test
public void hitGetPOICategoriesApi() throws Exception {
POICategories poiCategories = apiClient.getPOICategories(16);
for (POICategory category : poiCategories) {
System.out.println(category.name() + ": " + category);
}
}
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
Characterizing High-Quality Test Methods: A First Empirical Study
Developers perception on the severity of test smells: an empirical study
Handling Test Smells in Python: Results from a Mixed-Method Study
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
The secret life of test smells-an empirical study on test smell evolution and maintenance
Understanding practitioners’ strategies to handle test smells: a multi-method study