Generating RESTful API Test Scripts with Database Constraints using OpenAPI Specification
Nuntipat Yuncharoen, Taratip Suwannasart · 2024
Nowadays, software systems are interconnected to enhance the user experience and attract new users. As such, software developers require a standard for exchanging information to streamline their work, leading to the creation of APIs. In the software development life cycle, it is essential to have documentation that outlines the software's requirements and functionality, known as a software specification. Similarly, APIs should have standardized documentation to help software developers understand their components, such as parameters, request bodies, responses, and endpoints. This is why the OpenAPI Initiative developed the OpenAPI specification. Moreover, APIs often connect with databases that store information. Relational databases have rules known as database constraints, which ensure the accuracy of stored data. When developing APIs, software testers play a crucial role, especially considering the widespread use of APIs. Software testers may have a different approach to generating test cases, potentially leading to gaps in coverage, particularly regarding database constraints. This paper proposes an approach for generating RESTful API test scripts that account for database constraints using the OpenAPI specification. This approach will be compatible with automated API testing tools, allowing software testers to achieve results more quickly and efficiently.