Approach To Test Automation
Test automation – frequent topic in testing community, but for businesses and developers it is still something new and unknown. This blog post is very simple, high level my lessons learned in the field.
Start by choosing your test automation strategy. Business sees Test Automation as way to save money. The problem is, if you don’t have strategy and simply write 1000 automated tests, then sooner or later your team will become slower and slower. To pick up speed and save money, test automation has to be flexible and lean. Forget about testing-all-the-things, it is not possible and is wasteful. If your system has 1000 automated tests, your team has to maintain 1000 automated tests. Depending how you created your tests and how oft you will change your software – it can be a LOT.
Martin Fowler created great thinking tool: Test Automation Pyramid
Focus on unit tests, because this is the fastest way how developer can find out that her/his new code broke already existing code.
Testing in Agile world
If you are living in agile world, I would suggest you to read “Agile testing” by Janet Gregory & Lisa Crispin. They have great chapter on test automation with thought provoking mind map. I learned from Janet, test automation approach to write e2e tests for epics, integration tests for stories and unit tests for tasks.
Remember: in agile we believe in zero-bug policy. That means as well that all automated test need to be active and results has to be green. all the time.
e2e test Criteria
Test Automation criteria is part of your strategy because it answers the question: What to automate? Typical approach for e2e is to automate:
- only standard features
- only features with high risk
- only most used configurations
Many teams use that criteria to reduce test automation which has grown too big. My suggestion in trainings is – from very beginning automate only really necessary test cases. If you doubt, then don’t automate on e2e level, talk with your team how you could catch it on integration or unit level.
The biggest challenge in Test Automation is not to write a script, but to decide what to automate and what not to automate. You will easily find people who can automate 1000 tests, but not so easy to find people who can create test automation strategy and efficient test automation design. Just like there are many software developers, but not so many software architects.
If you have strategy in place then you will understand how wrong are statements similar to this: “I often write e2e automated tests for bugs raised by customer because if we made that mistake once, we will likely make it again”. We have to learn from bugs raised by customers, we need to understand what went wrong, but we cannot test everything and it is very unprofessional to automate everything. Testers and developers should learn to think profitably.
Few days after I published this post, Lisa, in cooperation with Joe, published amazing collection of Test Automation Models. My suggestion: explore Rob Meaney’s Risk Mapping and Katrina Clokie’s DevOps Bug Filter. Maybe it is something for your team.