As and when a software changes, corresponding automation test asset needs to be maintained. Maintenance is considered as the biggest challenge in test automation project. Sometimes it is easy to do things manually than putting effort in keeping automation asset up to date. This is one of the key reason for discontinuation of many test automation projects. With new releases of software, either we need to add new tests  or often change the existing tests.  Removal of existing features also makes some tests redundant. All of this contributes to the maintenance costs.

I would like to share few of the practical issues related to test automation maintenance with probable solutions below:

Number of test cases - We do keep on adding new test cases to automated test suite as needed. There is no way of limiting this number at the beginning of project and during the project lifetime. When this number is small it may not create any issue. But if out test assets grows heavily with time, we need to find a alternative way to reduce the maintenance cost.  Solutions could be,
  • Before adding any new test script, do consider the benefit of adding this test script in terms defect finding ability and cost of maintenance.  
  • Do schedule periodic cleanup of automation asset. This will help in removing duplicate, redundant scripts.
Debug ability - Test scripts should be designed in such a way that if failure happens, it should be able to report all the relevant information for debugging the root cause. When we manually execute a test case, we have the flexibility to try different combinations, paths etc. But a automated script does not have any intelligence of its own. It will provide the information as programmed by the designer. The test result "failed" will not add any value unless it is backed by useful evident or logs. So do get all the relevant information needed on debugging a particular test case before automating the same.

Interdependence -  Keep your test scripts independent of each other until and unless necessary. Independent test scripts are easy to execute and debug if failure occurs. Maintaining interdependent test scripts is very difficult if not supported with adequate documentation.
  
Naming conventions - As the number of automation test designer increases, there will be no consistency across test scripts designed. This may lead to less reuse and more duplication.Solutions could be adopting some naming conventions right at the start. This will help in finding existing scripts and files.

Test complexity - Same as complex code, complex test scripts are also hard to maintain in long run. Test cases should be written such a way that if tomorrow changes needs to be done, any new person can update it with minimum effort. If any test script is very complex to understand everyone will prefer to write a new script instead of updating the existing one.

Documentation - Each and every test script should be provided with supported documentation like purpose, how to use, setup details, dependencies etc. Good documentation helps significantly in automation maintenance in long run.