31 lines
623 B
Plaintext
31 lines
623 B
Plaintext
== Why is this an issue?
|
|
|
|
Most people will reasonably assume that a class with "Test" in the name will contain test methods. Writing "Test" classes without tests will inevitably lead to confusion, and perhaps to gaps in test coverage. Such classes should either be renamed or corrected.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
public class MathTest {
|
|
private List questions;
|
|
private int averageScore;
|
|
private int highScore;
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
public class MathExam {
|
|
private List questions;
|
|
private int averageScore;
|
|
private int highScore;
|
|
// ...
|
|
}
|
|
----
|
|
|