What are the best practices for Automated Regression Testing?

How it all Began ?

Period since the industrial revolution (1820) is referred by scientists as Anthropocene, also referred as Human Age. Significance of this period is automation of manual tasks using machines. Automation has helped mankind become more productive, self-sufficient and innovative.

The onset of Anthropocene era saw machines being used for manufacturing of textiles, paper, cement, chemicals, glass, stream engines, and automobiles and also used for agriculture. Today, you hardly find a household which doesn’t use technology/machines.

Since the invention of computers in the late 20th century, software has empowered humans to eliminate manual processes, introducing automation tools, where ever applicable. And till date, it’s ongoing.

Software development and testing:

Software development lifecycle involves four important phases, namely requirement gathering, architecture and design, core development and testing. Software testing validates the functional and non-functional capability of the software. Today, software testing is mostly done manually by one or more person based on the size and complexity of the software.

Automation of software testing:

During the initial stages of a software’s life cycle, it is valuable to have humans manually validate software’s capability and usability. However, as a software becomes mature it becomes a challenge in terms of time / cost to validate all aspects of the software manually. For a tester it becomes monotonous and is error prone when executing hundreds of test cases for every major software enhancements. So, it is essential to automate the tasks done by the tester to improve quality and thereby save time / cost. This process is referred as automated regression testing.

During the software development, it is essential that the test team build a regression suite from the very initial stage. This effort will pay high dividend during the later stage of the development and during software maintenance.

For an automated regression test suite there are four essential ingredients

  1. Test database/environment on which the test scripts have to be executed
  2. Test scripts that translates the regression test case and has an expected result
  3. Test report that compares expected and actual result and
  4. Report that highlights the code covered by the regression suite

Test database has predefined data that are required for the software to run in a stable manner and for the test scripts to be executed successfully. Test team has to continuously update the test database as per the changes to the software.

Test scripts translate the hand written test cases to a re-executable script. There are multiple tools that helps in writing test script, the popular one’s are QTP, Winrunner, Selenium, Watir, SOA test, Testing Anywhere, etc. Selenium, Watir are open source and helps in building your own framework.

Every test script should have an assert statement to validate the expected result and the actual result match. In case they match it is a success else a failure. End of the regression test suite execution the test or project manager should review the report, ascertain the quality of the software and take appropriate action.

Validate test sufficiency:

Regression test suite should be constantly enhanced to reflect the changes to the software. Before enhancing one needs to know if the test scripts or test plans are sufficiently covering all the modules of the software. Code coverage tools helps in assessing the sufficiency of the test scripts. Some of the popular code coverage tools are,

For Java:

a)   EMMA (http://emma.sourceforge.net)

b)   Hansel (http://hansel.sourceforge.net)

c)   jCoverage (http://www.jcoverage.com)

d)   Cobertura (http://cobertura.sourceforge.net)

For .NET:

a)   OpenCover (https://github.com/sawilde/opencover)

b)   Clover.NET (http://www.cenqua.com/clover.net)

c)   NCover (http://ncover.sourceforge.net)

For PHP:

a)   PHP Test Coverage Tool

Our Software testing consulting and software testing services takes into account all of the above factors. We are amongst a few software testing companies who provide detailed reporting to validate Testing Sufficiency. Here's a sample report.

Regression report, sample regression reports.