
A Meta-Model to Support Regression Testing of Web Applications Yanelis Hernandez, Tariq M. King, Jairo Pava and Peter J. Clarke School of Computing and Information Sciences Florida International University Miami, FL 33199, USA email: fyhern004, tking003, jpava001, clarkepg@cis.fiu.edu Abstract Software testing is a very costly and time-consuming endeavor. Some studies indicate that the cost of soft- As businesses strive to keep pace with the rapid evo- ware testing may account for between fifty to seventy- lution of web technologies, their efforts to maintain au- five percent of total development costs [7, 8]. In addi- tomated regression testing strategies are being hindered. tion, testing costs tend to exceed those of design and Technological migration of a web application can lead implementation, and therefore the methodologies and to test scripts becoming incapable of validating the mi- tools employed at these stages are pertinent to the de- grated application due to differences in the testing plat- velopment of affordable quality software. form. Regression tests that are still applicable to the Automation is an effective way to reduce time and application would therefore have to be re-written to be costs of software testing, and so many businesses con- compatible with the new technologies. duct their testing process with some degree of automa- In this paper, we apply a model-driven approach to tion. The level of automation of software testing typi- the development of automated testing scripts for vali- cally exists at the test script level. Software testers en- dating web applications from the client-side. We define code a set of test cases for the application in a scripting a meta-model using UML 2.0 profiles, and describe the language, and use the script as input to an automated model transformations needed to automatically port re- testing tool which executes the tests. If subsequent gression tests to various platforms. A prototype of the changes are made to the system, the test script pro- test implementation for an e-commerce application is vides a means for automatically performing regression also presented. testing to determine whether new errors were intro- duced into previously tested components [6]. Keywords: Regression Testing, MDSD, UML Script-level test automation becomes problematic when an application migrates to include technologies that are not supported by the testing tool currently 1 Introduction being utilized. Regression tests that are still applica- ble to the migrated application therefore have to be The many advances in web technologies has led to re-written in the scripting language of a new testing the development of web applications that compete in tool, thereby defeating the purpose of test automation. solution areas that traditional software previously ad- The model-driven software development (MDSD) dressed. Web applications are no longer simple streams paradigm emphasizes the use of models and model of static web pages, but instead provide a collection of transformations to generate executable code for a spe- interactive services with the added flexibility, mobility, cific platform. In this paper, we apply MDSD to the and connectivity of the Internet. These characteris- generation of an automated testing script for validat- tics have made web-based solutions highly attractive ing the client-side of a web application. To address the to businesses, and this has led to the creation of many aforementioned problem of script-level automation, we development and testing tools to support web program- propose that the test set for the web application be ming [5, 13, 17, 18, 19]. However, a negative conse- designed as a platform independent model which can quence of these advancements is the persistent growth be automatically transformed into a platform specific in the complexity of web applications, and the rapid automated testing script. evolution of their supporting technologies. The main contributions of this work are that it: (1) presents a model-driven approach to the design and In essence, the classification of a scripting language de- development of automated testing scripts to validate a pends on its implementation within the web applica- web application; (2) provides meta-models for a subset tion. For example, Flash [1] technologies may be im- of web-based development and testing technologies us- plemented on the client using companion technologies ing UML 2.0 [12] profiles; and (3) elaborates on a case such as HTML [19], or on the server by providing syn- study developed using the proposed modeling approach chronized updates to the client. to support testing. This paper is organized as follows: the next section 2.2 Regression Testing contains background information on web-based tech- nologies, regression testing, and meta-modeling. Sec- Software testing is the process of operating a soft- tion 3 presents the proposed approach to support test- ware system under specified conditions, recording the ing a migrated web application. Section 4 contains the results, and making an evaluation of some aspect of the meta-models used in our approach and describes the software [10]. Testing is particularly useful for validat- generation of the testing script. Section 5 provides the ing changes made to a system during software main- details of the case study. Section 6 presents related tenance or evolution. Regression testing refers to re- work, and in Section 7 we give concluding remarks and running test cases to determine whether or not new er- discuss future work. rors have been introduced into previously tested code [3]. In an effort to reduce costs, many testing strategies 2 Background employ automated tools to support the performance of regression tests on modified software systems. In this section we provide background information There has been a rapid growth of tools to support on the technologies commonly used to develop web ap- testing web applications on both the client and server plications. We then discuss the technique of regression sides. HTMLUnit [5] simulates the behavior of a web testing, including tool support for automatically vali- browser by providing an API to interact with web dating web applications. Approaches to meta-modeling pages. Functional testing tools such as TestSmith [13] are also described in this section. provide facilities for simulating mouse and keyboard events and hence can be used on the client-side to test 2.1 Web-Based Technologies Flash applications. On the server-side, PHPUnit [14], a member of the xUnit family of testing frameworks, is There are two broad categories of web programming a unit testing solution for PHP [18]. technologies used to develop web applications { client- side and server-side [4]. Client-side scripting technolo- 2.3 Meta-Modeling gies involve the use of a web-browser on the client ma- chine to perform operations without having to commu- Model-driven software development (MDSD) fo- nicate with the server. This type of scripting is gener- cuses on the combined use of software models and asso- ally used to dynamically modify the behaviors within a ciated transformations to build complete software sys- specific web page in response to user input [4]. Popular tems. This typically involves the use of a source model examples of client-side scripting technologies include or Platform Independent Model (PIM), and a target [17, 19]: HTML and Javascript. model or Platform Specific Model (PSM) [16]. The In contrast, server-side technologies perform opera- PIM does not rely on any specific technological plat- tions on the web server instead of on the client machine. form that could be used to implement the software, They are preferable when operations utilize informa- and therefore represents the essence of the solution. tion that is not available on the client, or when data A model transformation language can then be used to storage from the client to the server is needed [4]. Dy- transform the PIM into a PSM that is executable on namic operations on the server-side may involve chang- the target platform [16]. ing the web page supplied to the client, or providing A technique known as meta-modeling is used to en- a new sequence of web pages to the browser. Active sure the consistency of models during transformation. Server Pages (ASP) [4] and Hypertext Preprocessor This involves defining the abstract syntax of models (PHP) [18] are two examples of server-side scripting and the interrelationships between the model elements languages commonly used to develop web applications. [15]. Meta-modeling should consist of orthogonal di- Many web technologies can be integrated with oth- mensions that support two forms of instantiation [2]: ers and hence web applications usually employ a myr- linguistic { relates to the language definition, and onto- iad of technologies on both the client and the server. logical { relates to the domain definition. In this paper the ontological meta-modeling will be implemented us- WT Model 1 WT Model 2 PI Test Set ing UML 2.0 [12] profiles. (HTML, Javascript) (Flash, Actionscript) 3 MDSD Approach to Support Testing Test Script Generator In this section we define the scope of the problem PS Test Set 1 PS Test Set 2 being addressed in this paper. We then present our (HTMLUnit Tests) (TestSmith Tests) approach which applies MDSD to the generation of an Figure 2. Model-driven test script generation. automated testing script for validating a web applica- tion. WebObject WebPage -id : string * 1 -url : string 3.1 Problem Definition PagePart WebBrowser Interactive Static Automating the process of testing a web application involves developing a script that can be recognized by +loadWebPage() +hasFocus() : bool a testing tool, which then applies predefined test cases Text Image Container to the application under test. This is depicted in the left-hand portion of Figure 1, where a test script TS1 FillableControl Form ButtonControl validates an application under test AUT1; both of which * 1 1 * can be thought of as targeting the same set of web +getValue() +getControl() +press() technologies WT1.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-