Hello, mina-san! I'm Kim, a QA engineer from EMP Growth Team. Our team is tasked to prevent user’s churn due to incomplete functionality of freee-payroll and we generate cross-selling from freee-payroll to other products. This is the thirteenth day of the freee QA Advent Calendar 2024.
Getting Started
The IT industry is vast, offering a wide range of job opportunities. After graduation, many of us find ourselves uncertain about which path to take. I was no different. However, since development was the only field I was familiar with, I decided to pursue it. Fortunately, I landed a role as a SQL Developer.
With the foundational knowledge I gained from university, I was able to apply what I had learned to my work. Over time, those basics grew into a deeper understanding, and that's when I truly realized just how vast and expansive the IT world really is.
In this blog, I’ll share my journey of transitioning from a SQL Developer to a QA Engineer. I’ll explain how I leveraged my background in database management and connected it to QA testing, specifically through the use of APIs.
My SQL Developer Experience
I began my career as a Data Analyst at a leading telecom company in the Philippines. My role involved triaging and solving system issues, many of which required database configurations. Because of this, a solid understanding of databases and related tools was essential to effectively diagnose and resolve problems.
At the company, we primarily used Oracle SQL Developer tool as our database management system, working with SQL for various tasks. In our day-to-day operations, SQL statements typically began with keywords such as SELECT, INSERT, UPDATE, DELETE, ALTER, DROP, and CREATE. I also have experience using TOAD for Oracle.
What is SQL and What Can It Do?
What is SQL?
SQL stands for Structured Query Language. It is a programming language designed for managing and manipulating relational databases. SQL provides an efficient way to interact with a database by allowing users to perform a variety of tasks such as querying, updating, inserting, and deleting data.
What Can SQL and Its Keywords Do?
SQL allows you to perform a wide range of operations on a database. Some of the core functions include:
Querying Data: Using the SELECT statement, you can retrieve specific information from one or more tables.
Inserting Data: The INSERT INTO statement allows you to add new records to a table.
Updating Data: The UPDATE statement is used to modify existing records in a table.
Deleting Data: The DELETE statement helps remove records from a table.
Creating and Modifying Database Structures: You can create, alter, or drop tables and databases with commands like CREATE, ALTER, and DROP.
Managing Access: With GRANT and REVOKE, SQL can control user permissions and security settings for accessing data.
It was truly a rewarding experience to have the opportunity to learn and acquire this skill, all while contributing to the company’s success. After spending two years in this role, I began to feel a deep sense of fulfillment. It was as if my hard work during my university days was finally paying off, bit by bit. But, as with many of us in IT, there came a point of reflection. I found myself questioning whether this was the career path I truly wanted to follow long-term, or if I could see myself doing this forever.
Curiosity got the better of me, and I decided to explore other opportunities. I started chatting with some of my IT friends, and that’s when they introduced me to Quality Assurance (QA). They shared how much they enjoyed it and encouraged me to give it a try. Being the curious person I am, I decided to take their advice. And that’s how I ended up transitioning into a QA role.
My QA Journey
When I landed the QA position, I quickly realized that I was essentially starting over. Those two years of continuous learning in my previous role felt like they had been for nothing, as I needed to dive into a whole new set of skills and concepts. I began learning about different types of testing, such as manual testing (including sanity, regression, UAT and etc) and automation testing.
One of the most surprising discoveries in my new role was that my SQL knowledge wasn’t going to go to waste. In fact, it turned out to be incredibly valuable, especially when it came to API testing. Being able to apply my understanding of databases to test APIs and analyze their responses felt like a natural progression from the skills I had developed in my previous role. It was a reassuring reminder that even when transitioning to something new, previous experience can still play a key role.
Learning API Testing
I started doing API testing when one of my projects faced delays in the design and frontend development, but the backend was already ready. Since the backend was functional and waiting for the frontend integration, I was tasked with ensuring that everything on the backend was working as expected. This was when I had to quickly learn and start executing API tests to verify the backend functionality using Postman. My goal was to check if the API responses were correct and if the backend was performing as expected, according to the defined behavior and requirements.
What is API Testing and Its Basic Syntax?
API testing is a type of software testing that focuses on verifying the functionality, reliability, performance, and security of Application Programming Interfaces (APIs). APIs are sets of rules and protocols that allow different software applications to communicate with each other.
API testing involves sending requests to an API, checking the response, and validating that the API behaves as expected. It can be done at various levels, such as testing individual endpoints, validating data, checking error codes, and ensuring that security measures are in place.
Basic Syntax
When performing API testing, you often interact with the API using HTTP requests. These requests follow standard HTTP methods and contain parameters that define what the request is doing. Here’s a breakdown of the common methods and basic syntax:
GET – Retrieves data from a server.
- Example: GET /api/v1/users
- This retrieves a list of users from the API.
POST – Sends data to a server to create a new resource.
- Example: POST /api/v1/users
- This might send data like {"name": "Kim", "email": "kim@example.com"} to create a new user.
PUT - Used to replace or update a resource on the server.
- Example: PUT /api/v1/users/1
- This would update the information for the user with ID 1.
DELETE – Deletes a resource from the server.
- Example: DELETE /api/v1/users/1
- This would delete the user with ID 1.
PATCH – Partially updates an existing resource.
- Example: PATCH /api/v1/users/1
- This would update specific fields (e.g., name or email) of the user with ID 1.
Typical API Test Request Syntax
Here’s an example of how an API request is structured when using tools like Postman or in programming languages:
Endpoint URL: Defines the API’s address.
Method: The HTTP method defines what action you want the server to perform on the resource.
Headers: Provides additional information about the request (e.g., authentication tokens, content type).
Body (for POST, PUT, PATCH): Contains the data being sent to the server (usually in JSON or XML format).
Validating API Responses
After sending, you’ll be receiving a response, which will include:
Status Code:
A numerical code indicating the outcome of your request.
Example: 200 OK, 404 Not Found, 401 Unauthorized
Response Header & Body:
The actual data returned by the server.
Typically in the form of JSON, XML, or HTML.
Response Time:
The amount of time it took the server to process the request and return the response.
Example: Response Time: 120ms
Similarities between SQL and API
While SQL and API testing may seem like distinct areas of expertise, they share some key similarities. Both are essential tools for ensuring that software systems function correctly and efficiently. Here are some of the major similarities between SQL and API testing:
Communication with Data Sources
Both SQL and APIs act as bridges between software systems and data. SQL queries retrieve and manipulate data stored in databases, while APIs facilitate communication between different systems or services, including databases.
Request and Response Mechanism
Both SQL queries and API requests involve sending a request and receiving a response. The interaction revolves around requesting data and receiving a relevant output.
Structured Syntax
Both SQL and APIs have structured syntax that dictates how requests and responses are formatted. Understanding the correct syntax is crucial for both writing effective SQL queries and executing successful API tests.
Data Validation
Both SQL and API testing involve validating the correctness of data, whether it’s the data returned by a query or the data provided by an API response.
Error Handling
SQL: In SQL, errors are returned as specific error codes or messages, which can be used to troubleshoot issues. For example, a query might fail due to syntax errors or violations of constraints (like a foreign key constraint).
API: APIs use status codes to indicate whether a request was successful or failed. Common error status codes include 404 Not Found (resource not found) and 400 Bad Request (malformed or invalid request).
Final Thoughts
While SQL and API testing serve different purposes—the knowledge of SQL can be especially useful when working with APIs, particularly for tasks like API testing that involve database interaction. Understanding these similarities can help you leverage your skills across both areas, making you a more versatile tester or developer.
I hope this blog has helped you gain a better understanding of both SQL and APIs—or at the very least sparked your interest to learn more about them. These are two foundational concepts in modern software development, and having a solid grasp of both can really open up new opportunities for you. Thanks for taking the time to read through the post!
Tomorrow, Bader Aluzaimea, a QA engineer for Healthcare, will write an article about "Scaling Up with Zephyr Scale: Integration that actually make sense". Please look forward to it!
よい品質を〜
Let's keep good quality~