RESTOR: Automated Test Oracle Generation for RESTful APIs via Reinforcement Learning
Automated testing for REST APIs has witnessed rapid advancements, yet existing techniques often rely heavily on formal specifications or massive execution logs, rendering them ineffective in agile industrial environments characterized by cold-start features and isolated traffic samples. In this paper, we present RESTOR, a framework that utilizes Group Relative Policy Optimization (GRPO) to fine-tune a lightweight Large Language Model for generating executable test assertions from single request-response pairs. By employing a novel data augmentation pipeline that constructs semantic constraints and valid/invalid logic variations, RESTOR enables the model to internalize testing common sense and distinguish business logic from dynamic noise. Comprehensive evaluations on industrial datasets demonstrate that RESTOR significantly outperforms large-scale generalist models (e.g., DeepSeek-V3.1). Specifically, it achieves a superior F1-score of 85.42% in key field identification by maintaining a high Precision of 81.30%, effectively mitigating the over-generation issues observed in baselines. Moreover, expert reviews confirm its reliability, showing that RESTOR produces the highest volume of semantically Exact Match assertions while minimizing factual errors on noisy data. Finally, deployment in a production environment at a large-scale technology company validates its practical impact: the system raised the automated test case adoption rate from 74.1% to over 90% in core business lines, substantially reducing manual QA effort in high-frequency CI/CD workflows.