Nothing Special   »   [go: up one dir, main page]

Improving Testing Architecture For MVC Based Application

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Volume 4, Issue 2, February 2014

ISSN: 2277 128X

International Journal of Advanced Research in


Computer Science and Software Engineering
Research Paper
Available online at: www.ijarcsse.com
Special Issue: International Conference on Advanced Developments in Engineering and Technology
Conference Held in Lord Krishna College of Engineering Ghaziabad, India

Improving Testing Architecture for MVC Based Application


Vivek Kumar1

Aarti Gautam Dinker2

AbstractA model-driven approach has not only changed the way of software development and maintained but also
the way they are tested. Commonly research of testing in model-driven systems has focused on checking the models
used to drive code generation, and testing the transformation that are used. Web applications have more complex and
critical in many fields. In order to promise their quality, a great demand for organized methodologies of Web
application testing is developing. We use the features in UML 2.0 use case diagram including conditions, iterations,
asynchronous messages and all other qualifications. We focus testing on sequences of messages among objects of use
case scenarios. In this paper testing strategy derives test cases using full predicate coverage criteria. Test case models
are created based-on the web application model. In this, methodology of Model-Driven Testing (MDT) for Web
application is presented. Model is the core of this method. Test deployment model and test control model are designed
to define the environment and process of test execution. Our proposed test case generation technique can be used for
integration and system testing.
Keywords Model-driven, web engineering, UML, Model-Based,Testing,
I. INTRODUCTION
Web Applications (WA) have become the essential business for many companies market areas. Therefore, more than 300
commercial or open source WA testing tools are developed. Model Driven Testing (MDT) is a capable approach for the
picturing and automation of software testing. It offers a suite of pictured means to define, execute and analyse testing, and
reduces the testing time by reusing common test functions. Furthermore, it separates the testing logic from the test
implementation. This enables developers to focus on designing good tests specific to applications relying on the tool set's
test execution environment to solve problems related test execution [1].The web service technology also proposes a high
level of abstraction, which replaces the current models of applications by a more modular and flexible architecture, thus
allowing their composition and their integration [2]. It should be noted in passing that the concept of web services
basically expresses around the following three components:
SOAP (Simple Object Access Protocol) provides the definition of an XML file, which can be used for exchanging
structured and typed information between service peers in a decentralized distributed environment [3].
WSDL (Web Services Description Language) is an XML format for describing network services as a set of endpoints
operating on messages containing either document-oriented or procedure-oriented information. The operations and
messages are described abstractly, and then bound to concrete network protocols and message formats to define an
endpoint [4].
UDDI (Universal Description, Discovery and Integration) focuses on the definition of a set of services supporting the
description and discovery of the Web services available for clients, and the
technical interfaces, which may be used to access those services [5].
Kath et al [6] propose an infrastructure to implement the MDA approach and present experiments Web services. In their
approach, they present a metamodel for Web services (WSDL). A method that uses UML Activity models to design web
service arrangements, and OMG's Model Driven Architecture (MDA) to generate executable specifications in different
composition languages. The method uses standard UML constructs with a minimal set of extensions for web services. The
most important step of the method is the transformation of WSDL descriptions to UML [7]. This information is used to
complete the composition models. Another key aspect of the method is its independence of the web service composition
language. The user can thus select his preferred composition language and execution engine for realizing the composite
web service Web applications are modeled using hierarchical profile use-case diagrams called UCTMs (Use Case
Transition Models) with the concept of LC (Logical Component). Based on proposed UCTM, a system level testing
method is implemented through transferring the textual description of use cases into CDDs (Constraint Directed
Diagrams). The CSC (Constraint Scenario Coverage) criterion is proposed. Test cases generated from CDD can satisfy
CSC criterion and avoid the problem of combinatorial explosion [8].
Nowadays, it becomes usual to express the functional requirements of Web applications through UML use-case diagrams
and text templates [9]. Researches expose that use cases and text templates are adequate for Web applications. Use cases
2014, Lord Krishna College of Engineering Ghaziabad, India

Page | 125

Vivek et al., International Journal of Advanced Research in Computer Science and Software Engineering 4(2),
February- 2014, pp. 125-129
are believed to be a good basis for system testing [10]. Developers can begin creating test cases as soon as use cases are
available, well before any code is written [11]. It is possible and valuable for Web applications to generate test cases from
use cases [9].
II. RELATED WORK
The related work is split into three subsections. Section 3 examines how other research has approached the reuse of
development models for Model-Based Testing (MBT). Section 4 discusses modeling of web applications using modelbased approaches. Section 5 briefly discusses Test case generation plans.
Nebut et al [12] proposed an approach for automatic generation of test cases from use cases with contracts and test
scenarios. They added contracts for each use case and constructed a simulation model called UCTS (Use Case Transition
System). Different from our UCTM, use cases of the UCTS represent states of the system. Transition labeled with an
instantiated use case between the use cases represents the execution of an instantiated use case. In our proposed UCTM, a
use case corresponds to a LC (Logical Component). The transitions between the use cases mean the communication of
LCs.
Ibrahim et al [13] discussed an automatic tool for generating test cases using use cases. They used sequence diagrams and
flow of events as added information for consistency and validity of the generated test cases, but their approach lacks the
detailed and operational description about how to generate test cases.
III. METHODOLOGY
The basis PIM in Domain Engineering (PIMD) models are the UML Use Case diagrams with variability and the
Variability Model, and are changed using transformation language (QVT) in the following models:
Test Architecture: A class diagram where the test model architecture is described, which uses the extension of the
UML-TP for SPL.
Test case behaviour: A sequence diagram describing the test case, which uses the extension for UML Interactions
defined and the extension of the UML-TP for SPL.
Variability Model: The same model used in PIMD is augmented with traceability to the test models.
There are several aspects of a model-driven testing technique that can be studied. In our study, we focus on the following
criteria:
Modeling Language: Yuan et al. present an automatic approach in [14] to generate test cases of a given
business process of a web service. BPEL (Business Process Execution Language) [14] and UML activity
diagrams are used to define the Process under Test (PUT).
Automatic Test Generation: The use case diagrams provide for identifying the usage scenarios of the system.
We use abstract use cases to represent related collections of use cases and concrete use cases as the basis for test
generation.
Testing Target: Although the surveyed studies focus on generating test cases from models, the target testing
artifact varies from one approach to another - Some authors target the design models, whereas others target only
the implementation.
Tool Support: Mingsong et al. implemented their approach into a tool prototype called AGTCG [15]. Its
graphical interface allows the users to interactively construct, edit, and analyze activity diagram [15]. The tool
can instrument Java programs according to the given activity diagrams, and use randomly generated test cases to
run the instrumented Java program, and gather the corresponding program execution traces.

Figure 1 Model Driven Testing Architecture


2014, Lord Krishna College of Engineering Ghaziabad, India

Page | 126

Vivek et al., International Journal of Advanced Research in Computer Science and Software Engineering 4(2),
February- 2014, pp. 125-129
IV. AN APPROACH TO MODELING WEB APPLICATIONS
Use case is used to specify system functional requirements. According to the RUP, a use case fully describes a sequence
of actions performed by a system to provide an observable result of value to a person or another. System using the
product under development.". Use cases can be visually described in use-case diagrams. Use case is a sequence of actions
that the system offers to its actors. The primary relationships between use cases are include, extend and simplification.
In this section, we propose an approach to modelling Web applications based on use cases from users perspective.
A. Use case-based Web applications modelling
Web applications are very complicated. In order to model Web applications, we use the concept of LC (Logical
Component) [16]. From the users viewpoint of a Web application, we divide the Web application into components
according to the functions, and regard the Web application as a black-box. These components are called LCs. We divide
the Web application into several LCs and a LC can be a set of LCs.
At the highest level, LCs are abstractions which implement system functions from the users viewpoint. At the bottom
level, LCs may be individual Web pages and software modules that represent single major functions themselves [17].
Using this way, LCs can be eventually mapped to actual physical components.
The concept of Logic Component is very similar to use case. Actually, each use case is a complete series of events,
described from the point of view of the actor [18]. So we model Web application with hierarchical profile use-case
diagrams based on the concept of LC called UCTM (Use Case Transition Models). In UCTM, a LC corresponds to a use
case. The UCTM is modelled in four steps:
1) From the users viewpoint, we divide the Web application into several big LCs according to the logic functions of
actors and each LC completes the total logic function of the actor.
2) Divide all the LCs of top UCTM into a set of cooperating LCs according to function of actors. We cover the
relationship between use cases with stereotype <<communicate>> which means the communication of LCs. We call it
Transition of LCs /Use cases.
3) Repeat step 2) until the LCs represented by use cases of lower-layer UCTM can be mapped into the authentic
physical components. Cross all the use cases in hierarchical UCTM from bottom to up and add the textual description for
each use case, including actor, preconditions, post circumstances, the base flow of events and the alternate flows of events.
In this paper, we consider a Web application as a black-box, emphasizing on the transition of LCs. In order to simplify
the generation of test cases, we assume that each diagram only has one initial endpoint use case and one terminal endpoint
use case. Endpoint use case is the use case that makes the system start or terminate operation. If the functions of the
system lack such a use case, then we introduce a dummy endpoint use case. The links between dummy endpoint use case
and use cases are represented by dotted line. Depending on the size and complexity of the Web application, the number of
decomposition levels may be large or small [19].
V. GENERATING TEST CASES
In software testing, testing objectives must be defined first. A testing objective can be considered a set of testing
requirements, and different testing objectives have different sets of requirements. Test requirements are specific things
that must be satisfied or covered during testing. In this
paper, our testing objective is based on use case scenarios.
Use case scenarios are a finite set of paths that the system users traverse when they perform the functionality specified in
the use case.
To generate the test case behavior from the Use case diagram (Interaction), the system must be considered as a black box
and the stimulus from the actor to the system must be simulated and vice versa. The test case generated according to this
pseudo code
1. For each use case in Design Model (DM)
2. Create a Test Context in Test Model (TM)
3. Create Data Pool in TM
4. For each interaction in DM
5. Create a test Case in TM
6. For each Actor in DM
7. Create a Test Component in TM
8. End For
9. For each message m from Actor to Lifeline in DM
10. Create SUT for the Lifeline in TM
11. Create operation Data Selector in Data Pool in TM
12. Call Data Selector from Actor to Data Pool in TM
13. Call m from Actor to SUT in TM
14. Create Validation Action in TM
15. End For
16. For each Combined Fragment in DM
17. If applied Stereotype(Variation Point) in DM
18. Create Combined Fragment in TM
2014, Lord Krishna College of Engineering Ghaziabad, India

Page | 127

Vivek et al., International Journal of Advanced Research in Computer Science and Software Engineering 4(2),
February- 2014, pp. 125-129
19. Apply Stereotype(Variation Point) in TM
20. For each Variation Point or Variant in VM associated with the Combined Fragment in DM
21. Create association stereotyped <<realizedBy>> in VM with the Combined Fragment in TM
22. End For
23. For each Interaction Operand in DM
24. Create Interaction Operand in TM
25. Apply steps 9 to 15 for each message in the Interaction Operand
26. End For
27. End For
When all use cases test scenarios are available, we can compose them into system test cases according to the use case
sequences in hierarchical UCTM. There are also two synthesis methods: top-down and bottom-up. The bottom-up
creation performs in three steps:
1) Generate test scenarios for the lowest UCTM of all use cases, excluding the dummy terminal endpoint use cases. The
use cases/LCs in the lowest UCTM can be mapped into the actual physical components or Web pages. Synthesize test
scenarios in the same UCTM according to the use case sequences.
2) Generate test scenarios for all use cases in the lower UCTM. Few syntheses of test scenarios in the lowest UCTM are
test scenarios in the lower UCTM.
3) Repeat step 2 until the top UCTM. The last synthesis test scenarios are the system test scenarios
VI. CONCLUSIONS AND FUTURE WORK
In this paper, we discuss how to model and test Web applications based on use cases. We model the Web application
using ordered profile use-case diagrams called UCTM. The UCTM represents the classified structure of Web application
and the textual description for use cases shows the functionality of Web application. Based on the UCTM, we propose a
method of testing Web applications. We described our knowledge of using use case based model based testing. We have
found it to be useful in actual projects even when applied only by the testing group. Testing Web applications based on
use cases can start testing as soon as the systems necessities are available. This will minimize the errors and cost of
fixing the errors. Gross[19] has a section in his book on model based testing and covers using various types of models
including use case models and references the chance of using development path coverage.
Our future work is to increase the proposed approach by using recommended interaction diagrams to express dynamic
behaviours of each use case in order to generate test cases more automatically.
REFERENCES
[1]
Model Driven Testing Tools Whitepaper. IBM Haifa Research Laboratory. 2003-07-31
http://www.haifa.ibm.com /projects/verification/mdt/papers/MDTWhitePaper.pdf.
[2]
An MDA-Based Approach for WS Composition Using UML Scenarios, Ayoub SABRAOUI, Abdeslam
ENNOUAARY, Ismail KHRISS UQAR, Mohammed ELKOUTBI. 2012 IEEE.
[3]
W3C Working Draft, Soap Version 1.2 Part0: Primer, http://w3.org/TR/2001/WD-soap12-part0-20011217,
2001.
[4]
W3C Note, Web Services Description Language (WSDL) 1.1, http://www.w3.org/TR/wsdl, 2001.
[5]
UDDI Spec Technical Committee Draft, UDDI Version 3.0.2 http://www.oasis-open.org/committees/uddispec/
doc/spec/v3/uddi-v3.0.2-20041019.htm, 2004.
[6]
O. Kath, A. Blazarenas, M. Born, K.-P. Eckert, M. Funa-bashi, and C. Hirai, Towards Executable Models:
Transforming EDOC Behavior Models to CORBA and BPEL, Proceedings of the Enterprise Distributed Object
Computing Conference, Eighth IEEE International (EDOC'04), Washington, DC, USA, 2004, pp. 267274.
[7]
D. Skogan, R. Grnmo, and I. Solheim, Web Service Composition in UML, Eighth IEEE International
Enterprise Distributed Object Computing Conference, California, 20-24 September 2004, pp.47-57.
[8]
Liping Li1, 2Huaikou Miao1Liping Li1, 2Huaikou Miao1, An Approach to Modeling and Testing Web
Applications Based on Use Cases, 2008 International Symposium on Information Science and Engieering
[9]
Gutierez J., Escalona M. J. and Torres M. M.: An Approach to Generate Test Cases from Use Cases. Proceedings
of the 6th International Conference on Web Engineering. pp. 113-114 (2006).
[10] Nebut C, Fleurey F, Traon Y. L., Jezequel J. M.: Automatic Test Generation: A Use Case Driven Approach.
IEEE Transactions on Software Engineeering. Vol. 32, No. 3, pp. 140-155 (2006)
[11] Heumann J.: Generating Test Cases from Use Cases. Rational Software, IBM (2001).
[12] Nebut C, Fleurey F, Traon Y. L., Jezequel J. M.: Automatic Test Generation: A Use Case Driven Approach.
IEEE Transactions on Software Engineeering. Vol. 32, No. 3, pp. 140-155 (2006).
[13] Rosziati I., Mohd Z. S., and Noraini I., et al.: An Automatic Tool for Generating Test Cases from the System's
Requirements, IEEE 7th International Conference on Computer and Information Technology, pp. 861-866
(2007).
[14] Q. Yuan, J. Wu, C. Liu, and L. Zhang, A model driven approach toward business process test case generation,
In Proc. of the 10th International Symposium on Web Site Evolution (WSE), pp. 4144, 2008.

2014, Lord Krishna College of Engineering Ghaziabad, India

Page | 128

[15]
[16]

[17]
[18]
[19]
[20]

Vivek et al., International Journal of Advanced Research in Computer Science and Software Engineering 4(2),
February- 2014, pp. 125-129
C. Mingsong, Q. Xiaokang, and L. Xuandong, Automatic Test Case Generation for UML Activity Diagrams, In
Proc. of the International Workshop on Automation of software test, pp. 2-8, 2006.
Huaikou Miao, Shengbo Chen, Huanzhou Liu, Zhongsheng Qian.: An Approach to Generating Test Cases for
Testing Component-based Web Applications. Workshop on Intelligent Information Technology Application
(IITA 2007), pp. 264-269 (2007).
Anneliese A. Andrews, Jeff Offutt, Roger T. Alexander.: Testing Web Applications by Modeling with FSMs.
Software and System Modeling 4(3): 326-345 (2005).
Ivar Jacobson. Object-Oriented Software Engineering. Addison Wesley Professional (1992)
Gross H. Component-Based Software Testing with UML, Springer Berlin Heidelberg New York 1998
M. Juric, P. Sarang, B. Mathew. Business Process Execution Language for Web Services. Packt Publishing, 2004.

2014, Lord Krishna College of Engineering Ghaziabad, India

Page | 129

You might also like