In software test automation like in programming, the creation phase is always the easier. Then the application is delivered and starts his “maintenance” life, sometimes being tagged with the infamous “legacy” adjective. During this period the code evolve and so should be maintained. This is the same for the code that automate the software testing activity. In his article, Gojko Adzic proposes five ways to reduce the cost of large test suites.
The article starts by discussing the problem of maintenance and its associated costs. Gojko Adzic makes the very sensible remark that “There are plenty of good resources on writing maintainable code, but good information on organising large test sets from a documentation perspective is scarce.” Information that seems obvious when you write your tests will gradually get obscure as their authors forget about it or more simply leave the project.
The five ways to reduce the cost of large test suites proposed are:
* Organise by function, not by sequence of implementation
* Cross-link for documentation, not for execution
* Reuse automation blocks, not specification blocks
* Document ‘Why’, specify ‘What’, automate ‘How’
* Optimise titles for discovery
All these proposals are explained and motivated in details in the article. They are very similar to the advice that you will give to people that wants to write maintainable code. The part about naming test is an issue that I have often experience in software development projects and that should be tackled at the beginning of project. Gojko Adzic provides some very practical hints to name tests: “Spend five minutes thinking about a reasonable test name and you’ll save hours later. My heuristic for a good test is to imagine that I’m looking online for information about the feature under test. What would you type into Google to find it?” This article is a must read for anybody considering applying seriously test automation on a large system.
You can read the complete article on https://gojko.net/favourites/testing/agile/2016/05/24/large-test-suites.html