May 25, 2020

Design patterns in Automation Testing


Design Patterns in Test Automation World


Automation testing is a process of developing software to test software. Hence, the test patterns are loosely similar to design patterns that are used in software development.
Design patterns show how to design the test automation test ware so that it will be efficient and easy to maintain. A design pattern provides a general pattern provides a general reusable solution for the common problems occur in software designs.
The basic idea is to speed up the development process by providing well tested, proven development and design paradigm.


What are the advantages of using Design Patterns?


· Low maintenance effort and time
· Low maintenance cost
· Enhanced code re-usability
· Enhanced reliability
· Structured code base which is easy to fix and extend
· Improved communication





Different Design Patterns -


1. Record and play
2. Classical Design
3. Facade Design
4. Singleton Design
5. Page Object Design
6. Modular Design


1.Record and play


Record and playback tools are used in training. Tools let the tester hit record and manually go through the real user actions of pre scripted test case. For example- learning and training, simple play your video, extremely simple web based application functionality, where the code base never changes.


2.Classical Design


It requires the creation of small, independent scripts that represents features, functionality or module of system based on its own managed data source. The process is complex and requires an extra effort to come up with the test data sources. For example- Small application of not more than 100 TC’s, application like data entry/from filling regularly.


3.Facade Pattern


The Facade pattern provides a simple interface to deal with complex code. In the facade pattern, as applied to test automation, we design the facade class which has methods that combine actions executed on different pages. For example- Customer service application, departmental store application


4.Singleton Pattern


A Singleton class means only one instance of it can exist at any time. But why would you need this?
Well it is very useful in a case when you need to use the same object across the whole framework. A Singleton class returns the same instance every time you try to instantiate an instance of the class. Think of it providing global access to a single object, for example, the log file object ,most of the desktop application, test automation, hardware devices automation.




5.Page Object Model


The Page Object Model is a widely used object design pattern for structuring automation test code. Here, pages in the applications are represented as Classes, and various UI elements of that pages are defined as variables. For example- Any enterprise application, retail software, banking application, e-commerce application.


6.Modular Design Pattern


In the current era of digital transformation where Mobile, Cloud, Big data concepts are playing a significant role, Complex design help to design end to end test automation solutions efficiently by integrating. Methodologies, frameworks, accelerators, latest technologies, virtualisation tools and lab management solutions. For example- Mobile application, Enterprise application, Cloud application.

No comments:

Post a Comment

Please let me know if you have any doubts.

Key concepts in Pipeline

 1. Agent- To build your code or deploy your software using azure pipelines, you need at least one agent. Two types of agent- Microsoft host...