一句话:首个系统化测试ORM系统的方法,结合差分测试与求解器生成数据,发现28个真实缺陷。
对象关系映射(ORM)系统负责在对象程序与关系数据库之间转换,但其实现常含有特定缺陷,此前缺乏系统化测试方法。本文提出首个针对ORM的系统化测试方法,利用差分测试建立测试预言:随机生成关系数据库模式并建立数据库,再通过被测ORM的API查询这些数据库。为解决ORM缺乏统一输入语言的问题,作者生成抽象查询语言查询,再将其翻译为具体可执行的ORM查询进行差分比较。由于测试效果依赖底层数据库中的数据,作者采用基于求解器的方法,按生成查询的约束产生有针对性的数据库记录。该工作实现为工具CYNTHIA,在五个流行ORM系统中发现28个缺陷;其中25个被确认,20个已修复,3个被开发者标记为发布阻塞缺陷。
We introduce, what is to the best of our knowledge, the first approach for systematically testing Object-Relational Mapping (ORM) systems. Our approach leverages differential testing to establish a test oracle for ORM-specific bugs. Specifically, we first generate random relational database schemas, set up the respective databases, and then, we query these databases using the APIs of the ORM systems under test. To tackle the challenge that ORMs lack a common input language, we generate queries written in an abstract query language. These abstract queries are translated into concrete, executable ORM queries, which are ultimately used to differentially test the correctness of target implementations. The effectiveness of our method heavily relies on the data inserted to the underlying databases. Therefore, we employ a solver-based approach for producing targeted database records with respect to the constraints of the generated queries. We implement our approach as a tool, called CYNTHIA, which found 28 bugs in five popular ORM systems. The vast majority of these bugs are confirmed (25 / 28), more than half were fixed (20 / 28), and three were marked as release blockers by the corresponding developers.
@inproceedings{SotiropoulosCAM21,
title = {Data-Oriented Differential Testing of Object-Relational Mapping Systems},
author = {Thodoris Sotiropoulos and Stefanos Chaliasos and Vaggelis Atlidakis and Dimitris Mitropoulos and Diomidis Spinellis},
booktitle = {ICSE},
year = {2021},
doi = {10.1109/icse43902.2021.00137}
}