What is automated testing and why should we bother with it? Whether a question or a statement – it seems a reasonable point to raise.
For those at the sharp-end of automated testing or engineering, the answer is simple: it is about being able to test time and time again to determine that behaviour has not been affected by change – in a very short time at reduced cost and with considerably more reliability than manual regression testing. Not checking results is a leap of faith, but once comfortable with your chosen tool any concerns should disappear quickly.
We all need to buy into automated testing!
Automated testing is an increasingly adopted process that is becoming easier to manage as the tools to do it become ever more capable to operate with reduced technical knowledge.
Essentially, automation has the very realisable potential to deliver significant benefits in the time, cost and quality triumvirate. Some of the key benefits are:
With the exception of ‘Pre-Production Assurance’ (more later), each of the different types of automation tests shown in the diagram is long accepted by the industry as key to ensuring if change has or has not impacted an application or process being modified – quickly, efficiently and cost effectively, Whilst not all are suitable for all phases of testing, each has a clear definition of what is sets out achieve and the reasons why we should consider incorporating it into our corporate and programme level automated testing strategies and plans. In all cases, automated testing and each of its types achieve most when supported by a tool that is appropriate to the task in hand.
Automated testing, its key test types and their usage
Let’s take at them look at them individually so that you might consider how to provide assurance that the four key productivity measures are fulfilled to help ensure you can meet what has been set in business case and to maximise your return
Unit Testing. This class of automated testing will only ever be employed in the development environment as it simply tests the smallest component of our systems or programmes. Unit testing is frequently conducted manually, unless, of course, you can build a succession of unit tests for automated testing, much as might be considered in an ‘Agile Sprint’. This class of automated testing will, in all likelihood, be built and managed by Agile Teams.
New Functionality Testing: This class of automated testing deals with how functions work within applications. Put more simply, how a function relates to the customer or user. The customer of user won’t care how a function works, but they do care how it is triggered and what it returns. This class of automated testing is likely to be built by a test specialist and managed in a reusable framework.
Regression Testing: This is, perhaps, the most commonly understood form of scalable automated testing. Essentially, it should be used whenever developers change or modify their software. How often, though, do we hear “it’s not worth running a set of tests because I only changed one line of code”? The simple fact is that even the smallest of changes can have unexpected consequences, so we undertake regression testing at the point of change. As we progress through the life cycle of systems, integration, etc., regression testing will seek to target different areas and functions. For example, when unit testing a specific function will be measured. But in pre-implementation automated testing we will have a regression pack that targets as many of the function points contained in an application as possible.
Essentially, regression testing tests existing software applications to make sure that a change or addition hasn’t broken any existing functionality or re-introduced previously corrected faults. Such tests can be performed manually on small projects, such as unit testing, but as we progress through the life cycle of test phases we seek to test more of the system and exercise a greater number of data triggered test conditions, which will inevitably be time consuming and would benefit from automated testing using a test tool.
Integration Testing tests the flow of data to and from both upstream and downstream systems. We care little for the functions involved in how the data travels, but that it does travel correctly between systems, across API’s and interfaces inside or outside or our organisation to trigger other functions or responses. This is often the most technical form of automated testing, as it likely to have to manage differing technologies, wait for responses and handle error conditions that would not occur in functional testing.
Pre-Production Assurance is perhaps the least well known or adopted use of automated testing. Essentially, this class of automated testing is used to assert that your current production data returns the same set of results when running a regression pack on existing software and software that is to be implemented. That’s is: A copy of production data is copied at any point time. It is then used twice: 1) against production-based software and the results saved, and 2), against the software to be implemented. The third step in the process compares the results. This method can be used at any time to help ensure that nothing unexpected has occurred. On space saving, it negates the need to store production sized data and databases long-term. Predominantly used for production data, the approach is also relevant to other automated testing types.
Automated testing Frameworks and Approaches
There are several popular approaches that can be taken for automated testing; and which you choose will depend on a number of factors and variable, not least:
Be under no illusion that if you answer:
- Reduced time to test, by as much as 95% when comparing the same test against a manual approach;
- Reduced cost of testing that often returns the cost of its development in as few as 4 automated regression tests;
- Increased coverage as new tests are added to the regression pack;
- Increased confidence in change.
- Having a framework of reusable, repeatable and predictable test assets that can be run at any time;
- Informing decision-making by determining if an application or process has been adversely affected by change – quickly;
- Only having to check test results by exception. That is, compare pre and post test runs and only review unexpected results/mis-matches;
- Increasing test coverage in a reduced time and cost.
- Your organisational strategy for automated testing
- The tool or tools you use
- Your technical skills;
- Your systems architecture
- Spend constraints or return on investment demand
- During development or modification to detect early regression failure;
- Pre-implementation to give confidence that things will be OK;
- Post implementation production assurance to look for unexpected results.
- ‘no’ to any of the above then it is you might not get the return on investment you seek;
- ‘Yes’ to at least three of the above then you should consider putting a business case together outlining why the spend on automation will result in a decent return on investment.
- Introduction to Test Automation;
- ISTQB Advanced Test Automation Engineer;
- iSQI Certified Selenium Foundation
- BDD Driven Development using Visual Studio, SpecFlow and WebDriver C#
- BDD with Cucumber and WebDriver JavScript
- Complete LoadRunner 12
- Complete Unified Functional Tester (UFT) 12
- Introduction to Appium
- Selenium WebDriver C# .NET
- Selenium WebDriver JavaScript
- Selenium WebDriver with Java
- Using ALM 12
- Using Quality Center 11