Smart: An Automated API Testing Platform for Generating Test Cases from Manual Testing
The article introduces Smart, a platform that records manual API testing actions and database interactions to automatically generate and execute API test cases, addressing data preparation, environment setup, and case authoring challenges while detailing its architecture, implementation, and future improvements.
1. Problem Background
QA teams using a generic automation framework faced high data preparation costs, environment provisioning overhead, and XML‑based case authoring complexity, especially for database preparation and cleanup.
2. Feature Overview
Smart provides a new way to write automation cases by recording manual testing behavior and data. The workflow includes:
Manual testing on Smart (similar to Postman).
Automatic generation of automation cases by reusing the current environment and data.
Execution of generated cases for regression testing, with export capabilities for integration with existing frameworks.
3. Feature Demonstration
Steps to use Smart:
Add the target API to Smart's interface list.
Use the "Interface Debug" feature to manually invoke the API.
After a successful manual test, click "Start Recording" with the request parameters and database info to generate an automation case.
Smart records the API calls and database interactions, then presents the generated case details.
4. Implementation Details
The core consists of an "Interface Recording Module" and a "Database Recording Module".
Interface Recording: Captures request parameters, invokes the target service, and records responses to generate input data and assertions.
Database Recording: Listens to MySQL binlog and general log to capture data changes, producing backup, cleanup, prepare_data , and assert_data for the case.
To ensure accurate database recording, Smart integrates with QTracer to obtain the full trace ID and filter out unrelated "noise" data. For extracting tables involved in complex SQL statements, Smart leverages the open‑source tool Inception to parse the SQL syntax tree and retrieve the table set.
5. Summary
Smart was officially released in September 2017, supporting HTTP, Dubbo, and MySQL interfaces, and can generate automation cases within minutes, dramatically reducing case authoring time. It is being adopted across multiple departments, with plans to enhance scenario coverage, functionality, and usability, and to strengthen case management capabilities.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.