What to study for each PCAT-31-01 domain
Software Testing Essentials
Covers core testing concepts and terminology, test levels, the principles of testing, where the testing process starts and ends, and the test pyramid. It also addresses code coverage and how testing fits into the software development life cycle, including risk focus and shift-left ideas.
Key skills
Explaining errors, defects and failures, the test levels and test pyramid, testing principles, coverage, and functional versus non-functional testing.
Test Automation and Code Refactoring
Covers the purpose and benefits of test automation, choosing which tests to automate, and the refactoring loop performed while tests stay green. It also covers structuring tests with the Arrange-Act-Assert pattern and applying the DRY and KISS principles to test code.
Key skills
Selecting automation candidates, structuring tests with AAA, removing duplication with DRY, keeping tests simple with KISS, and refactoring in small verified steps.
Assertions, Context Managers, Decorators, and Python Methods
Covers Python assertions and specialised unittest assertions, context managers and the with statement for reliable resource handling, and decorators used in and around tests. It also covers common Python methods, such as string methods, applied when preparing and checking test data and results.
Key skills
Writing assert statements with messages, using assertRaises as a context manager, implementing __enter__ and __exit__, applying decorators such as skip, and using contextlib and string methods in tests.
Foundations of Unit Testing
Covers the foundations of unit testing, including the F.I.R.S.T. principles (Fast, Independent, Repeatable, Self-validating, Timely) and the xUnit architecture of test cases, suites, fixtures, and runners. It also covers the unittest module, test file structure and naming, test discovery, and specialised assertions for equality, membership, None, and floating-point values.
Key skills
Writing unittest TestCase classes with correctly named test methods, running and discovering tests, using specialised assertions, and applying the F.I.R.S.T. principles to keep tests reliable.
Advanced Unit Testing Techniques
Covers advanced unit testing techniques including fixtures with setUp, tearDown, setUpClass, and tearDownClass, parameterised tests with subTest, and test marking and selection. It also covers test doubles (dummy, stub, fake, mock, and spy), unittest.mock and patch, configuring return values and side effects, verifying interactions, and testing code that raises exceptions.
Key skills
Managing per-test and per-class fixtures, parameterising tests with subTest, selecting individual tests, and using Mock, MagicMock, and patch to isolate units and verify interactions.
Test-Driven and Behavior-Driven Development
Covers Test-Driven Development and its Red-Green-Refactor cycle, in which a failing test is written first, the simplest passing code follows, and the design is then cleaned up under green tests. It also covers Behaviour-Driven Development, expressing behaviour as Given-When-Then scenarios in shared, plain language.
Key skills
Applying the Red, Green, and Refactor phases in order, writing the failing test first, and writing Given-When-Then scenarios that describe expected behaviour.