Throughout my career, I have had the opportunity to experiment, fail in the process and implement from scratch. I’ve worked on refactoring tests and frameworks, and have also been involved in consulting projects where an assessment is carried out in order to determine whether or not an app is ready to start implementing automation testing at different levels and provide recommendations based on the findings. All that ultimately led me to learn about automation testing and best practices to get successful testing processes in place.
Although every project and app is different, there are some key items to consider when you are planning on investing in automation testing, regardless of tech stacks and the level of testing you want to focus on. I’ll explain the main ones next.
The Need for Tests
Let’s start with the very first question: when is it a good idea to start creating automated tests? In my experience, everything boils down to the stability of your project, and this encompasses your team, your app and your development process.
Starting with your application, you have to ask yourself: how stable is it? It may be tempting to start your automated tests at the same time you start the development of your product. And even though you’ll get some early feedback about your app, you have to be aware that this would also imply some extra costs as your team has to work on maintaining a test suite that most likely is going to be very unstable as the app is under constant change. In the same way, the automated tests will easily become flaky as they are a reflection of your app during a very fragile phase.
Don’t get me wrong, early testing is necessary. But you can consider investing in unit, integration or component tests, and have developers in charge of this effort so you’ll have early feedback based on the latest changes and/or additions to the code base of your app.
Process and Teams
Moving onto your process, there are various areas to consider, starting from the readiness of the manual test suites. You need to have a sound test suite that covers your app at different levels and with different objectives in place. In this way, it’s going to be easier to pick up the correct tests to start your automation test suites. Along with the stability of your tests comes the maturity of your development process. It would be ideal to have a project where the release process is set up and the points where automation testing is going to happen are identified and accounted for as part of your process.
Lastly, the team. Do you have the correct people in the right seats? Setting up and maintaining an automation testing framework is not an easy task. It is not just a matter of selecting some tech stack and then coding all the tests; your team needs to have a clear understanding of your goals and business rules and be able to select the right tests. They also need to have a good idea about the tech stack behind the app itself as well as the whole development process. This is usually achieved by seasoned automation testing engineers working alongside functional manual QAs and even DevOps engineers to set up the best test architecture possible.
Now that you are sure you have the right team in place, as well as a clear comprehension of your process and a stable app, let’s dive into some best practices to start and maintain a good automation testing project.
Starting with tech stacks, the selection of the languages and tools is a very important factor to consider. When we are about to start an automation testing framework, this should go hand in hand not only with the technology stack for the app, but also with the testing levels we are going to cover and the tech stack of the CI/CD infrastructure in place so that we can eventually get everything working together.
Technically speaking, we are in a very exciting moment in software development and testing, as there are tons of options to choose from! You just need to be careful and evaluate them based on your needs. Proofs of concepts (POC) are a great way to try out different options and tune them so you can choose the one that works best for you.
Now, let’s not forget the test themselves! In this phase, you want to have some tests that provide value and are complex enough to measure how easy or difficult it is to build the automated scripts using the tech stack you are evaluating. In the long run, you also need to measure how complex it would be to include and maintain the rest of the tests.
Let’s Get Started
Once you have selected the tools, test levels, test suites and tech stacks, and you have your team assembled, you are almost ready to start. And I say almost because you need to define the strategy to tackle how to create all those tests. In this phase, your tech lead or your seasoned QA automation engineer, or both, can help out by defining the overall architecture of the automation project, considering best practices and design patterns to follow, as well as all conventions to be followed by the team. Something I find very useful in this stage is setting everything up before starting coding the actual tests, at least at a high level using diagrams of how everything would work together so everybody in the team has a clear understanding on how to proceed.
A clear ReadMe and code reviews are key factors to start and correctly set up any project so anyone who joins the team at a later stage can get up to speed easily and start contributing to the project.
Something important to remember is to add a way to somehow measure your return on investment. Metrics such as the effort to build and maintain automated tests, number of automated test cases, number of passed and failed results, execution time and bugs reported are some of the most common ones that could help guide your efforts.
Lastly, remember that automation testing is not a magic formula to release bug-free apps. Automation testing should be a part of your overall strategy that — along with teamwork, manual testing efforts, automation of processes and a quality-oriented culture — would help you have a better development experience that turns into quality products in the end.
Here I explained some basic criteria you need to consider in the decision-making process of whether or not to invest in automation testing and some best practices to implement it But there are definitely other important details to consider based on your current situation. If you are interested in continuing to learn about this, there are a lot of resources available out there, as well as people who have a meaningful experience in the field.
I recommend studying the ISTQB Automation Certification in case you want to get good foundations, but also follow people like Angie Jones, Richard Bradshaw or Nikolay Advolodkin; they are constantly participating at renown conferences and usually have really good insights about testing. Last but not least, you can learn from online platforms like Test Automation University in case you want to get more hands-on experience.