The cost of defects in software applications increases exponentially when such defects are detected and fixed in later stages of the software development lifecycle. The earlier a software defect is detected, the easier and more cost effective it is to fix. Thus, software businesses are challenged to develop robust testing tools and methods to detect software defects early in the development cycle. Developing test cases and datasets for certain applications may be more challenging than others. For example, it may be challenging to generate test cases and data sets for testing an application including multiple forms for data entry (e.g., user interface forms) because of the large number of objects and data formats that are supported by such an application.
INTRODUCTION: Various embodiments described below were developed to leverage database metadata to generate test data for form validation and testing. The generated test data may be used to perform negative testing (i.e., testing the form against illegal or restricted values) and for testing inter-field logic. The described embodiments provide robust test data based on database metadata to increase test coverage and to detect defects early in the development cycle.
An example implementation includes maintaining metadata for a database. The database metadata may include column metadata such as field type, maximum length, mandatory field(s), relationships to other columns, and other column constraints or rules. For example, maintaining the metadata may include extracting and analyzing database metadata. The implementation also includes mapping a control field of a form to a column of the database, and generating test data based on the mapping and the metadata. In one embodiment, negative test data is generated, where the negative test data include extreme data values for negative testing. In another embodiment, test data for inter-field logic validation is generated for validating values in a combo control field and for validating a relation between two or more combo fields. Further, test scripts may be generated based on the test data for injecting test data values during testing.
The following description is broken into sections. The first, labeled “Environment,” describes an example of a network environment in which various embodiments may be implemented. The second section, labeled “Components,” describes examples of physical and logical components for implementing various embodiments. The third section, labeled “Operation,” describes steps taken to implement various embodiments.
ENVIRONMENT:
In the example of
COMPONENTS:
Metadata extraction engine 202 represents generally any combination of hardware and programming configured to extract metadata from a database. For example, metadata extraction engine 202 may be operable to analyze columns of the database, analyze and extract the metadata associated with each column. The column metadata is associated with each form field of the database. Thus, metadata extraction engine 202 may analyze and extract database metadata from application 210 or may retrieve stored database metadata from data store 104. Database metadata includes field type, maximum length, mandatory fields, relationships between columns of the database, other column constraints and rules, and structures and properties describing the database tables and corresponding elements. If the database metadata is extracted from application 210, the extracted metadata information may be stored in data store 104.
Mapping engine 204 represents generally any combination of hardware and programming configured to map a control field of the form to a column of the database. For example, if the form data is stored in a relational database, input controls of the form are mapped to columns in the database. Mapping of a control to a column means that a particular control field in the form displays data from a particular column (i.e., the mapped column) in the database table.
In one embodiment, mapping engine 204 is operable to receive user configuration inputs for mapping the control fields to the table columns. For example, mapping engine 204 may be configured to generate a graphical user interface (GUI) for receiving mapping configuration from a user. To illustrate, the GUI may generate a visual representation of the table and of the form to enable the user visually columns of the table to form fields. In another embodiment, mapping engine 204 may execute mapping algorithms to automatically map control fields of the form to the database columns. It should be noted that mapping engine 204 may also implement one of the user defined mapping and the algorithm based mapping or a combination of both.
Test data generation engine 206 represents generally any combination of hardware and programming configured to generate test data for testing the form based on the metadata and the mapping. For example, test data generation engine 206 generates the test data for the form based on the extracted or provisioned column metadata and based on the mapping of form control fields to database columns. The generated test data are usable for performing at least one of negative testing of the form and inter-field logic validation of the form.
Because the column metadata describe data types, data constraints, data limits, mandatory fields, and other column properties, and since the columns have been mapped to the input control fields of the form, test data usable for negative testing may be generated, according to one embodiment. Negative test data are usable for testing the form against illegal value entry. For example, the negative test data may by based on column type. To illustrate, if the column is of numeric type, negative test data including non-numeric data, empty string, large value numbers, or negative values may be generated and entered into the form. If the column is of numeric integer type, negative data having decimal data values may be generated and entered. If the column is of data type, negative test data including empty string types, wrong data format, negative or out of range values may be generated and entered. Further, if the column defines string types, negative test data comprising long string values exceeding the string max parameter may be generated and entered. As another example, if the column is defined as being mandatory or required, negative test data including empty or null values may be generated and entered. Thus, negative test data include test data generated that are data values that are contrary, illegal or extreme to the defined values of the column and that are inserted into control fields of the form during testing (i.e., negative testing) to generate an error in the form and ensure that the form does not accept such values during deployment. If such test data are accepted during testing, without an error, then defects in the form (software application) is detected, thereby saving costs associated with fixing such costs.
In another example embodiment, the generated test data are usable for performing inter-field logic validation of the form. Accordingly, such test data are usable for validating behavior of inter-field logic between controls of the form. In one example, the inter-field logic validation test data may include test data for validating data values in a combo control field based on mapped data columns and lookup tables associated with the combo control field (i.e., one or more other tables with a many to one relation to the column). Referring to
In another example, the inter-field logic validation test data may include test data for validating a relationship between two combo fields, based on their relation in the database. Referring to
In foregoing discussion, engines 202-208 of
In one example, the program instructions can be part of an installation package that when installed can be executed by processor 304 to implement system 102. In this case, medium 302 may be a portable medium such as a CD, DVD, or flash drive or a memory maintained by a server from which the installation package can be downloaded and installed. In another example, the program instructions can be part of an application or applications already installed. Here, medium 302 can include integrated memory such as hard drive, solid state drive, or the like.
In
In
OPERATION:
Starting with
Method 700 also includes step 730, where a control field of a form is mapped to a column of the database. Referring to
Method 700 may proceed to step 740, where test data for the form is generated based on the mapping and the metadata. Referring to
CONCLUSION:
Embodiments can be realized in any computer-readable medium for use by or in connection with an instruction execution system such as a computer/processor based system or an ASIC (Application Specific Integrated Circuit) or other system that can fetch or obtain the logic from computer-readable medium and execute the instructions contained therein. “Computer-readable medium” can be any individual medium or distinct media that can contain, store, or maintain a set of instructions and data for use by or in connection with the instructions execution system. A computer-readable medium can comprise any one or more of many physical, non-transitory media such as, for example, electronic, magnetic, optical, electromagnetic, or semiconductor device. More specific examples of a computer-readable medium include, but are not limited to, a portable magnetic computer diskette such as floppy diskettes, hard drives, solid state drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory, flash drives, and portable compact discs.
Although the flow diagrams of
The present invention has been shown and described with reference to the foregoing exemplary embodiments. It is to be understood, however, that other forms, details and embodiments may be made without departing from the spirit and scope of the invention that is defined in the following claims.
Number | Name | Date | Kind |
---|---|---|---|
5715373 | Desgrousilliers | Feb 1998 | A |
5724273 | Desgrousilliers | Mar 1998 | A |
5812436 | Desgrousilliers | Sep 1998 | A |
6907546 | Haswell | Jun 2005 | B1 |
7010546 | Kolawa | Mar 2006 | B1 |
7363578 | Bendsen | Apr 2008 | B2 |
7917895 | Givoni et al. | Mar 2011 | B2 |
9037549 | Sankaranarayanan | May 2015 | B2 |
20020101920 | Choi | Aug 2002 | A1 |
20040107183 | Mangan | Jun 2004 | A1 |
20040153968 | Ching | Aug 2004 | A1 |
20050172261 | Yuknewicz | Aug 2005 | A1 |
20050273763 | Bendsen | Dec 2005 | A1 |
20060026506 | Kristiansen | Feb 2006 | A1 |
20080147753 | Chasman | Jun 2008 | A1 |
20080270841 | Quilter | Oct 2008 | A1 |
20090063555 | Fisher | Mar 2009 | A1 |
20090083616 | Ali | Mar 2009 | A1 |
20090217250 | Grechanik | Aug 2009 | A1 |
20090217302 | Grechanik | Aug 2009 | A1 |
20090300585 | Meenakshisundaram et al. | Dec 2009 | A1 |
20110022575 | Tomkins | Jan 2011 | A1 |
20110088014 | Becker | Apr 2011 | A1 |
20110161375 | Tedder | Jun 2011 | A1 |
20110231708 | Lawrance et al. | Sep 2011 | A1 |
20110246415 | Li | Oct 2011 | A1 |
20120290527 | Yalamanchilli | Nov 2012 | A1 |
20120310905 | Hans | Dec 2012 | A1 |
Entry |
---|
Mohammed M. Elsheh et al., Generation and Validation of Web Forms Using Database Metadata and XFORMS, 2010, [Retrieved on Dec. 6, 2013]. Retrieved from the internet: <URL: http://spict.utar.edu.my/SPICT-10CD/papers/spict10—18.pdf> 4 pp. 23-26. |
Gurmeet Singh et al., A Metadata Catalog Service for Data Intensive Application, 2003 IEEE, [Retrieved on Mar. 8, 2017]. Retrieved from the internet: <URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=1592936> 17 pp. 1-17. |
Phokion G. Kolaitis, Schema Mappings, Data Exchange, and Metadata Management, Jun. 13-15, 2005, [Retrieved on Mar. 8, 2017]. Retrieved from the internet: <URL: http://delivery.acm.org/10.1145/1070000/1065176/p61-kolaitis.pdf> 15 pp. 61-75. |
Anthony J. Lombardo, Functional Test Strategy, Cornell University, edited by Aaron Godert on Jan. 5, 211, Retrieved Internet Jun. 25, 2012,https://confluence.cornell.edu/display/CYNERGY/Functional+Test+Strategy. |
Number | Date | Country | |
---|---|---|---|
20140007056 A1 | Jan 2014 | US |