




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Database Application Testing1.IntroductionDatabases play a pivotal role in almost every organization in todays information-based society. Commercial Database management systems(DBMSs) provide organizations with efficient access to huge amounts of data without affecting the integrity of data and reli
2、eving the user of the any need to understand the low-level implementation details. Over the years tremendous efforts have been devoted to ensuring use of efficient and integrity protecting data structures and algorithms by DBMSs. However, little has been done to develop systematic techniques for ens
3、uring correctness of applications using these DBMSs. Many testing techniques have been developed to help ensure that behaviour of a program is in accordance with the specifications. However, these techniques mostly target programs written in traditional imperative languages and cant be of much help
4、when it comes to database applications. Like any other program, database application program can be viewed as an attempt to implement a function. Considered this way, both the input and output spaces of this function will include database state apart from the explicit input and output parameters of
5、the application. This affects substantially the way a test case is defined, generated and executed to check correctness of application. Hence there is a need for new approaches specifically oriented towards testing database applications.Testing database application programs involves the following ph
6、ases : Extraction of information from database schema Generation of test data and Populating test database Generation of test cases as input to the application program Validation of database state and output after executionUsing live data has several limitations. It may not reflect sufficiently wide
7、 variety of possible situations and even if it does, it might be difficult to find them in a large database. Secondly, privacy or security constraints might prevent the user from seeing sensitive data. Hence, various methods for generating synthetic test data have been proposed. When generating data
8、 and populating the test database, its important to generate valid and interesting data e.g. it would be advisable to select data so as to include situations which the tester believes are likely to occur or will expose faults in application. The technique used for test data generation will determine
9、 the extent of coverage of test database. Selecting a good initial database state so as to include a wide variety of scenarios resembling real data for the particular application is very beneficial. Since database state plays an important role in determining the output, it has to be checked after ea
10、ch execution that only the specified modifications and none others have occurred.2.AGENDA - tool set for testing DB applicationsAGENDA is a tool set has been designed. AGENDA takes as input the application database schema, application source code and files containing sample values which contain sugg
11、ested values for the attributes provided by the user. The user interactively selects test heuristics and provides information about expected behaviour of test cases. Using this information AGENDA, populates the database, generates inputs to the application, executes the application on those inputs a
12、nd checks some aspects of correctness of the resulting database state and application output.13. Input Generator :It generates the input data to be supplied to the application by using information derived from Agenda parser and State generator in addition to the information gained by parsing the SQL
13、 statements in the application program and information useful for checking test results. Information derived from parsing the source code may be useful in suggesting inputs that tester should supply to the application. The input generator thus generates test inputs by instantiating the input paramet
14、ers with actual parameters.4. State Validator :The validator monitors the change in application DB state during execution of a test. It automatically logs the changes in the application tables and semi-automatically checks the state change.5. Output Validator :It captures the applications outputs an
15、d checks them against the query preconditions and post conditions that have been generated by the tool or supplied by the tester.6. Design and Implementation6.1 Parsing toolThe Agenda Parsing tool is based on PostgresSQL parser. PostgresSQL parser creates an Abstract Syntax Tree containing relevant
16、information about tables, attributes and constraints from a given schema. However, this information is spread out at different locations in the tree. In addition, it is possible to have different tree structures having the same underlying information about the tables, because of use of different SQL
17、 DDL syntactic constructs expressing the same information. Consequently, the exact location of relevant information depends on the exact syntax of schema definition. Some of the information from DBMSs internal catalog tables is needed by other components of AGENDA. Allowing them to directly query th
18、ese tables would have introduced interdependency between AGENDA components which is not desirable. Hence all the information that needs to be processed is stored in Agenda DB which is made available to other components. This decoupling of PostgresSQL from rest of the components allows AGENDA to be p
19、orted to different DBMS just by changing the Parser. The Parser extracts information about integrity constraints such as uniqueness constraints, referential constraints and not NULL constraints from schema. It also extracts limited information from semantic constraints, particularly boundary values.
20、 This is very useful in automatic data-partitioning and input generation. Next, the Agenda Parser parses the sample-value files containing user-supplied data and stores the sample values, their data groups and associated attributes in the Agenda DB. Attributes involved in composite constraints are m
21、arked so that they can be correctly handled by input generator.7 Extensions to AGENDA7.1 Testing Web DB applicationsWith the tremendous growth of World Wide Web, many new web-based services that are driven by data stored in databases are gaining importance. Examples include E-commerce applications s
22、uch as online stores, and business-to-business support products. Some of these are of critical importance and hence it is essential to ensure their correct functioning. Most web DB applications consist of threes layers - at the base is DBMS and a database, at the top is client web browser and in bet
23、ween lies the application logic - usually developed with a server-side scripting language or Java extended with library that can interface with DBMSs, and can decode and produce HTML pages displayed in the client browser. For a web application a test case is considered as a sequence of pages to be v
24、isited along with the input values to be provided to the pages containing forms. The white box approach involves following steps:1. Information extraction from application source :Useful information such as URL links(which includes all other URLs that can be reached from the current page) and parame
25、ter information (name-value pairs that are passed to the Servlet) for each URL is extracted from application source. URLs are partitioned into two categories depending on their content - static and data-based(dynamic) page.2. Web application graph generation and path selection : Based on the informa
26、tion extracted earlier, an application graph, where each node represents a URL and edges represent URL links, is generated and then simplified according to URL link types. There is an edge from URL A to URL B if URL A produces a link to URL B in the HTML page it generates. Paths through the graph re
27、present natural sequences of execution of URLs as a user navigates through the web application. Hence, some of these paths are selected as test cases to represent possible scenarios of use of the application.3. Input Generation :For each path selected, AGENDA is used to generate inputs for each URL.
28、 The path along with inputs constitute a test case. An XML file is generated corresponding to each such test case.4. Test Execution :The XML file is parsed using XML parser to extract URL information and the test case is executed automatically using open source Jakarta Http Client integrated with AG
29、ENDA. After execution of each update or insertion, AGENDA checks the new database states. Output pages are checked by manual inspection or other tools. The tool in its current form is targeted to the Java Servlet model, using JDBC for database access, and makes some assumptions about programming sty
30、le. However, the basic technique can be applied to more general servlet styles and other web application languages.8.Regression Tests For Database ApplicationsAny application is constantly going through the process of evolution such as its components getting replaced with more powerful components, v
31、arious optimizations being incorporated and so on. Whenever such modification is introduced in an application, it is important to check for the integrity of the application and that is the purpose of regression tests. There are various tools built for automating the regression testing procedure, mos
32、t popular being JUnit framework developed for carrying out regression tests for Java applications. Database applications which are composed of many layers and stacked in various layers are, in particular, subject to constant change for instance re-engineering of business processes, authorization rul
33、es being changed etc. Changing database applications is very costly and involves great deal of manual work since there arent any tools available that can automatically carrying out regression tests on them. 9.Conclusions and Future WorkThe AGENDA tool set was designed and implemented in response to
34、a lack of specific work targeted at testing database application. Prior to AGENDA, various approaches had been proposed and implemented for tackling the issues involved in database testing individually. However, no single tool had been designed to tackle all the issues together by integrating the st
35、rategies to handle different issues. AGENDA handles a variety of issues such as test data generation, populating the test database, generating interesting test cases and handling integrity constraints of the application database such as not-Null, uniqueness etc, checking the database state after eve
36、ry modification, executing the test case and validating the output. Besides, later extensions to AGENDA have enhanced its ability improving the state checking and input generation mechanism and enabling the tool to test transactions. AGENDA has also served as an aid in testing web-based database app
37、lications. However, there are a lot of issues still to be dealt with and many limitations to be addressed. AGENDA uses semi-automatic technique for generating test data. e.g. For attributes having numeric/real value the sample-value file is generated automatically (Section 2.2.1). However, attribute
38、s of string type are not handled. Increasing the extent of automation, extracting more information from the embedded SQL statements in the application program source are some of the important tasks that need attention. The tool for testing web-based applications has a lot of limitations as of now. I
39、t can currently handle only applications implemented Java Servlets and HTML pages. Further, it assumes that the application source follows certain programming style. These issues are being addressed to. There is also work going on to extend the tool to handle issues like sessions, cookies etc and te
40、st web application security. Regression testing is a well-studied technique in Software engineering, however issues specifically related to database applications havent received the deserved attention. The whole topic of testing database applications is still in its infancy. No rigorous methodologie
41、s have been devised yet and there are several open issues such as the automatic generation and evolution of test runs, the generation of test databases, and the development of platform independent tools. All these challenges are currently being tackled and efforts are on to make the process of testi
42、ng database applications efficient.数据库应用程序的测试1引言数据库中的几乎每一个组织在当今信息化社会中发挥了举足轻重的作用。商业数据库管理系统(DBMS)提高了大量的数据访问效率而不影响数据的完整性,减轻用户任何需要了解底层实现细节的地方。多年来已投入了巨大的努力,确保使用有效和完整性保护的数据库管理系统的数据结构和算法。然而,很少有系统的技术发展为确保使用这些数据库管理系统应用的正确性。许多测试技术已被开发,以帮助确保一个程序的行为是否符合技术规格。然而,这些技术主要是针对传统的命令式语言编写的程序,在数据库的应用时没有多大帮助。像任何其他程序,数据库应用
43、程序可以被看作是试图实现一个功能。认为这种方式,无论是输入和输出空间的功能都将包括数据库状态除了明确的输入和输出参数的应用。这会影响的基本上是一个测试用例的定义方式,在生成并执行的正确性检查中的应用。因此,有一个新的方法,专门面向数据库应用程序的测试需要。测试数据库应用程序包括以下阶段:从数据库架构提取信息生成测试数据和填充测试数据生成测试用例的输入到应用程序执行后的数据库状态并验证输出使用现场数据存在一些局限性。它可能不反映足够大的各种可能情况,即使是它也可能很难在大型数据库中找到他们。其次,隐私和安全约束可能会阻止用户看到敏感数据。因此,生成合成的测试数据已经提出了各种方法。当生成数据填充
44、测试数据库,其重要的是产生有效和有趣的数据或是明智的选择数据,包括测试人员认为可能发生的情况或将故障中的应用。用于测试数据生成技术将决定测试数据库的覆盖范围。选择一个好的初始数据库的状态,包括各种各样的类似真实的数据为特定的应用场景是非常有益的。由于数据库状态确定输出起着重要的作用,它是每个执行只有指定的修改和其他不发生后的检查。2.agenda -测试数据库应用程序设置工具议程是一个工具集,议程需要输入应用程序的数据库架构,应用程序源代码和文件,其中含有建议为用户提供的属性值的样本值。用户以交互方式选择测试启发式和提供的信息对预期的行为的测试用例。使用此信息的议程,填充数据库,生成
45、输入到应用程序,执行应用程序的输入、检查所产生的数据库状态和输出的正确性1方面的应用3输入信号发生器:它产生的输入数据信息被提供给应用程序使用,这是来自议程解析器和状态发生器除了获得的信息通过解析SQL语句的应用程序和信息的有用的测试结果。从分析源代码的信息可能会提示输入,测试仪应供应的应用是有用的输入发生器,从而使测试输入的输入参数与实际参数实例化。4状态验证:验证器监控应用数据库状态变化的测试执行期间,它会自动记录在应用程序表和半自动检查状态的变化。5输出校验:它捕获应用程序的输出和检查他们对查询条件和后置条件已产生的工具或提供的测试仪。6. 分析工具议程的分析工具是基于PostgreSQ
46、L的分析器。PostgreSQL的解析器从一个给定的模式的属性和约束创建包含表中相关信息的抽象语法树。然而,这个信息是分散在不同地点的树。此外,它可能有不同的树结构具有相同的基本资料表,因为使用不同的SQL DDL语法结构表达相同的信息。因此,相关信息的准确位置取决于架构定义的具体语法。一些DBMS内部目录表的信息是通过议程的其他组件的需要让他们直接查询这些表将引入议程的组件之间的相互依存性是不可取的。因此,所有的待处理的信息存储在数据库中的议程是提供给其他组件。该解耦从部件允许连接其他议程,可以通过改变分析器移植到不同的数据库管理系统。分析器提取信息的完整性约束,如唯一性约束,从图式的参照约束和非空约束。它还提取有限的信息从语义约束,特别是边界值。这是自动数据划分和输入生成非常有用。下一个议程,解析器解析包含用户提供的数据和存储的采样值的文件,他们的数据组和关联的属性在议程分贝参与组合约束属性标记,以便它们可以被输入发生器正确地处理。7议程的扩展7.1测试的Web数据库应用随着万维网的飞速发展,许多新的基于网络的服务,使数据库中存储的数据驱动越来越重要。例子包括:电子商务的应用,如网上商店,和业务支持的产品。这些都是至关重要的,因此,它是确保其正确的运作至关重要。大多数的Web数据库应用包括三层在该基地是数据库管理系统和数据库,在顶部是客户端Web浏览器和应
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2022-2023学年七年级下册科学第一章第三节测试卷及答案浙教版
- 医学知识小学课堂
- 高级会计投资决策题型分析试题及答案
- 大唐芙蓉园 旅游规划与开发 案例分析 文化主题公园
- 交易磋商和协议的签订
- 身高管理员工手册
- 消防信息化管理工具试题及答案
- 农村法律常识讲座课件3
- 公司介绍康柏菲
- 公司一级培训知识
- 新技术、新工艺、对提高工程质量、缩短工期、降低造价的可行性
- 金属矿床地下开采复习题及答案
- GB 5009.34-2022食品安全国家标准食品中二氧化硫的测定
- 教学课件《断裂力学》
- 慢阻肺的管理课件
- 电工基本知识培训资料课件
- 北师大版《相遇问题》公开课课件
- 邻补角、对顶角、同位角、内错角、同旁内角经典习题-一对一专用
- HP系列培训手册
- 毕业论文-原油电脱水方法与机理的研究
- 陕西省2022年普通高中学业水平考试(真题)
评论
0/150
提交评论