OASIS: Static and Dynamic OpenAPI Specification Inference
Hamza Bin Mazhar, Yuqing Wang, Jesse Nyyssölä, Mika V. Mäntylä
Abstract
OpenAPI specifications are crucial in black-box testing. Yet, many services have no specifications, or the specifications are incorrect. Existing tools for specification generation read the source code or the documentation, but do not utilize the dynamic view of the system. We present OASIS, an OpenAPI specification generation tool that drafts a specification from the static source code and then validates and repairs it dynamically against the running service with an LLM agent. To evaluate specifications without a ground truth, we build a Scorer. It reads a specification as a set of claims and confirms or contradicts each claim with requests to the running service. We evaluate our approach on 30 services in seven frameworks and five languages, and against five baselines from prior work. OASIS finds 99% of the routes in the 30 services, and 97% of the claims that a request can test are true. OASIS produces better quality specifications than the baselines in 52 of 54 cases. It takes about one cent of API cost per route. A human evaluation finds the Scorer correct on 94% of its outcomes. Where the Scorer and the ground truth specifications disagree, the human finds the Scorer right in 107 of the 117 cases. Overall, our work shows that a specification generated from the source code and then validated and repaired dynamically with an LLM agent is more complete and more correct than one generated from the source code alone.
Create a lesson
Related papers
Beyond Static GUI Agent: Evolving LLM-based GUI Testing via Dynamic Memory
Shared title terminologycs.SEMengzhuo Chen, Zhe Liu, Chunyang Chen et al.
Separate What from How: Repairing Static Analyzer Summaries with a Typed Repair IR
Shared title terminologycs.SEJinbao Chen, Zixiang Zhou, Yu Zhang
Managing Specification. Not code: A feasibility study of Graph -> Contract -> Code Deployment and Maintenance
Shared title terminologycs.SEHenry Yeung
SpecBridge: Learning Natural-Language Formalization Plans for the Formal Specification Synthesis Task
Shared title terminologycs.SEWenjie Zhang, Yun Lin, Zining He et al.
NavA11y: A Dynamic Analysis Approach for WCAG 2.4 Focus-Behavior Evaluation
Shared title terminologycs.SEAbu Jafar Saifullah, Tasmia Zerin, Zerina Begum et al.
From Code to Architecture: Responsibility Analysis and Dependency Graphs in the Inference of Architectural Patterns in Kotlin
Shared title terminologycs.SEJoão Pedro Moura, Breno Miranda