
The Process of building automated test script is similar to the process of software development. Thus, Software Engineering best practices should be implemented to ensure that the code is readable and comprehensive, maintainable and reusable whenever possible. This document provides details of these Automaton Test Scripting Best Practices.
The standards and best practices outlined in this document should be adhered to for any test automation project.
What is Test Automation?
Software test automation is automating the steps of manual test cases using an automation tool, to shorten the testing life cycle. As part of manual testing same test cases have to be executed several times.
This might be true when application undergoes regression. Due to human error some of the steps might be missed out or skipped. Automation helps to avoid such human errors and also expedite the process. Implementing successful Test Automation in an SDLC requires a detailed planning and effort. It is required to think “Past the Project” prior to initiating the task of automation and have a clear picture of final goal that has to be achieved. The below sections describe in detail the approach and process to be followed to achieve an effective and optimized solution for successful Test Automation.
Why…..
Automation saves time and effort which results in reduction of the Test life cycle. Various test cases (including the data driven tests) can be executed using the automation tool with minimal human intervention and effort thus resulting in reduction of cycle time in test execution. Automation techniques can be made to reduce / eliminate human intervention
Benefits of test automation are given below
Consistency of test execution and eliminating human error
Reducing cycle time of regression test cycles
Data driven testing
Earlier defect detection.
Faster Regression
Repeatability
Coverage
Reliability
Reusability
The graph below depicts the relationship between effort consumed in automation vs. the time elapsed. A higher initial effort in building a test automation effort results in a long-term benefit.
Complex functionality wherever possible should be automated. This leaves enough time for testers to focus on the other granular tasks related to testing. On other hand these scripts can be used to test the application more rigorously thereby reducing the chances of any defects getting deployed into production.
When …..
Before initiating test automation one needs to evaluate whether it is a viable/profitable solution. Automation life cycle is a subset of the entire test life cycle and the same can be started during the initial phases of the Software development life cycle. Automation planning can be initiated in parallel to the test planning phase. To know more about activities performed in each phase here Factors to be considered while deciding for automation
q Application is stable
It is essential that the Application under test (AUT) is stable enough to develop an automated suite, else the effort that goes in for updating and maintenance of the scripts goes very high.
q Number of regression cycles to be performed
In case testing is in its final phases of development or the number of regression cycles to be performed is relatively low, then it is not advisable to go in for test automation.
q Compatibility of Application Platform with Testing tools
Depending upon the Application platform and technology, there are various testing tools available in the market. Rational, Mercury Interactive, Segue and Compuware provide most of the popular testing tools. There are some applications, which cannot be recognized using the available testing tools. Thus the automation of such applications is not possible.
q Cost Benefit Analysis.
Good testing tools that can be used for developing an effective test suite are expensive. The decision of initiating test automation also depends on the factor if the organization is willing to make the necessary investments. In certain cases it might be a viable solution however due to limitation on time or cost it might not be an acceptable solution
q Availability of Skill team
Success of a Test automation project is a result of effective partnership between the test automation team, manual testing team and the development team. It has been observed during the past experience that the manual testers have a fear of losing there jobs in case the test automation is used for testing. Thus the goal of automation should be very clear with in the team as support of the manual testing team would be inevitable make “Test Automation” a success.
How…..
To ensure the success of test automation success one needs to “Think Past the Project and should execute the project similar to the software development projects.
To achieve this one needs to have
Ø Clarity of what one wants to achieve thru automation.
Ø Executing the project similar to a software development project
Ø Take up test automation as a fulltime effort and not as sideline
Ø Plan the entire test automation effort
Ø Develop an automation approach, based on the project requirement and CTQ’s of the customer
Ø Create test framework, which are application-independent
Ø Create test design & treat it as a separate entity from test framework
Ø Ensure the source code / scripts are properly managed & tracked
Ø Track defects in the automated scripts and test them before handing it over to the testing team for execution.
Ø Develop help files/ support document for the test suite user.