In a previous article, we covered the Testing pyramid: We will base our approach on this model.
|The test pyramid|
One basic assumption: The system works
Start by introducing some E2E Tests
Turning E2E into Component Integration Tests
- Extract the relevant test (steps) from the test code of an E2E test (or start an entirely new test).
This may require you to rewrite existing test activities using a different technology.
- Create a specific integration test for the sub-scenario.
- Refactor your product source code in whatever ways necessary to make the integration test executable.
This may require major refactoring, and even the introduction of new mockable interfaces into the productive system.
Turning Integration into Component Tests
- Extract the relevant test steps from the test code of an Integration test (or start an entirely new test).
If you didn't do this already, you will now need to rewrite the test activities in the language of the source code.
- Create a specific unit test for each specific logic element you are working on.
Mind the pre- and post-conditions of your tests!
- Refactor your product source code in whatever ways necessary to make the unit test pass.
This may require major refactoring.