Test Automation Forum

Welcome to TAF - Your favourite Knowledge Base for the latest Quality Engineering updates.

Celebrating our 2nd Anniversary!

Test
Automation
Forum

(Focused on Functional, Performance, Security and AI/ML Testing)

Brought to you by MOHS10 Technologies

Test
Automation
Forum

Focused on Functional, Performance, Security and AI/ML Testing

How to reduce test script rework effort and increase test development speed noticeably

Reduce Test script-Testautomation forum

Do you feel that you are wasting so much of time in new script development and its maintenance as well?

If yes, then let’s talk about it.

Introduction

In this fast-moving world, we are always trying to save our time as much as possible because time is money, you know. We invest so much time in new script development and its maintenance and that becomes a big challenging task as our script-base expands to cover new and new features of the application under test (AUT). This influences the testing team to consider every possible option in order to save time and rework effort by adopting different models, tools and approaches.

I’m listing few common mistakes as below which I have noticed in my past experience that people do:

  • Creating so many Java Classes which is really not required, unnecessary classes will lead to increase in maintenance.
  • Writing the logic inside the test-script that increases the rework/maintenance effort.
  • Improper team coordination for developing the function that leads to code redundancy.
  • Inadequate functions for reusability.
  • No proper project architecture.
  • Absence of standard guidelines for script development and maintenance.

All above points will lead to so many issues with the project that impact the deliverable timelines and also accommodating any new changes will always going to be a big challenge.

Advantages of reusability in Test Automation

Before I explain how to design test automation framework to enable adequate reusability, I would like to outline the benefits of reusability as below:

  • Higher adaptiveness of the script to newer changes/features
  • Lower maintenance cost i.e. faster return on investment (ROI)
  • Faster go-to-market time
  • Enable test-early & test-often approach (Agile/DevOps)
  • Higher confidence with the releases (lower defects)
  • Lower QA cost
  • Higher customer experience

Given so many advantages from reusability, the obvious question now is How to enable reusability in our Framework? Let me explain it step by step.

In this article, I’m not going to talk about any specific automation tool or technology, I would like to keep it to generic approach which can be considered for almost all kinds of projects.

Important factors to keep in mind at the project kick-off

Below is a list of some important factors that you need to consider at the project kick-off period which will help in driving the maintenance/rework effort throughout the lifecycle:

  • Application functional knowledge
  • Project architecture
  • Framework approach
  • Reusable action component class (Selenium based)
  • Reusable business component class (application based)
  • Generic functions class
  • Excel integration functions class (non-Selenium based)
  • Debugging the script development
  • Maintain single object repository
  • Consider data driven approach in order to enable execution of scripts with different sets of test data
  • Team coordination and project documentation

Now let’s talk about the above points in bit more detail.

Application functional knowledge

This is a key item and should not be ignored if you really want to save your effort. Automation Engineer must go through all test scenarios as much as possible to understand the functionality. Then they can proceed and plan ~80% reusable functions that will help in saving their development effort and reducing maintenance work.

Project architecture

A good software architecture is extremely important for a software project. It creates a solid foundation for the software project and makes your platform scalable. It seamlessly increases the performance of the platform, reduces costs and avoids code duplication.

I’ve provided a sample project architecture below but you can customize it as per your business requirement.

Framework approach  

There are many types of framework available to start the automation project but it would add more value if you can go through the business requirements in the beginning and then pick up the right framework for your project which will really help you to move much faster.

Reusable action component (Selenium based)

It’s a function class, contains only individual action or functions which is not specific to any page, common actions can be added here. For example, when a single function is capable of handling multiple objects then you can keep this function here. For example, few objects on the footer of your HTML page, you can handle all of them using single function.

Reusable business component (Application based)

It’s a function class that contains small workflows or business transaction like Login into application, create order, cancel order and so on. This can be added here and these transaction or business component may have so many actions inside it. We have to call these actions in test script, definitely this will increase the script development speed and reduce the maintenance effort by increasing reusability.

Generic functions

It’s a function class, which contains the functions that can be used for other projects as well like password encryption/decryption, capturing date & time, parsing XML etc.

Excel integration functions

This class should contain the function only specific to Excel and data driven framework. This is also helpful in enabling reusability for other projects as well.

Debugging the script development

This is also a very important part; we should know how we can debug our code and it really helps in speeding up our development and quickly fixing the defects. Since it varies from IDE to IDE, you can learn debug part based on your IDE selection.

Maintain single object repository

Single repository allows to maintain only 1 file that minimizes the writing of duplicate object properties but it should have meaningful comments for all page objects.

Consider data driven approach in order to enable execution of scripts with different sets of test data

Implement data driven approach if business transaction demands the execution of the same flow with different sets of test data. Don’t forget to put more conditions to add more flows in order to have better coverage in the same test script.

Team coordination and project documentation

Team coordination is very important among the team members. Project plan and function document should be properly discussed among the team members to avoid code redundancy and to ensure the coding guidelines are followed by every test engineer in the team consistently.

The testing team should be aware of the scenarios or business requirements, prepare function document and discuss around the updates on the documents around any changes in the function list.  This will ensure that all team members are aware about all functions that have been developed/modified which in turn will help in minimizing the code redundancy.

Conclusion

Test Automation can be a significant investment for your project and should be managed carefully. Reusability plays a critical role in keeping the overall QA cost within the planned budget.

Reusability must be considered as a critical factor at the kick-off time and all the dependencies should be properly evaluated in the beginning and prioritized.

Hope you liked this article.

Let me know what you think in the comments section below and share your inputs if you are using a different approach for better reusability. Looking forward to come back with a new topic.

Total Page Visits: 1281
7+
Share

Submit your article summary today!

[wpforms id="2606"]

Thank you for your interest in authoring an article for this forum. We are very excited about it!

Please provide a high level summary of your topic as in the form below. We will review and reach out to you shortly to take it from here. Once your article is accepted for the forum, we will be glad to offer you some amazing Amazon gift coupons.

You can also reach out to us at info@testautomationforum.com