
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print) IJCST VOL . 2, Iss UE 4, Oct . - DE C . 2011 A Systematic Approach for Software Test Cases Generation using Gray Box Testing with UML Activity Diagrams 1Suppandeep Sandhu, 2Amardeep Singh 1,2Dept, of CSE, Swami Vivekanand Institute of Engineering & Technology, Banur, India Abstract A. Development time is reduced. As less time is required to buy The trend of software engineering is shifting towards Component- a component than to design, code, test, debug and document Based Software Engineering (CBSE) from the traditional it. methods of software engineering. Everybody wants the product B. Flexibility is increased, as there are more choices of to be ready quickly. This support is provided by Component- components from which to choose a component that meet Based Software engineering. Since the system is to be build the requirements. with the ready to use components or prefabricated components C. Process risk is reduced. If a component exists, there is less the testing of these components is of utmost importance. uncertainty in cost associated with its reuse as compared with Software testing is an important verification activity in Software new development. Development Life Cycle which requires resources and man D. Quality is enhanced. As design and implementation faults hours. It consist of the dynamic verification of the behavior of a are discovered and eliminated in the initial use, thus increasing program on a finite set of the test cases, suitably selected from the quality. the usually infinite executions domain, against the specified E. Low maintenance is there. Easy replacement of obsolete expected behavior. The testing effort can be divided into test components with new enhanced ones. case generation, test execution, test evaluation. To reduce the Test generation techniques can be white-box or black box. cost of testing process, efficient test case generation technique White-box testing techniques are used for unit testing and is required. So test case generation is an important part of for the cases where the size of the code is small. For larger software testing. As manual testing is error prone and time and complex codes white-box testing is not inappropriate, and consuming activity therefore as a part of our research work we black box testing techniques can be more useful. Black box have tried to automate manual test generation activity. We have testing usually requires generating test cases on the basis of a adopted two ways by which automated test data is generated, model which can represents the system, called the test model. namely test case generation from UML activity diagram based Model based representation enhances the understanding of on gray box method and automated test case generation using the system. It helps in making the test-generation process PETA Tool. These methods have been implemented and their faster. The Unified Modeling Language is a very good tool for results have been verified. modeling of large and complex systems. It is widely used to improve the testing. Keywords Activity diagram, Unit Testing, Peta tool, Eclipse. II. Objective In component-based software engineering, the major challenge I. Introduction is that different components can execute simultaneously. Mainly As there is an ever-growing need for techniques that could we will focus on model-based methods. For large systems, black improve the software development process and to reduce the box testing is used normally, but some of techniques mentioned time to market and improve the quality of delivered software in the report use the hybrid of white box and black box testing. products, a more organized and focus approach to reuse called We will try to overcome the shortcomings of the Manual test component based software engineering has emerged. In the data generation by following objectives: traditional software engineering process, the typical activities A. To identify the problem associated with manual test data involved in building a system are specification, implementation, generation testing and maintenance. Component-Based Software B. Automate the manual test case generation process as much Engineering (CBSE) not only focuses on system specification as we can. and development, but also requires additional consideration for overall system context, individual components properties III. Background Study and component acquisition and integration process [1] . Many different types of testing techniques and strategies have Components are the fundamental in the building of been studied and developed, however all of them share the same component based software system. Brown and WallnaTu final objective that is to increase the confidence in the correct describe a component as “a nontrivial, nearly independent, functioning of system when it will released. Testing searches and replaceable part of a system that fulfils a clear function for discrepancy among expected and observed behavior of in the context of a well-defined architecture” [2]. Component the system. This process involves executing the system on a Based Software development as the process for building set of inputs and determining if the actual behavior of system a system which consists of the searching and identifying corresponds to the expected behavior. These inputs to the components based on preliminary assessment; selecting system are known as test cases & a collection of test cases components based on stakeholder requirements; integrating is referred to as test set/test suite. Software organizations and assembling the selected components; and updating the spend considerable portion of their budget in testing related system as components evolve over time with newer versions. activities. The customer before acceptance will validate a well- With the help of component based software development we tested software system. The effectiveness of this verification have following benefits: and validation process depends upon the number of errors found and rectified before releasing the system. This in turn www.ijcst.com INTERNAT I ONAL JOURNAL OF COMPUTER Sci EN C E AND TE C HNOLOGY 521 IJCST VOL . 2, Iss UE 4, Oct . - DE C . 2011 ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print) depends upon the quality of test cases generated. According using following approach: to Ron Patton (2001, p. 65), “Test cases are the specific inputs 1. Draw the Activity diagram representing the component. that you’ll try and the procedures that you’ll follow when you 2. Input file is created corresponding the Activity Diagram which test the software [3].” is in the form [initial state, transition ,next state] In order to reduce the high cost of manual software testing and at 3. Now store the Input File into appropriate data structure like the same time to increase the reliability of the testing processes we use Hash Map. researchers and practitioners have tried to automate it. One 4. Now create the final state transition table, add new states of the most important components in a testing environment is to handle fork join. an automatic test data generator a system that automatically 5. Finally test scenarios are generated generates test data for a given program [9]. V. Experiment Study IV. Proposed Work A. Automated Generation of Test Cases from UML Activity A. Automatic generation of test cases using PETA tool Diagram based on Gray Box Method PETA is Java/eclipse based platform for automated software Gray box method combines the white box method and the black testing. Under this various components of component based box method. It extends the logical coverage criteria of white box software systems like client/server and Service-Oriented- method and finds all the possible paths from the design model, Architectures (SOA) may be simulated as well as tested in which describes the expected behavior of an operation. Then it isolation and in their supposed interaction. For the generation generates test cases, which can satisfy the path conditions by of test cases: black box method. We define the basic path based coverage • Firstly we should have to apply settings under this tools. criteria of gray box method as the test Completion criteria. When • Class diagrams are generated. we traverse an activity diagram from the initial activity state • Finally test cases are generated. to the final activity state by DFS (Depth First Search Method), STEPS: we restrict that the loops be executed at most one time, and all action States and transitions be covered. Thus we can get 1. Apply settings all basic paths. (i). Creating the project. All information needed to define the tests and their test Execution organized in a PETA project that 1. Test Object contains the different PETA documents. These documents We have a tax calculator whose inputs are Employee code, are test case files, test suite files, template files, At least one Medical Claim amount, investment claim amount, and configuration file. salary. Corresponding to that output is tax that is paid by the (ii). Setting up Configuration (Client & Server) While the setups employee. are only needed the test case execution, the definition of the actors is required during test development. Therefore, before 2. Experimental Setup the creation of test cases, a PETA Configuration has to be (i). Draw an activity Diagram. Its modeling elements consist of created first. nodes and edges. The edges represent the occurring sequence (a). Create the Actors of activities, objects involving the activity, including control (b). Create the setup flows, message flows and signal flows. Activity states and action (c). Activating Configuration states are denoted with round cornered boxes. Transitions are (iii). Setting up Test Cases. It describes the (expected) message shown as arrows. Branches are shown as diamonds with one flow between the actors and the data of the exchanged incoming arrow and multiple exit arrows each labeled with messages. a Boolean expression to be satisfied to choose the branch. (iv). Select Actors Multiple arrows entering or leaving a synchronization bar show (v).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-