200-901 Software Development and Design Practice Question
A developer is writing unit tests for a Python module that parses show command output from network devices. The tests must be deterministic and must not depend on real devices or the network. Which TWO practices should the developer apply? (Choose two.)
⚠ Common exam trap
The trap here is equating a reliable lab with isolation, when any real device still makes tests non-deterministic and network-dependent.
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
✓
Use unittest.mock to replace the function that opens an SSH connection to the device with a stub that returns captured output.
Deterministic, device-independent parsing tests come from replacing live I/O with controlled substitutes and asserting against known data. Mocking the SSH layer removes network dependency, while fixture files supply stable input and expected results. Together these practices make the unit tests repeatable and safe to run in CI without any real routers or switches.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use unittest.mock to replace the function that opens an SSH connection to the device with a stub that returns captured output.
Why this is correct
Mocking the SSH connection function isolates the parser from the network and returns fixed captured output, making tests deterministic and fast. This directly satisfies the requirement that tests not depend on real devices, and it lets the developer assert parsing behavior against known input without any live infrastructure.
- ✗
Run the test suite against a production router to confirm the parser handles real output.
Why it's wrong here
Testing against a production router introduces network dependency, potential configuration risk, and non-deterministic output. It violates the requirement that tests not depend on real devices, and results could change with device state or software version, so it is not an appropriate unit testing practice here.
- ✗
Run tests only in a lab environment where devices are always powered on and reachable.
Why it's wrong here
Even a stable lab is a real device dependency, so tests can fail due to outages, configuration drift, or shared use. The scenario explicitly calls for tests that do not depend on real devices or the network, so restricting execution to a lab does not meet that requirement.
- ✓
Store expected device output in fixture files and assert that the parser produces the expected structured result.
Why this is correct
Fixture files hold realistic captured output so the parser can be exercised against varied formats repeatedly. Combined with assertions on the structured result, this keeps tests deterministic and independent of live devices, which is exactly what the scenario requires for reliable unit testing.
- ✗
Add time.sleep calls between assertions to allow the device to respond before checking results.
Why it's wrong here
Sleep calls slow the suite and still leave tests dependent on real device timing and availability. They do not make tests deterministic or device-independent, and they often mask race conditions, so this practice does not satisfy the stated requirements for the parser unit tests.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.