Lessons from The Journey of a Test Engineer
Rahul Parwal, BrowserStack Champion - July 4, 2023
In software development, APIs have become the backbone of modern applications. APIs, or Application Programming Interfaces, enable communication between different software systems and services, allowing them to exchange data and perform actions seamlessly. API testing, therefore, has become a critical aspect of software testing, ensuring the quality and reliability of APIs. As a beginner, API Testing often looks like a straightforward activity to many. However, it has its share of pitfalls, traps, and nuances one needs to take care of. In this article, I will share some of my experiences as an API tester and the lessons I learned in this journey.
My Journey as a Test Engineer
I vividly recall my first day on a new assignment for a financial services company, where I discovered that I would also be testing APIs. The project involved developing a modern digital application allowing customers to manage their financial information and details. The application relied heavily on APIs to communicate with various backend systems.
Coming from a project management and operations background, testing itself was a new concept for me. The term “API testing” was like an additional twist, and I had no idea what it would entail. I realized that testing APIs would need upskilling in testing skills and techniques.
Significance of APIs
Over the last decade, APIs have entirely revolutionized software development, allowing developers to focus on creating new features rather than building everything from scratch. APIs provide a standardized interface for communication between different systems, allowing applications to be developed quickly and efficiently. By enabling integration between different services, APIs make it possible to create new applications that leverage the functionality of existing systems.
Today, APIs serve as a backbone for almost every modern app developed. Having understood the application of APIs in the software world, let’s know why API testing is equally important for building any quality product or application.
Importance of API Testing
API testing is critical for ensuring the reliability and functionality of software systems. It ensures that APIs perform as expected, handling errors gracefully and returning accurate results. API testing is also crucial for efficient and scalable software testing. Targeting your testing at the API layer can enable you to start testing early and provide rapid feedback when integrated with CI systems.
Challenges In The Testing Journey.
At the beginning of my role as an API Tester, I felt overwhelmed and intimidated by all the new API-related terminology. I spent hours scouring the internet, especially YouTube, for tutorials and courses to learn everything I could about API testing. While this gave me a quick head start for API Testing, when I look back, I realize that most of the material that I was consuming was only focused on the functionality of the APIs or how to put basic assertions for validations. I missed the bigger picture of the API Testing game. Back then, I did not realize that this small mistake would impact my testing career for years to come.
While testing APIs, one of the challenges I faced was understanding the underlying data structures and how they were being transmitted to and from the upstream and downstream systems. APIs use various data formats, such as JSON and XML; understanding how to read and interpret these formats was crucial to testing effectively.
Another challenge was dealing with the sheer volume of data being returned by the APIs. Some of the endpoints were returning large amounts of complex and nested data elements, making it difficult to analyze the JSON payloads or create JSON Paths for automation.
However, the major challenge that I was continuously facing was that despite creating a huge battery of tests in the automation suite, we were still getting frequent customer issues in production. The root causes of these issues spanned various reasons, such as bad UX, usability glitches, error handling, documentation issues, and incorrect business or domain mapping.
Overcoming Challenges
Failing to look beyond the functional aspect of APIs was my biggest trap in the initial phase of my career. I was always caught up in adding checks for APIs and overlooking the larger picture. However, my testing approach towards API changed drastically after I attended #TestFlix2020 by The Test Tribe. That was the first time I saw many atomic videos on essentials to consider testing factors such as security, performance, UX, Usability, etc. The impact of that conference on me was huge on many levels.
Post-conference, I took a proactive approach to learning new skills and techniques. I studied various testing skills and how to use them to cover various commonly sought API quality criteria. A few of the resources that helped me immensely were:
- Great Resources – Magnifiant: exploring software testing (huibschoots.nl): This is a curated collection of some of the best resources on various testing topics and concepts.
- TestFlix 2020 – YouTube: Playlist for Testflix 2020 by The Test Tribe on YouTube.
- Exploratory Testing on an API? (Part 1) – DevelopSense: Multi-part series on testing APIs by Michael Bolton.
- abhivaikar/howtheytest: (github.com): A collection of public resources about how software companies test their software.
With time, I have also learned to use tools beyond test automation execution to make my testing far more efficient, holistic, and systematic. Some of the resources that I now use are:
1. Test Data Tools:
- Pairwise Online Tool (teremokgames.com)
- Allpairs – Satisfice, Inc.
- minimaxir/big-list-of-naughty-strings
- Mockaroo – Random Data Generator and API Mocking Tool | JSON / CSV / SQL / Excel
2. Checklists:
- API Heuristic Checklist – Common Falsehoods – Testing Titbits | Rahul Parwal
- Common Software Errors – Checklist – Testing Titbits | Rahul Parwal
- Usability Heuristic Checklist – Testing Titbits | Rahul Parwal
- shieldfy/API-Security-Checklist
3. JSON Validator & Formatter Tools:
- JSON Online Validator and Formatter – JSON Lint
- JSON Diff – The semantic JSON compare tool
- Editor | JSON Crack
- JSONPath Online Evaluator
Additionally, to better understand the customer’s pain points, I took the following actions:
- Initiated conversations with the sales and marketing team.
- Requested to be included in support and production emails related to our API issues.
Overall, It was a journey of upskilling myself and expanding my horizons.
Impacts of Upskilling
By going through this journey of continuous upskilling, implementation, and improvement, I now see a significant impact on my project’s overall testing process and approach. Some of those are:
- Bug Prevention over Bug Fix: The use of various global as well as project-specific checklists helps to ensure that we are not repeating the same mistakes repeatedly. A lot of the tacit knowledge is converted to explicit knowledge with the help of checklists and cheat sheets. This helps to prevent bugs in the long run.
- Effective Testing Process: By leveraging existing knowledge about testing processes in similar contexts, we could tune and blend our testing with what was missing. This needs a lot of experimentation and review. However, the end result is an effective testing process.
- Improved Efficiency: By learning to use test tools for each and every activity associated with testing and not just restricting ourselves to automated check execution, we brought a lot of efficiency to our testing process. Sometimes, we ignore how much these small tasks take up from us. However, when you add these all, you will find a lot of time saved for you to really focus on more testing.
- Improved Customer Alignment: By connecting frequently with the sales and marketing teams, we could better align with our customers’ needs. This helped us to test for critical scenarios that mattered.
- Good Post-Delivery Feedback: At the end of the day, we all want satisfied customers and fewer complaints.
Key Takeaways
- APIs are critical in modern software development by enabling integration between different systems and services.
- Testing APIs is critical to ensuring a software system’s reliability, saleability, and functionality.
- Testing APIs requires additional skills and tools compared to testing GUIs.
- Successful API testing requires a deep understanding of the underlying systems and data structures used by the APIs.
- Leveraging custom scripts and tools beyond automating execution can transform the testing process and improve efficiency.
- Collaboration between the engineering team and stakeholders is crucial for successful API testing.
- Effective API testing can improve the customer experience, reduce development time and costs, and lead to overall project success.
Conclusion
This article is different from the usual articles that I write. It was from my own experience and growth journey. I hope that by sharing my experiences and insights, other testers can benefit and improve their API testing skills. If you are facing similar issues with your API Testing and would like to discuss them on a broader level, feel free to reach out to me on my social handles.