华东师范大学学报(自然科学版) ›› 2023, Vol. 2023 ›› Issue (5): 51-64.doi: 10.3969/j.issn.1000-5641.2023.05.005

• 数据库系统 • 上一篇    下一篇

基于模糊测试生成多样化的数据库隔离级别测试案例

卢皙钰1, 刘维2,*(), 翁思扬1, 李可强1, 张蓉1   

  1. 1. 华东师范大学 数据科学与工程学院, 上海 200062
    2. 工业和信息化部电子第五研究所, 广州 511300
  • 收稿日期:2023-06-29 出版日期:2023-09-25 发布日期:2023-09-15
  • 通讯作者: 刘维 E-mail:liuwei@ceprei.com
  • 基金资助:
    国家自然科学基金(62072179); 基础软硬件性能与可靠性测评工业和信息化部重点实验室开放课题;面向OLTP数据库的功能测试合作项目

Generating diverse database isolation level test cases with fuzzy testing

Xiyu LU1, Wei LIU2,*(), Siyang WENG1, Keqiang LI1, Rong ZHANG1   

  1. 1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
    2. The Fifth Electronics Research Institute of the Ministry of Industry and Information Technology, Guangzhou 511300, China
  • Received:2023-06-29 Online:2023-09-25 Published:2023-09-15
  • Contact: Wei LIU E-mail:liuwei@ceprei.com

摘要:

在现代信息系统中, 数据库管理系统扮演着至关重要的角色. 隔离级别测试对数据库管理系统而言具有重要意义, 它确保并发操作的隔离性和数据的一致性, 从而防止数据损坏和安全风险的发生, 并为用户提供可靠的数据访问保障. 模糊测试是一种广泛应用于软件和系统测试的方法, 通过搜索测试空间并生成多样化的测试案例, 探索系统的边界条件、异常情况和潜在问题, 以发现可能的漏洞. 本文介绍了针对数据库隔离级别进行模糊测试的工具SilverBlade, 旨在提升生成测试案例的多样性, 深入探索隔离级别测试空间. 为了有效搜索庞大的测试空间, 设计了结构化的测试输入结构, 将测试空间拆分成并发事务组合和并发事务执行交互模式两个子空间进行搜索. 为了更全面地测试隔离级别核心实现测试空间, 还设计了基于深度和广度的自适应搜索方式, 用于有效变异测试案例. 实验结果表明, SilverBlade能够生成多样性的测试案例, 并能够在流行的数据库管理系统PostgreSQL中更广泛地覆盖数据库隔离级别核心实现代码. 与对比工具相比, SilverBlade在提高隔离级别关键区域的测试覆盖率方面表现更佳.

关键词: 模糊测试, 多样性测试案例, 隔离级别, 并发事务, 数据库管理系统

Abstract:

Database management systems play a vital role in modern information systems. Isolation level testing is important for database management systems to ensure the isolation of concurrent operations and data consistency to prevent data corruption, inconsistency and security risks, and to provide reliable data access to users. Fuzzy testing is a method widely used in software and system testing. By searching the test space and generating diverse test cases, it explores the boundary conditions, anomalies and potential problems of the system to find possible vulnerabilities. This article introduces SilverBlade, a tool for fuzzy testing of database isolation levels, that aims to improve the diversity of generated test cases and explore the isolation level test space in depth-wise. To effectively search the huge test space, this study designed a structured test input that splits the test space into two subspaces of concurrent transaction combination and execution interaction modes for searching. To test the isolation-level core implementation test space more comprehensively, an adaptive search method based on depth and breadth was also designed for effective mutation test cases. The experimental results show that SilverBlade is able to generate diverse test cases and provide broader coverage of the core implementation code of the database isolation level in the popular database management system PostgreSQL. Compared to similar tools, SilverBlade performed better at improving test coverage in critical areas of the isolation level.

Key words: fuzzy testing, diversity test cases, isolation level, concurrent transaction, database management system

中图分类号: