We present a novel model-driven approach for testing RESTful applications. We introduce a (i) domain-specific language for OpenAPI specifications and (ii) a tool to support our methodology. Our DSL is inspired by session types and enables the modelling of communication protocols between a REST client and server. Our tool, dubbed COTS, generates (randomised) model-based test executions and reports software defects. We evaluate the effectiveness of our approach by applying it to test several open source applications. Our findings indicate that our methodology can identify nuanced defects in REST APIs and achieve comparable or superior code coverage when compared to much larger handcrafted test suites.
翻译:我们提出了一种新颖的模型驱动方法用于测试REST应用。我们引入了一种(i)面向OpenAPI规范的领域特定语言,以及(ii)支持该方法的工具。该DSL受会话类型启发,能够对REST客户端与服务器之间的通信协议进行建模。我们的工具名为COTS,可生成(随机化的)基于模型的测试执行并报告软件缺陷。我们通过将其应用于多个开源应用的测试来评估该方法的有效性。研究结果表明,该方法能够识别REST API中的细微缺陷,并在与规模更大的手工测试套件相比时,实现相当或更优的代码覆盖率。