The present invention relates to enterprise applications and, more particularly, to methods and systems for testing enterprise applications.
The automated testing of an enterprise application program usually requires the generation of commands to the enterprise application program and the validation of outputs as a result of the commands. In a typical automated test approach, users manually hardcode test scripts to generate user interface actions that directly map to user interfaces of the enterprise application program. However, if the user interfaces of the enterprise application program change, the test scripts must also be updated because the user interface actions directly map to the user interfaces. The manual updates to the test scripts are labor-intensive and can result in unstable test scripts because of the complicated updates.
Another test approach is model-based test automation where a formal model is created that describes the behavior of a system under test. After the creation of the formal model, the actual behavior of the system under test is compared with a simulation that is based on the formal model. The formal model can be either hardcoded or derived from an external specification, such as one represented in Unified Modeling Language (UML). A common limitation of the model-based test automation approach is that the formal model is difficult to create because such an approach can only derive limited information from the enterprise application program. For example, the model-based test automation approach cannot derive metadata associated with user interfaces, thereby preventing automatic execution against the user interfaces. Furthermore, the UML model lacks synchronization with the typical metadata used by the enterprise application program.
As a result, there is a need to provide methods and systems for testing an enterprise application program that is not labor intensive and can easily adapt to updates of the enterprise application program.
Broadly speaking, the present invention fills these needs by providing methods and systems for testing an enterprise application program. It should be appreciated that the present invention can be implemented in numerous ways, including as a method, a system, or a device. Several inventive aspects of the present invention are described below.
In accordance with a first aspect of the present invention, a method for testing an enterprise application program is provided. In this method, business model metadata and controller metadata are received from the enterprise application program and a test script is generated based on the business model metadata and the controller metadata. The test script is then translated to a user interface action.
In accordance with a second aspect of the present invention, a computer readable medium having program instructions for testing an enterprise application program is provided. The computer readable medium includes program instructions for exporting business model metadata and controller metadata from the enterprise application program to an Extensible Markup Language (XML) schema file. Additionally included are program instructions for generating a test script based on the XML schema file and program instructions for translating the test script to a user interface action.
In accordance with a third aspect of the present invention, a system for testing an enterprise application program is provided. The system includes a server computing device that includes memory for storing an enterprise application testing module and a processing unit for executing the enterprise application testing module. The enterprise application testing module includes program instructions for importing metadata from the enterprise application program, program instructions for generating a test script based on the metadata, and program instructions for translating the test script to a user interface action.
Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.
The present invention will be readily understood by the following detailed description in conjunction with the accompanying drawings, and like reference numerals designate like structural elements.
The invention may be implemented in numerous ways, including as a system, a process, an apparatus, or as computer program instructions included on a computer readable medium such as a computer readable storage medium or a computer network wherein program instructions are sent over optical or electronic communication links.
A detailed description of one or more examples is provided below along with accompanying figures. The detailed description is provided in connection with such examples, but is not limited to any particular embodiment. The scope is limited only by the claims and numerous alternatives, modifications, and equivalents are encompassed. Numerous specific details are set forth in the following description in order to provide a thorough understanding. These details are provided for the purpose of example and the described embodiments may be implemented according to the claims without some or all of these specific details. For the purpose of clarity, technical material that is known in the technical fields related to the embodiments has not been described in detail to avoid unnecessarily obscuring the description.
The embodiments described herein provide methods and systems for testing enterprise applications. Essentially, as will be explained in more detail below, real-world metadata used by an enterprise application program is reused for capturing information about the enterprise application program that is used for testing. For example, in one embodiment, metadata from the enterprise application program is imported and test scripts are generated based on the imported metadata. The test scripts are then translated to user interface actions, which are used during testing to provide user commands to the enterprise application program.
Enterprise application program, such as server-side enterprise application program 104 and client-side enterprise application programs 105, can be hosted on server 106 and additionally executed on clients 108. Enterprise application program can include any suitable application software that provides business logic support functionality. Exemplary enterprise application program includes customer relationship management software, financial management software, project management software, etc. As shown in
In addition to hosting server-side enterprise application program 104, server 106 can also host enterprise application testing module 102. As will be explained in more detail below, in one embodiment, enterprise application testing module 102 includes logic and/or program instructions for generating test scripts based on metadata received from enterprise application programs 104, 105 and for translating the test scripts to user interface actions.
Thereafter, in one embodiment, a determination is made in operation 403 whether portions of the received business model metadata and/or the controller metadata are missing. It should be appreciated that portions of received metadata, such as business model metadata and controller metadata, may be missing because such metadata can be hardcoded into the program code, which cannot be easily extracted. If portions of metadata are missing, then the missing portions are filled with augmented business model metadata and/or augmented controller metadata in operation 404. In one embodiment, a user can manually fill in the missing portions with augmented metadata generated on an editor, such as an XML editor.
After the missing portions of metadata are filled in operation 404 or if the business model metadata and the controller metadata received are complete, then, as shown in operation 406, test scripts are generated based on the business model metadata and the controller metadata. As will be explained in more detail below, in one embodiment, the test scripts can be manually generated by using an editor, such as an XML editor. In another embodiment, the test scripts are automatically generated.
Still referring to
Additionally, as discussed above, if portions of metadata are missing, then the missing portions can be filled with augmented metadata. As shown in
After export request document 506, metadata augmentation document 514, business model metadata, and/or controller metadata have been updated or created, test framework metadata exporter 502 exports business model metadata and controller metadata as XML schema files 524. It should be noted that an enterprise application testing module can be referred to as a test framework. Thereafter, with the use of XML editor 504, a user may generate test scripts 510 in XML format based on XML schema files 524 of the business model metadata and controller metadata. In one embodiment, there may be two forms of test scripts 510. One form includes test scripts for automatic generation of a whole collection of tests. Another form includes manually generated test scripts for individual tests. In both forms, test scripts 510 may be XML documents governed by the XML schemas. A test framework has the ability to automatically create tests that try all combination of objects and actions. Since for any case, such ability can produce a near infinite sequence, constraints may be introduced in the generation process to create a useful, finite series of tests.
Test framework runtime 508 then executes test scripts 510 using dynamically accessed view metadata 520 of application framework 522 to translate the test scripts to user interface actions. In one exemplary embodiment, a mapping provided by view metadata 520 may be used to translate specific actions of test scripts 510 into user interface actions. It should be appreciated that middleware 512 acts as an intermediary between test framework and application framework 522. Test framework metadata adapter 518 and test framework metadata adapter interface 516 include components for the test framework to interface with application framework 522.
In summary, the above-described embodiments provide methods and systems for testing enterprise applications. As discussed above, the metadata of an enterprise application program can be reused for capturing information about the enterprise application program. The reuse of metadata eliminates the need for a user to manually construct a model and to manually hardcode test scripts for testing an enterprise application program every time the enterprise application is updated. Furthermore, the practical complexity of testing enterprise applications is reduced with the allowance of portions of the enterprise application program to be tested and the allowance of some manual intervention (e.g., the augmentation of missing metadata).
With the above embodiments in mind, it should be understood that the invention may employ various computer-implemented operations involving data stored in computer systems. These operations are those requiring physical manipulation of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. Further, the manipulations performed are often referred to in terms, such as producing, identifying, determining, or comparing.
The invention can also be embodied as computer readable code on a computer readable medium. The computer readable medium is any data storage device that can store data which can be thereafter read by a computer system. The computer readable medium also includes an electromagnetic carrier wave in which the computer code is embodied. Examples of the computer readable medium include hard drives, network attached storage (NAS), read-only memory, random-access memory, CD-ROMs, CD-Rs, CD-RWs, magnetic tapes, and other optical and non-optical data storage devices. The computer readable medium can also be distributed over a network coupled computer system so that the computer readable code is stored and executed in a distributed fashion.
Any of the operations described herein that form part of the invention are useful machine operations. The invention also relates to a device or an apparatus for performing these operations. The apparatus may be specially constructed for the required purposes, or it may be a general purpose computer selectively activated or configured by a computer program stored in the computer. In particular, various general purpose machines may be used with computer programs written in accordance with the teachings herein, or it may be more convenient to construct a more specialized apparatus to perform the required operations.
The above described invention may be practiced with other computer system configurations including hand-held devices, microprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers and the like. Although the foregoing invention has been described in some detail for purposes of clarity of understanding, it will be apparent that certain changes and modifications may be practiced within the scope of the appended claims. Accordingly, the present embodiments are to be considered as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but may be modified within the scope and equivalents of the appended claims. In the claims, elements and/or steps do not imply any particular order of operation, unless explicitly stated in the claims.