200-901 Software Development and Design Practice Question
A developer is refactoring a Python module that currently has a single 400-line function named process_orders(). The function mixes validation, database writes, and email notification logic. The team wants to improve testability and reuse. Which software design approach should be applied first?
⚠ Common exam trap
The trap here is assuming that adding logging or comments to a large function makes it testable, when testability actually requires separating its distinct responsibilities.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Extract the validation, persistence, and notification logic into separate functions or classes, each with a single responsibility.
The core problem is that one function owns three unrelated responsibilities. Separating validation, persistence, and notification into focused units makes each behavior individually testable and reusable by other parts of the application. The other choices either preserve the monolith, add shared mutable state, or only improve readability without changing structure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Extract the validation, persistence, and notification logic into separate functions or classes, each with a single responsibility.
Why this is correct
Splitting the monolithic function along its distinct responsibilities yields smaller units that can be unit tested in isolation and reused by other callers. This directly supports testability and reuse, which are the stated goals, without changing the external behavior of the module.
- ✗
Convert the module to use global variables so that validation, database, and email code can share state.
Why it's wrong here
Introducing global mutable state generally makes testing harder because tests must reset shared state between runs and can interfere with each other. It also increases coupling between the three concerns rather than separating them, which is the opposite of the stated goal.
- ✗
Wrap the entire function body in a try/except block and log every exception to a file.
Why it's wrong here
Adding exception handling improves observability but leaves the function as a single large unit with mixed concerns. It does not make the code easier to test in isolation or to reuse, because callers still cannot invoke validation or notification independently of the database writes.
- ✗
Increase the function's indentation and add inline comments before each block of logic.
Why it's wrong here
Comments and formatting do not change the structure of the code. The function remains a single unit with three intertwined responsibilities, so unit tests still must exercise all three behaviors together, and other code cannot reuse the validation or notification portions independently.
Go deeper
Related to this question
About these practice questions
One of 975 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.