Cohesion

Cohesion image
Cohesion is about how closely related the responsibilities of a module, class, or function are. A cohesive unit does one job and does it well. High cohesion means that everything inside that unit contributes directly to a single, well-defined purpose. Low cohesion means the unit is doing too many unrelated things, which often makes it harder to understand, test, and maintain.

For example, a class that only handles user authentication is cohesive, whereas a class that mixes authentication, report generation, and email notifications is not. High cohesion helps improve clarity, reduces duplication, and ensures that changes are easier to manage.

When systems have high cohesion and low coupling together, they become much easier to test because each part has a clear focus and fewer dependencies on other parts.
Explore MoT
AI-driven testing in practice: from requirements to reliable automation image
See where AI genuinely helps, where it doesn’t, and how testers can stay firmly in control
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
Into The Motaverse image
Into the MoTaverse is a podcast by Ministry of Testing, hosted by Rosie Sherry, exploring the people, insights, and systems shaping quality in modern software teams.
Subscribe to our newsletter