Friday, August 4, 2023

What should be the ideal programming language for Test Automation?

 

Introduction:

Before beginning, I would like to thank all readers of my blog, for their appreciation and recognition of the important and unique contents that I have been publishing.

The most trivial question that is often asked to a Test Manager / Test Architect / Automation Architect / Test Lead by a Project Manager and/or a Program Manager, is can we achieve test automation by leveraging open-source test automation tools? The obvious answer is yes, but before submitting a proposal, we need to select an open-source tool and need to consider which programming languages does it supports, and out of those languages which will be more suitable for the project. For example: Selenium Webdriver, it comes with multiple language bindings i.e, java, JavaScript, c#, python, php etc.





Even some low-code licensed automation tools require some knowledge in specific programming languages. For example: Test Complete and Tricentis TOSCA requires some knowledge of JavaScript programming to achieve some test objectives by writing custom code.

Technical landscape of a project / program / portfolio, and its influence:

If you have been working in Test Automation, you must have been monitoring the new job postings (in Glassdoor, indeed, linkedIn etc.) and should have developed an idea about the test automation technical stack the employers are looking for. There are increasing demand for Selenium with C# and Python (PyTest), Playwright using JavaScript (or sometimes Java), Cypress with JavaScript. There is a bit saturated demand for Selenium Java and Selenium JS.

So, how does people in an organization decides on the programming language they want to use for automation? They consider the overall technical architecture and landscape, together with the type of application the project is tasked to build / maintain, the programming language chosen by the development team, the selected unit testing tool, the existing test automation capabilities (skilled personnel across the program/portfolio, automation knowledge-base: test archives, master test strategy for the program/portfolio etc.), learning curve for new hires to the project (including freshers, interns, and experienced hires who needs cross training when there is a skill shortage), availability of reliable open-source libraries for integration (example: for Java, we can integrate a wide array of tools PDFBox, Jsch, Json Schema Validator etc).

The alignment between project, program and portfolio are required to achieve strategic business objectives, maximizing resource utilization, maintaining common framework, curating common body of knowledge, sharing business and technology insights. Ultimately, the core objective is to balance the triple constraints, time, cost and quality.


Unit test frameworks, can they influence the Test Automation tools and its associated programming language selection:

Well, some experts may disagree with me regarding how the selected unit testing tool could influence the opensource test automation tool and its programming language selection. Let me elaborate on this, a modern web application is developed in a multilayered approach by multiple teams who work in parallel in Agile, for example: UI layer, API Gateway, Backend Services (API, GraphQL, MQ/Kafka messaging), DB services, Unix batches. UI layers could be built using Adobe AEM, React, Angular, Vue, Flex UI. Both Cypress and Playwright provides faster unit testing of Web UI on modern browsers using JavaScript. Both these tools could be used for E2E automation as well, given the backend technology stack is npm-node.js. But if the ratio of UI developers is less compared to Backend developers, then to avert skill shortage risk, the project managers and test managers most likely to consider the programming languages that the backend developers use. As they could assist the test automation engineers with some coding if needed. 

So, depending on the back-end technology stack, either java, C#, python or npm-node-js with JavaScript gets selected. And now if you just put a little tap on your head, you will recall Cucumber BDD provides Junit runner which is used for unit testing of Java based codes and used by test automation engineers too. Most importantly, overcome the programming language bias, an objective and logical decision making is required, within the given business context.

Can we break the stereotype:

Until unless you have a solid business case, metrics backed poc report, an approximate roi forecast, can handle criticism, and can negotiate all the odds, my advice will be don’t try it at your workplace. It's difficult to foster organizational change, it needs support from both your team members and the leadership.

If you got confused about what is meant by “stereotype”, then you should ask these type of question to yourself:

  • Why my project does not use Robot Framework with Python for test automation, and rather they are using Selenium Java?
  • Why does my project not use WebdriverIO and using Cypress?

 

No comments:

Post a Comment

Test Automation Strategy for Oracle Forms application running in Citrix servers

  Context : There are many product based applications developed using Oracle Forms and Java thick-client architecture, and most of them are ...