Nirma Paper

download Nirma Paper

of 4

Transcript of Nirma Paper

  • 8/8/2019 Nirma Paper

    1/4

    ABSTRACTSoftware testing is an investigationconducted to provide stakeholders with information aboutthe quality of the product or service under test. An Event-flow model is built from event templates. Event-flow model is

    represented as Event-flow graph. Deep breath-first search isthen applied on Event-flow graph to identify the test scenarios.

    The proposed technique can be very effective especially for realtime systems where lots of events are taking place. The paperuses Online testing Website as case study.

    Keywords- Events, Event Flow Model, Testing, Event basedcoverage, Software engineering.

    I. INTRODUCTION

    The IEE definition of testing is the process of exercising orevaluating a system or system component by manual orautomated means to verify that it satisfies specifiedrequirements to identify differences between expected andactual results.[16]. Software testing is one of the mostimportant activities in software development life cycle(SDLC). In testing, the software is executed with input data,or test cases, and the output data is observed. As thecomplexity and size of software grows, the time and effortrequired to do sufficient testing grows. Manual testing is time

    consuming, labor-intensive and error prone. Therefore it ispressing to automate the testing effort. The testing effort can be divided into three parts: test case generation, testexecution, and test evaluation. An important step towards itis, Model-based testing (MBT). MBT is a process ofgenerating test cases and evaluation of test results basedon design and analysis models. MBT lies in betweenspecification and code based testing, hence is referred toas the gray box testing approach. A wide range ofmodels like UML, SDL, Z, state diagrams, data flowdiagrams, control flow diagrams, etc have been used inModel based testing [1-3]. The idea of model-basedtesting was originally derived from hardware testing,mainly in the telecommunications and avionics industries

    and has been used in many practical applications [4, 5].A vast majority of the work examining MBT of object-oriented systems focuses on the use of either class orstate diagrams. The authors in [6] propose an approach togenerate test cases directly from UML activity diagramusing gray-box method. Work in [4] proposes a similarmethodology but convert the activity diagram into anactivity graph and eventually generating test cases fromthe activity graph. In [6], authors discuss a method thatis based on an I/O explicit Activity Diagram (IOAD)

    Niclone 2010

    model. In [7], authors discuss methodology for test casegeneration based on UML sequence diagrams. The methodin [8] generates test cases based on control flow inUML state diagrams. Similarly, work in [9], uses thecontrol and data flow logic available in the UML statediagram to generate test data. Each of the approachesdescribed above uses an intermediate form to gather theinformation or traverse the states/activities of the model.In the above mentioned approaches, different intermediateforms are used like an activity graph, an Input/Outputexplicit Activity Diagram, message dependency graphs

    and extended Finite State Machine.But these approaches have two major constraints, firstly it

    is more logical to use events rather than UML togenerate a model of SUT for event-based systems andsecondly that all the above approaches work only after theanalysis of SUT is done and the UML models are created. So

    prior to testing using these approaches, UML models should be built. Thus, this paper removes this bottleneck and presents a model-based testing approach for event-basedsystems using Events as starting point. Unlike the aboveapproaches, the proposed approach is independent of UMLmodels and eliminates the necessity of creating UMLmodels prior to MBT. In this approach, Events taking place

    in the SUT are documented in the proposed Event templates.An Event-flow model is made from events templates. Event-flow model is represented as Event-flow graph. Deep breath-first search is then applied on Event-flow graph to identifythe test scenarios.

    The organization of paper is as follows: Section 2 explainsbout events, their formalization, modeling event interactionsand the generation of the proposed Event-flow model.Section 3 explains application of event-flow model togenerate test scenarios. Section 4 describes the conclusionand the future work.

    II.PROPOSED EVENT-FLOW MODEL

    In this section, a formal definition of the proposed Event-Flow model is discussed. Event-flow model is constructed

    by first documenting and modeling events as EventTemplates. Specific order in which events are executed in asystem constitutes an event-flow. The event-flow in suchsystems can also form the basis for model based testing.From the event templates, event-flow interdependenciesare analyzed and modeled using event operators. AnOnline testing Website [10] is used to illustrate the entire

    process of model based testing.

    An Event based Approach in Software testing Case Study Online Testing

    Nitin Mishra

    Saumya Mishra

    1

  • 8/8/2019 Nirma Paper

    2/4

    A. MODELLING EVENTS

    Event-flow model is the basis of event-based generation oftest scenarios. The basis of Event-Flow model has come fromthe ent-based OOA work described in [11, 12]. In the abovework, Elementary events are extracted and documented in anEvent Templates. The important components of an EventTemplate are Event ID, Event name, Event description,

    Initiator, Facilitator, Affecter, Causative events, TriggerVector, Change-event, Timestamp, Inputs/Outputs and Count[12].

    Event ID: It is a unique alphanumeric value given to eachevent identified either directly or indirectly from therequirements. Event Name: It is a simple name as extractedfrom the requirements given in the natural language. EventDescription: It is a sentence from the requirements thatdescribes the event identified in Subject-Verb-Object (SVO)

    pattern. . (e.g. customer places an order) Initiator,Facilitator or Affecter: Initiator starts an event. Facilitatorfacilitates in the occurrence of an event and Affecter getsaffected as a result of execution of an event. Causative

    Events: Causative events of an event are those events thatare reasons behind occurrence of that event. Trigger Vector:It represents a set of events that are triggered as a result ofoccurrence of an event. For example Customer registerwith TA software, triggers an event Travel agency

    provides user id and password to Customer. An event cantrigger either a single event, set of events that can beexecuted independently or in parallel. Change-event (statechanges): Every event triggered may initiate algorithmicallysimple or complex methods in an object which model the

    behavioral changes in the object. These changes aredescribed in Event Template as Change-event. Timestamp:Events occur at some point of time. Timestamp records timewhen a particular event has happened or likely to happen in

    the system. Inputs/Outputs: Inputs reflect the data neededfor change event whereas output is the data produced fromthe change event. Input / Output can contribute to describeattributes for an object.

    Unlike the above work, this paper uses Event Templates forMBT. Causative events and Trigger Vector components ofEvent Templates are used for generating Event-flow modelfrom which test scenarios are generated. An event happens ina system due to occurrence of some events called Causativeevents. Once an event has occurred in a system, it can triggerthe execution of some other events. Such events constitutetheTrigger Vector of an event. Specific order in which eventsare

    executed in a system constitutes an event-flow. Event-flowmodel represents events and event interactions. Event-flowmodel represents all possible sequences of events that can beexecuted in a system. The event-flow is the basis for model

    based testing. The next sub-section describes the possibilitiesof modeling event flow using event operators.

    B. MODELING EVENT INTERACTIONS USING EVENTOPERATORSTwo or more events are related with each other using eventoperators. Event operators are expressed as Booleanoperators

    like and, or, xor, and in terms of join and split operators.These relationships among events are described as event-flowinterdependency. Event Flow interdependency is capturedfrom the Causative events and Trigger vector section ofEventTemplates. Thus, these two are used for modeling eventinteractions using event operators. Different possible eventinteractions using event operators are described in Fig 1.

    (a)Causative events based event interactions: Causativeevents can be a single event or a set of events related usingEvent-join operators. We have defined three types of Event

    join operators: (i) event-and join (i.e. join) (ii) event-or join(iii) event-xor join. Event following event-and join, starts itsexecution when all the causative events are executed (Fig1(f)). So, it the most complex event interaction. Eventfollowing event-or join, starts its execution when any one ormore causative events are executed (Fig 1(g)). Eventfollowing event-xor join, starts its execution when exactlyone causative event is executed (Fig 1(h))(b)Trigger Vector events based event interactions: An eventcan trigger either a single event or a set of events that can beexecuted independently or in parallel. Single event triggeredcan also be a non-event event. Non-event event is triggeredthrough Event-not operator (Fig 1(b)). It indicatesconcoccurrence (negation) of an event as described in [13].The manner in which events in Trigger vector are executed isdetermined on basis of event-split operators. We havedefinedthree types of event-split operators: (i) event-or split (ii)event- and- split (iii) event-xor split. Event-and split indicatethat all events have to be triggered in parallel (Fig 1(e)). So,it the most complex event interaction. Event-or split indicatethat either none, one or more than one events can betriggered (Fig 1(d)). Event-xor split indicates any one eventcan be triggered (Fig 1(c)). AND-split activities are

    represented with a fork, OR split with an or, and XOR-split activities with a xor in our event-flow model.

    B. Event Flow Graph as Event-Flow Model

    Event-flow model represents events and event interactions.In much the same way as a control-flow model represents all

    possible execution paths in a program [14], and a data-flowmodel represents all possible definitions and uses of amemory location [15], the event-flow model represents all

    possible sequences of events that can be executed in asystem. The event flow model contains two parts. The first

    part refers to events that are causes in terms of causativeevents, and the second part refers to effects, i.e. the events

    that are triggered after an event has been executed. Both ofthese parts play an important role constructing Event-flowModel.

    Our major objective is to generate test scenarios based onevents and their interdependencies. In any system, especiallyin Web based systems, there is plethora of events happeningin background, so event interdependency of all the eventshappening in the system is represented collectively usingEvent-flow Model. Our Event-Flow Model is represented asEvent-flow Graph. Event-flow graph represents events, theirinteraction in terms of causative events and trigger vector. It

    2

  • 8/8/2019 Nirma Paper

    3/4

    has one event designated as start event and anotherdesignated as exit event. Start event indicates theinitialization of the system i.e. once a system is turned on allother events can get executed. Exit event indicates thecompletion of functionality. In Event-flow graph, events arerepresented using circles, and dependencies betweenactivitiesare represented using arrows. Formally, Event-flow Graph isdefined as:

    An EFG is a 3-tuple where E is a nonempty finite set of vertices representing all theevents in a system with two events designated as Start (S)and Exit (E) to indicate the system startup and exit events. T is a nonempty finite set of transitions. T E * E . We saythat event ei causes event ej iff ei is a causative event of ej.Similarly event ei triggers event ej iff event ei is triggersevent of ej. An edge (vx,vy) E if the events vx and vy areinterdependent either due to causes or triggers relationship.C is a finite set of vertices representing connector nodes{OR , XOR, FORK, JOIN, NOT}

    A connector node with more than one outgoing transitioncan be classified as an Event-AND split (fork), Event-ORsplit, Event-XOR split. A connector node with more than oneincoming transitions can be classified as an AND-join (orsimply join), OR-join, or XOR-join. Only OR and XOR-splitsand joins introduce non-determinism. On the other hand,AND splits and joins are deterministic.

    The construction of the event-flow graphs is based on theidentification of causative events and trigger vector of allevent templates and, hence, the identification of causes andtriggers relationships among events is essential. A set ofcauses and triggers for each event is analyzed. These sets are

    then used to create the edges of the event-flow graph. Event-flow graph of Case study is shown in Fig 2.

    III. GENERATING TESTING SCENARIOS FROMEVENT-FLOW MODEL

    This section explains the concept of event sequence and testscenario and gives the process of generating testing scenariosfrom events.

    A. Generation of Testing Scenarios

    In the exiting MBT techniques, discussed in section 1, testcases generated from models are in the form of sequences of

    test scenarios. These test scenarios specify a high-level testcase rather than the exact data to be input to the system. Incase of Event-flow model, test scenario is the sequence inwhich specific events must be executed to test the system.Such paths formed by event sequences are called as eventtransition paths. In our approach, the test coverage criteria isevent based i.e. the objective of generating test scenario is toassure that every event gets executed at least once. Our aimis not to find all the possible paths from the Event-flow graphin which events are executed. Event-flow graph is traversedstarting from start event and then using one of the outgoingedges from event vertex to get the next adjacent event. If no

    new event appears on the path, that path is not considered.This process is continued to generate many test scenarios.We have used deep breath first technique to automatetraversal. The order in which the events are covered willyield different types of test scenarios. Every Event sequenceretrieved is defined as follows:Event sequence: A test sequence, denoted by t, is a finitesequence of events,< Se, 1, 2, . . . n, Ee>

    where i, i+1 E, 1

  • 8/8/2019 Nirma Paper

    4/4

    REFERENCES

    [1] ABDURAZIK, AYNUR. AND OFFUTT, JEFF. USING UML COLLABORATIONDIAGRAMSFORSTATIC CHECKINGAND TEST GENERATION, IN PROCEEDINGSOFTHE3RD INTERNATIONAL CONFERENCEON UNIFIED MODELING LANGUAGE, UK, 383-395, OCTOBER2000.

    [2] HONG, HYOUNG SEOK., KIM, YOUNG GON., CHA, SUNG DEOK., BAE,DOOHWAN., AND URAL, HASAN. A TEST SEQUENCE SELECTION METHOD FORSTATECHARTS, THE JOURNAL OF SOFTWARE TESTING, VERIFICATION ANDRELIABILITY, 10(4):203227, DECEMBER2000. 227, DECEMBER2000.

    [3] SKELTON, G., STEENKAMP, A., AND BURGE, C. UTILIZING UML DIAGRAMSFORINTEGRATION TESTING OF OBJECT-ORIENTED SOFTWARE. SOFTWARE QUALITYPROFESSIONAL, JUNE 2000.

    [4] GRONAU ,ILAN. , HARTMAN,ALAN. , KIRSHIN, ANDREI., NAGIN, KENNETH., ANDOLVOVSKY ,SERGEY. A METHODOLOGY AND ARCHITECTURE FOR AUTOMATEDSOFTWARE TESTING. HAIFA TECHNICAL REPORT, IBM R ESEARCHLABORATORY,MATAM ADVANCED TECHNOLOGY CENTER, HAIFA 31905, ISRAEL,2000

    [5] ROSARIA, S. AND ROBINSON, H. APPLYING MODELS IN YOUR TESTING PROCESS,INFORMATIONAND SOFTWARE TECHNOLOGY, 42(12):815824, DECEMBER2000.

    [6] LINZHANG, WANG., JIESONG, YUAN., XIAOFENG ,YU., JUN , HU., XUANDONG, LI.AND GUOLIANG, ZHENG. GENERATING TEST CASES FROM UML ACTIVITYDIAGRAM BASED ON GRAY-BOX METHOD. IN PROCEEDINGS OF THE 11TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC), IEEE COMPUTERSOCIETY, 2004

    [7] SAMUEL, PHILIP. AND MALL, RAJIB. A NOVEL TEST CASE DESIGNTECHNIQUEUSING DYNAMIC SLICING OF UML SEQUENCE DIAGRAMS. E-

    INFORMATICA SOFTWARE ENGINEERING JOURNAL, VOLUME 2, ISSUE 1, 2008.[8] KIM, Y.G., HONG, H.S., CHO, S.M., BAE, D.H. AND CHA, S.D. TEST CASES

    GENERATIONFROM UML STATE DIAGRAM. IEE PROCEEDINGS SOFTWARE, VOL.146, NO. 4, PP. 187-92, AUG. 1999.

    [9] SAMUEL, P., MALL, R. AND BOTHRA, A.K. AUTOMATICTESTCASEGENERATIONUSINGUNIFIEDMODELLINGLANGUAGE (UML) STATEDIAGRAMS. IET SOFTW.,VOL.2, NO. 2, PP. 7993, 2008.

    [10] WWW.TYROASIA.COM. ANONLINEASSIGNMENT WEBSITE.[11] SINGH, K.,SANDEEP, SABHARWAL, SANGEETA, AND GUPTA, J.P. EVENT PATTERNS

    FOR OBJECT ORIENTED REQUIREMENT ANALYSIS. IN PROCEEDINGS OF IASTEDINTERNATIONAL CONFERENCES ON ADVANCES IN COMPUTER SCIENCE ANDTECHNOLOGY, APRIL 2 - 4 , 2008, PAGE 115-120.

    [12] SINGH, K.,SANDEEP, SABHARWAL, SANGEETA, AND GUPTA, J.P.,"EVENTS-ANALTERNATIVE TO USE CASE AS STARTING POINT IN OBJECT-ORIENTED ANALYSIS",ICETET 2009: 1004-1010..

    [13] WARD, PAUL T. AND MELLOR, STEPHEN J. STRUCTURED DEVELOPMENTFORREAL-TIME SYSTEMS: VOLUME 2, ESSENTIAL MODELING TECHNIQUES. PRENTICE-HALL(YOURDON PRESS). ISBN 0138547874.(ISBN 978-0138547875) 2009 .

    [14] ALLEN, FE. CONTROL FLOW ANALYSIS. PROCEEDINGS OF A SYMPOSIUM ONCOMPILEROPTIMIZATION. ACM PRESS: NEW YORK, 1970; 119.

    [15] R OSEN, B.K. DATAFLOWANALYSISFORPROCEDURALLANGUAGES. JOURNALOFTHEACM 1979; 26(2):322344.

    [16] R. HELM, I. M. HOLLAND, AND D.GANGOPADHYAY. CONTRACTS: SPECIFYINGBEHAVIORALCOMPOSITIONS INOBJECT-ORIENTEDSYSTEMS. IN PROCEEDINGSOFTHE5TH ANNUAL CONFERENCE ON OBJECT-ORIENTED PROGRAMMING SYSTEMS,LANGUAGES, AND APPLICATIONS (OOPSLA 90), ACM SIGPLAN NOTICES,25(10):169180, 1990.

    4

    http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/http://www.tyroasia.com/