Lack Of Cohesion Of Test Methods

Definition:

  • Cohesion of a class indicates how strongly related and focused the various responsibilities of a class are [4]. Classes with high cohesion facilitate code comprehension and maintenance. Low cohesive methods are smelly because they aggravate reuse, maintainability and comprehension [6], [12]. The smell Lack of Cohesion of test methods (LCOTM) occurs if test methods are grouped together in one test class, but they are not cohesive.

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring