When to automate?
We’ve previously looked at what is automation testing and why we do it, so now the next question is, when to automate? The obvious answer, when talking about front end testing, is ‘as soon as the GUI (the Graphical User Interface, aka the webpage) is ready’, but this isn’t necessarily true. The GUI being ready is the end of the process, when all the pieces are pulled together into a whole. We can, and should, begin automation testing (AT) earlier than this. The test planning phase should start at the beginning of the project; testers should have access to those user stories early to determine which tests are going to be advantageous, which would be merely useful, and which can be ignored – for now. As the app or website is developed, the test writers should be informed of changes and additions that will affect the way the tests are run.
But the GUI isn’t the only thing that can be automated, calls to the database can be automated in order to test various functions and views, as well as database integrity. These tests can be implemented as soon as the database is up and running. Having a test, or set of tests, running against the database (or a copy of the database) 24/7 can quickly show any issues that traditional testing may not find very quickly.
Obviously, the time to start automated testing is ‘as soon as you can’. But this will vary between projects and even teams. The key things to consider when thinking of automation testing are:
- Will this test be repeated regularly?
- Will this test case benefit from being run 24/7?
- Will the cost of writing and maintaining an automated script be outweighed by the early warnings that an automated test can deliver?
If the answer to even one of those questions is yes, then automating the test scripts should be included in the early stages of the project.
We use automated tests to perform those tests which would traditionally take a lot of man hours to complete, and which by using automation can be more reliable – removing those human errors that creep in when performing the same task over and over from the equation. A great example of this is being used on one of our biggest clients to verify that particular pages (of which there are many) are all available. There are hundreds of pages, each produced dynamically, each with their own contact page. Manually testing that these pages are available and working would take an enormous effort and a lot of time but automating this task will mean that each page is tested, errors are reported, and no page is missed. The added benefit is that once the test is written it can be run at any time, for instance when a change is made to the site, or it can be run every day. The cost benefit of this in time, efficiency and actual money is substantial.