Testing a database application is a challenging process where both the database and the user interaction have to be considered in the design of test cases. This paper describes a specification-based approach to guide the design of test inputs (both the test database and the user inputs) for a database application and to automatically evaluate the test adequacy. First, the system specification of the application is modelled: (1) the structure of the database and the user interface are represented in a single model, called Integrated Data Model (IDM), (2) the functional requirements are expressed as a set of business rules, written in terms of the IDM. Then, a MCDC-based criterion is applied over the business rules to automatically derive the situations of interest to be tested (test requirements), which guide the design of the test inputs. Finally, the adequacy of these test inputs is automatically evaluated to determine whether the test requirements are covered. The approach has been applied to the TPC-C benchmark. The results show that it allows designing test cases that are able to detect interesting faults which were located in the procedural code of the implementation.
翻译:数据库应用程序的测试是一项具有挑战性的过程,需要同时在测试用例设计中考虑数据库和用户交互。本文提出一种基于规约的方法,用于指导数据库应用程序的测试输入(包括测试数据库和用户输入)设计,并自动评估测试充分性。首先,对应用程序的系统规约进行建模:(1) 将数据库结构与用户界面统一表示为一个称为集成数据模型(IDM)的模型;(2) 将功能需求表达为一组以IDM术语表述的业务规则。随后,基于这些业务规则应用MCDC(修正条件/判定覆盖)准则,自动衍生出待测试的关注场景(测试需求),以指导测试输入的设计。最后,自动评估这些测试输入的充分性,以确定测试需求是否得到覆盖。该方法已应用于TPC-C基准测试。结果表明,该方法能够设计出有效检测实现过程代码中特定故障的测试用例。