In our recent community conversation, we unpacked the benefits of API testing with Pricilla Bilavendran, Team Leader at Billenium and Nithin S.S., Engineering Manager at Fave. Read our event recap to learn about ways to prevent flaky tests, resources for starting your API testing journey, ways to measure what actually matters, and more!
Listen to the full recording here.
Uncovering the benefits of API testing for your teams
Have you been asked by your developers why you need to write API tests? This was Nithin’s experience in his early testing career and developers pushed back due to their length of writing unit tests, while also not understanding the value of API tests in the first place. Helping his devs understand that API tests can help test all the endpoints regardless of where they are hosted, ensuring that services are continuously running without compromising authorization, and providing faster feedback with quality data were just a few reasons as to why he is such an evangelist of the benefits of API testing today.
But as someone just starting their journey, API testing can feel daunting. Software testers wear many hats and while UI testing is important, API testing uncovers so many more functionalities for user flows beyond just the UI. Pricilla recalls that earlier in her career she began to understand that API testing also surfaces other issues like performance and security issues that she could bring back to her developers. Let’s start with flaky tests.
How to deal with flaky tests
The first step in dealing with flaky tests is to understand what we need to automate and the feasibility of addressing as a team with limited resources. It shouldn’t only be because of the test or code issues, shares Nithin, and sometimes can be because of established infrastructure, including whether tests were performed on an emulator or simulator, which can add to flakiness.
As software quality advocates, we need to understand the root cause and continue to revisit the current validation of the test itself. TL;DR - there is also value in deleting tests that no longer serve your teams.
We cannot escape flaky tests, but we can put measures into place to help reduce recurring issues. Are we checking for dependencies, the appropriate custom waits in our code depending on our application user flows, and are we effectively collaborating with our developers to monitor and report test fails? Flaky tests are often misunderstood, but their symptoms tell a larger story about software quality and practices if we listen, intervene, and monitor as a team.
Often testers earlier in the career can make mistakes when dealing with persistent flaky tests, notes Pricilla, and she fell into this trap when executing SQL queries without being aware of testing in different environments to avoid disrupting the software delivery teams. One must first understand the client application and not be afraid to ask questions earlier in the testing process. Other earlier stage QA professionals can fall in love with vanity metrics and blindly testing your tests with the goal of only seeing green. But having your tests pass all the time, shares Nithin, doesn’t help us question our own tests and having a deeper understanding of the application architecture. Your technical confidence can only grow when you use a shared language with your software developers.
Measuring what matters as a software quality professional
“You can’t improve what you don’t measure” — Peter Drucker
Reporting hundreds of cosmetic issues doesn't make you a good tester - you need actionable items to bring back to your team. Having thousands of automated tests doesn’t give your team proper value and can be seen as vanity metrics. But how do you gather actionable metrics to increase team output? Nithin notes that a test that takes a significant amount of time to run is a great place to start when evaluating team resources, and determining a route of execution to optimize that test.
But as a leader, how do you determine what you measure with your team? Every tester has been on a journey of seeing the number of defects raised compared with their level of performance. But when it comes to API testing, consider instead the performance of your APIs, shares Pricilla, and how many of your re-tests have failed.
This will help with your cycle planning because we know that retesting efforts must be captured in our planning. We always think about test execution, but defect retesting holds a lot of time. In addition, focus on automation stability, adds Nithin, and especially randomizing test cases when reviewing dashboards after a nightly automation run where you are seeing 100% coverage. Gather, question, and plan accordingly for maximum reiterable automation stability and team optimization.
Resources to get started with API Testing
The first step is to start understanding the shared technical terminologies used by diverse key stakeholders. “You need to know more about these API technical terms,” notes Pricilla,” and that will give you a lot more confidence to present yourself in a better way.” But do not start with API test cases until you have a strong footing and experience playing with public APIs first, which are beneficial because they do not need any prior authentication method. Start exploring with Postman public APIs to get you going. In addition, Nithin highly recommends checking out resources shared by Alan Richardson to get your fundamentals set in his Github.
Remember that API testing doesn’t require you being an expert in programming. Start by pairing with your developers, and understanding the basics while leveraging your strong analytical skills to get started on your test cases.
“API testing is for everyone and there are no prerequisites,” claims Pricilla, which is why she is excited to share concrete strategies to get you started on your API testing journey at her upcoming talk at Agile Testing Days. In addition, Nithin will be offering two talks to help you shift left before you suffer, while giving you tools to better understand the social aspects of the software development construction process.
💡If you want to join me and these incredible speakers at Agile Testing Days USA this year, make sure to use my 10% discount code Tristan_10, to be added at the last step of your registration.