Test Pyramid
What is Test Pyramid?
I have been interacting with many QA’s as part of my organizations recruitment efforts. One of the common themes I found was most of them write a lot of Automated tests its good step in right direction.
I went on to discuss about details of this automation and found that they spend lot of time in maintaining and debugging these tests.
These conversations made me think that our assumption many people know about Test Pyramid but it’s not true.
Before getting into the details of Test Pyramid lets talk about what all types of automation tests that are usually being written within a Software development team.
1. Unit tests: Tests written for each class/method that are present in the code. The aim of these tests is to ensure that developers are able test the individual method, function or a class again the requirements.
2. Integration tests: Tests written for integration between different units or modules of an application. Example like integration with database or an external application.
3. UI tests: Tests written to drive the UI for an application. These tests validate working application when the entire application is running.
4. Manual tests: Tests executed by testers manually.
The above tests are high level classification of the tests.
Mike Cohen came up with a visual metaphor of these tests based on the number of tests.
1. Test Pyramid
A test pyramid recommends that we should have lots of unit tests and the number reduces as we go higher.
Pros:
- Optimized test automation by reducing duplicates
- Faster feedback especially for developers
- Saves time for everyone by avoiding efforts to do sanity every time.
Cons:
- Works well when we have a good CI/CD set-up
2. Ice-cream cone
Here the we have more of manual tests and the number reduces as we go down.
Pros:
Cons:
- Delayed feedback making deployments slower
- Time consuming as most of the work is done manually.
- More maintenance of Test automation code
3. Cylinder
Here we roughly have similar number of tests at each layer
Pros:
- This happens to be most typical pattern as each role takes care of their tests
Cons:
- Lots of duplicate tests
- Time consuming automation execution and maintenance.
Comments
Post a Comment