In this article, we will try to understand, WHY we need a framework for any automation. It’s not a new or unknown topic! I just wanted to draft in my own style, the way I understood.
Note: We are NOT discussing about the selection of framework design pattern.
Before we automate anything, we need to answer few questions:
- What is the lifespan of the framework? – for me, if we know the system or process, we should be able to answer this question; else, get the answer from any one of the project stakeholder. is it 6 month, 1 year or 10 year?
- How many people involved? – one should understand: how many people will develop; how many people will use and how many people will maintain the framework. is it 2 engineers and 1 product owner or 10 engineers, 2 SQA (software quality assurance), 5 BA (business analyst), 1 SME (subject matter expert) and 1 product owner?
Framework help us to enhance and maintain the entire automation suite. Now, based on the above answers we can decide how much enhancement or maintenance is required. We can easily decide complexity of the framework before diving into the framework design pattern.
- Scenario #1: We need to validate a XML against the database view. The format of the XML remains same with change in data. This is part of a development project which will continue for maximum of one year. One automation engineers and one SME is involved in the project. what will be you approach?
Probably, I will not think about a framework pattern. I will write a common utility to connect to database and another for split an XML. Then the script to validate the XML in loop.
This is because, the effort of creating a robust framework (browsing XML, accepting database credential, selecting OS and environment, complex version controlling, complex reporting structure) will not pay off, as we very well know that the framework will not be in use after one year. Since the team is small there is no need to version control system required (versions can be maintained as comments).
- Scenario #2: We have 10-year contract to develop an application. The application will be developed in iteration with multiple releases. Four automation engineers, a BA, a SME and a product owner is involved. What will you do in this scenario?
As an automation framework architect, I would have selected complex design pattern and integration with GIT for version controlling, Maven for dependency management, integrated code review tool, fancy report generation tool and etc.
Before going through the complex architecture of the application, we can predict the complexity of the framework. In some cases, framework is not at all required.
Also, one more important point to make, there are millions of best practices available choose wisely and smartly. As sometime they may increase the complexity of the framework.