Python Institute PCAT sample questions with explanations for test design, fixtures, mocks, regression tests, and evidence.
These original sample questions are designed to help you check how PCAT topics appear in decision-style prompts. They are not taken from the live exam.
Use these sample questions as a guided self-assessment for PCAT-31-0x: Certified Associate Tester with Python topics such as software-testing principles, unit testing, fixtures, mocks, regression tests, TDD, BDD, refactoring, and failure evidence. The prompts focus on testing judgment, not memorized library trivia.
The sample set below is part of the Python Institute PCAT guide path:
Work through each prompt before opening the explanation. PCAT questions reward evidence, isolation, reproducibility, and choosing the right test level for the risk.
Topic: Regression testing
A production bug caused a discount function to round a boundary value incorrectly. The developer fixes the code and the manual check now passes. What should the tester add next?
Best answer: A
Explanation: A regression test preserves the specific failure so the team can detect the same bug if it returns. The strongest test uses the old failing input, verifies the corrected output, and can run repeatedly without external side effects.
Why the other choices are weaker:
What this tests: Regression testing, boundary cases, and preserving failure evidence.
Related topics: Regression test; Boundary test; Defect workflow; Test evidence
Topic: Fixtures and isolation
A test passes when the full suite runs in one order but fails when run by itself. The failure happens because another test creates a temporary record first. What is the best improvement?
Best answer: B
Explanation: A reliable test should control its own required state through setup, fixtures, or explicit test data. Hidden order dependency makes the test brittle and reduces trust in the suite.
Why the other choices are weaker:
What this tests: Fixture design, test isolation, cleanup, and order independence.
Related topics: Fixtures; Setup; Cleanup; Flaky tests; Test isolation
Topic: Mocking external dependencies
A function formats a shipping quote using data returned by an external carrier API. Unit tests are slow and sometimes fail because the carrier sandbox is unavailable. What is the strongest unit-test approach?
Best answer: A
Explanation: If the unit test is checking formatting behavior, it should control the dependency response. A separate integration test can cover the real carrier path, but the unit test should not fail because an external service is slow or unavailable.
Why the other choices are weaker:
What this tests: Mocking, fakes, unit-vs-integration boundaries, and dependency isolation.
Related topics: Mock; Fake; Unit test; Integration test; Flaky dependency
Topic: Data-driven testing
A validation function accepts ages from 18 through 65 inclusive. Which test set is the best starting point for boundary coverage?
30, because it is a typical valid age.18, 65, 17, and 66, with expected accept/reject outcomes.0 through 100, with no expected outcomes written down.Best answer: B
Explanation: Boundary coverage should test the edges and just-outside values. The expected outcome for each value matters because a test without a clear expected result cannot prove the behavior.
Why the other choices are weaker:
What this tests: Boundary testing, data-driven examples, and expected results.
Related topics: Boundary test; Equivalence class; Data-driven test; Expected result
Tech Exam Lexicon and IT Mastery are independent study tools. They are not affiliated with, endorsed by, or sponsored by Python Institute or any certification body.