To improve the maintainability of test automation code, it is recommended to adopt design principles and design patterns that allow the code to be structured into:
TAE aligns maintainable automation with classic software design fundamentals: modules should have clear responsibilities (high cohesion) and minimal dependencies on one another (low coupling). High cohesion means each module focuses on a well-defined purpose—e.g., a page object responsible only for UI element interaction for a page, or an API client responsible only for a service boundary—making it easier to understand, test, and change. Low coupling means changes in one module are less likely to ripple across many others, which is crucial in test automation where UI locators, workflows, and environments change frequently. Patterns and principles promoted in TAE contexts (e.g., layered frameworks, encapsulation, separation of concerns, façade/page objects, adapters) are commonly used to achieve this structure. Options A and D are undesirable because low cohesion increases confusion and duplication, while high coupling increases fragility and maintenance cost. Option B (high coupling, high cohesion) still leaves the codebase vulnerable to cascading changes and tight dependencies on tools or SUT details. Therefore, the recommended structure for maintainable test automation code is loosely coupled and highly cohesive modules.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit