The automated test suite is directly related to the application’s reliability and the team’s assertiveness and psychological safety in correcting and improving the code. We look at multiple dimensions to increase the chances of tests revealing as many problems as possible before going into production.
Is coverage important? Absolutely. However, it does not change the game on its own.
We need to combine multiple techniques and strive to keep our automated tests as close as possible to the production environment.
While doing this, people must keep time optimization in mind, ensuring that the tests are relevant to the project’s schedule and meet the organization’s expectations.
Key points about automated testing:
- The percentage of coverage is a very relevant point.
- The premise is that the more lines are covered, the greater the chances of detecting defects in advance. However, despite its relevance, this dimension alone does not guarantee the test suite’s quality.
- Systematize the application of testing techniques to make deriving basic test cases easy.
Look for a mechanism to increase the chance that the team runs all code runs in a standardized manner. For example, use standard fixture/factory libraries already accepted by the technology community you are using.
- Have a definition for a fast or slow execution test.
Understanding this difference helps to decide when using mocks, for example. It can also help define how the team handles the testing pyramid. Keep in mind the distribution of test types to ensure their optimization.
- The test suite should come as close as possible to the production environment.
Testing the code as close as possible to the production environment facilitates the identification of inconsistencies. However, getting too close can compromise the speed of the tests. Therefore, organizations need to seek balance.
- Beware of high coverage percentages that may include flaky tests.
It’s necessary to put maximum effort into analyzing the system’s state in each test. We’re talking about assertions. Avoid flaky tests.