计算机应用 ›› 2011, Vol. 31 ›› Issue (04): 948-951.DOI: 10.3724/SP.J.1087.2011.00948

• 计算机软件技术 • 上一篇    下一篇

基于逆向查询处理算法的数据库系统测试数据生成方法

冯丽云,洪玫,杨秋辉,周洪宇,臧康   

  1. 四川大学 计算机学院,成都 610065
  • 收稿日期:2010-10-21 修回日期:2010-12-07 发布日期:2011-04-08 出版日期:2011-04-01
  • 通讯作者: 冯丽云
  • 作者简介:冯丽云(1988-),女,河北邢台人,硕士研究生,主要研究方向:软件工程、软件测试;
    洪玫(1963-),女,浙江舟山人,教授,CCF会员,主要研究方向:软件工程、软件测试;
    杨秋辉(1970-),女,山东青岛人,副教授,博士,主要研究方向:软件工程、软件质量保证与测试;
    周洪宇(1986-),男,四川巴中人,硕士研究生,主要研究方向:软件工程、软件测试;
    臧康(1982-),男,河北保定人,硕士研究生,主要研究方向:软件工程、软件测试。

Data generation method of database system test based on reverse query process

Li-yun FENG,Hong MEI,Qiu-hui YANG,Hong-yu ZHOU,Kang ZANG   

  1. College of Computer Science, Sichuan University, Chengdu Sichuan 610065, China
  • Received:2010-10-21 Revised:2010-12-07 Online:2011-04-08 Published:2011-04-01
  • Contact: Li-yun FENG

摘要: 生成测试数据和数据库状态是进行数据库系统测试的重要工作,逆向查询处理(RQP)算法提供了一种生成测试数据的方法。然而RQP算法只针对Select查询语句,为克服这一局限性,在RQP的基础上进行扩展,形成逆向操作处理(RMP)算法,以处理SQL语言中的所有数据操作语句。RMP算法的基本思想是将Delete、Insert、Update等数据操作语句转化为查询操作,即将这些操作语句所需的数据库实例应满足的条件转化为用Select语句来描述,再将转化后得到的Select语句作为RQP算法的输入,从而得到满足条件的数据库实例。RMP算法支持SQL基本语句的逆向运算,为数据库测试数据的自动生成提供了更好的支持。

关键词: 逆向查询处理, 逆向操作处理, 关系运算, 数据库系统测试, 测试数据自动生成

Abstract: It is important to generate test data and database state for database system testing. The algorithm of Reverse Query Processing (RQP) provides a method to generate test data for database system testing, but it can only be used to process the Select query. In order to address this limitation, RQP was expanded into RMP (Reverse Manipulate Processing) so that it can be used for all the data manipulation statement in SQL. The main idea of RMP was to transform DML statements, such as Delete, Insert, Update, into Select. That is to use Select to describe the conditions that the database instance should meet the requirement of testing DML statements. Then RQP gets the transformed Select statements as inputs and returns a possible database instance that satisfies the conditions. RMP can reversely process the fundamental SQL statements and provide better support to automatic data generation for database system test.

Key words: Reverse Query Processing (RQP), reverse manipulate processing, relational operating, database system test, automatic test data generation

中图分类号: