当前位置:文档之家› 计算机专业英语期末论文翻译

计算机专业英语期末论文翻译

Database Application Testing1.IntroductionDatabases play a pivotal role in almost every organization in today’s information-based society. Commercial Database managementsystems(DBMSs) provide organizations with efficient access to huge amounts of data without affecting the integrity of data and relieving 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 ensuring 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 can’t be of much help 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 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 phases :•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 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 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 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 theoutput, it has to be checked after each 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 suggested 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 and 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 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 parameters 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 andsemi-automatically checks the state change.5. Output Validator :It captures the application’s outputs and 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 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 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 DBMS’s internal catalog tables is needed by other components of AGENDA. Allowing them to directly query these tableswould 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 ported 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. 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 marked 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 such 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 between 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 visited 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 parameter 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 information 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 represent natural sequences of execution of URLs asa 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. 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 AGENDA. 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 style. 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, various 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, most 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 instancere-engineering of business processes, authorization rules being changed etc. Changing database applications is very costly and involves great deal of manual work since there aren’t 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 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 strategies 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 every 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 applications. 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, attributes 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. It 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 test web application security. Regression testing is a well-studied technique in Software engineering, however issues specifically related to database applications haven’t received the deserved attention. The whole topic of testing database applications is still in its infancy. No rigorous methodologies 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 testing database applications efficient.数据库应用程序的测试1.引言数据库中的几乎每一个组织在当今信息化社会中发挥了举足轻重的作用。

相关主题