Different Techniques Used in Automatics Test Case Generation
Md Khalid Hussain
1, Dr. Krishnanandan Prasad
21Research Scholar, Inst. of Information Sciences & IT, M. U. Bodh-Gaya, Gaya, Bihar, India
2Associate Professor, Deptt. of Mathematics, T. P. S. College Patna, Patliputra University, Bihar, India
I. ABSTRACT
Software testing plays a very important role in software development life cycle. An approach of testing which takes place at design phase can remove errors in the system and improvise the developed project. Automatic test case generation can be used for testing software or real time applications.The main aim of the study is to gain deeper insight for different approaches available for test case generation and to explore possibility of improvements in them. Many evolutionary algorithms are used for generating test case automatically.This paper contains different test case generation techniques such as random, goal oriented, specification based, sketch diagram based and source code based.
Keywords: Software Techniques, Test Case Generation
II.INTRODUCTION
Software testing is a mandatory activity in the Software Development Life Cycle to check the completeness, correctness and quality of delivered software. Several techniques have been proposed for both manual and automated test case generation. Manual testing comprises of executing test cases manually without using any automation tool. It is completely based on human effort and design test cases during testing phase to find bugs in software system. Automated test case generation comprises of executing test cases automatically using an automated tool without any need of human intervention. Automation enters data into the system under test, compares actual and expected results and finally generates test reports. Researchers are emphasizing more on automation testing now days because automation test case generation is time saving, free from manual effort and more useful where test cases are repeatedly executing. Although for new applications or newly generated test cases, automated testing is not possible without executing them at least once manually. So a survey has been conducted on identifying various techniques and approaches for manual and automation testing to explore the possibilities of improvements in them.
With the increasing demand of new software applications, testing on these systems is becoming more and more complex because of size, change in requirements and testing environment, competitive marketplace is pressurizing organizations to adopt an effective strategy or propose new one to reduce the time and development cost of systems.
Many techniques are present to generate test cases. But for generating test cases, testers first understand the requirements and specifications with the help of requirement document. Then they prepare test cases with the use of test case template where a test case template is a kind of document which contains details about test case ID, test case description, expected result and input.
Steps for Test Case Generation
1. Finding all constraints from starting to end node where a constraint is described as an algebraic expression that dictate conditions of variables.
2. In order to reduce the test cases, variable having highest value is given maximum value and variable having lowest value is given minimum value.
3. Then, variables are assigned with the constant value at each node.
4. Finally, a table including all possible test cases is created.
Techniques
Various techniques are available for test case generation such as random, specification based, sketch diagram based, goal oriented technique and source code based technique. In brief we will discuss all these techniques but mainly we will discuss about specification based, sketch diagram based and source code based with their advantages and disadvantages in this paper.
A. Random Technique
Random technique discovers a set of test cases which are based on the assumptions involving fault distribution.
B. Goal Oriented Technique
This technique determines those test cases that covers selected goal. For example-statement of branch and irrespective of path taken.
C. Specification Based Technique [1]
Technique which uses specification document to generate test cases is called specification based technique. Its advantages-
1. Software tester have information related to the functionality of software and do not have to extract it.
2. Specification document is useful for deriving expected result for test data.
3. Tests can be generated concurrently with designing and implementation.
Disadvantages-
1. Difficulty in conducting the formal analysis.
2. This technique involves more manual effort in generation of test cases.
D. Sketch Diagram Based Technique [1]
Techniques which are used for generation of test cases from model diagrams are sketch diagram based techniques.
For example- UML use case diagram, UML sequence diagrams, UML state diagrams OR technique that involves UML (unified modeling language) to generate test cases. Its advantages-
1. Can be easily automated
2. This method saves time and resources 3. Used in web applications.
E. Source Code Based Test Case Technique or Path Oriented Test Case Technique [1]
Techniques which uses control flow diagrams to determine set of path to be covered and make proper test cases for those paths. Its advantage is that it is more often do not lead to selection of the infeasible path.
III. REVIEW LITERATURE
Many researchers and practitioners have been working for many years in generating optimal test cases, still exhaustive testing is an impossibility. In this paper, survey has been done on different techniques of test case generation carried out during the last decade. Each technique has its own advantages and limitations. It may be better for one or more thing but simultaneously affect other behaviour of the system.
I. Symbolic Execution
It is a software testing technique which helps in test data generation. Symbolic execution is a case of abstract interpretation in which symbolic values are applied in program execution rather than obtaining actual or concrete inputs. Eric James Rapos and Juergen Dingel illustrated an approach for test case generation using symbolic execution [2]. Breadth First Search method was used to compare two SETs. Next the initial test case generation from the SET was performed using depth first manner until a leaf node constituting the full execution is reached.
Supasit Monpratarnchai et al. [3] developed a 1-click executor fully automated tool which eliminates manual work by performing the testing task with 1click. It used existing symbolic execution based unit test case generation service and reduced manual effort from several minutes to few seconds.
II. Genetic Algorithm
Genetic Algorithm is an adaptive search algorithm technique to find the optimum solution to a search problem. It is used when traditional methods takes much effort and processing time in optimisation. M. Prasanna and K.R.
Chandran studied a model based approach for automated generation of test cases in object-oriented systems. Test cases were derived based on the Tree structure grouped with Genetic Algorithm by analysing the dynamic object behaviour due to internal and external stimuli [4]. Genetic algorithms crossover and mutation function brought out all the possible test cases from the object diagram. Izzat Alsmadi proposed an approach for test case generation from application user interfaces and optimizing it by Genetic Algorithm [5]. The approach used the idea of encoding the location of each control in the GUI graph and representing them in the binary format to test the overall test sequence generated by each test case. Sangeeta Sabharwal et al. [6] demonstrated a technique that used Genetic algorithm for prioritizing test case scenarios from activity and state chart diagram. Information Flow (IF) metric, GA and stack were used to generate and prioritize test cases. Genetic algorithm optimized the testing efficiency on test data. IF metric calculated the Information flow complexity associated with the nodes of activity and state chart diagrams. Stack took care of requirements change and assigned weights to the nodes of activity and state chart diagrams. Soma Sekhara Babu Lam et al. [7] presented a novel search technique for automatically generating independent feasible paths and test suite optimization using Artificial Bee Colony. ABC combined both global search method from spout bees and local search method from employed and onlooker bees. Generation of test data and test suite optimization became faster due to the parallel behaviour of three bees. Test cases were generated using Test Path Sequence Comparison Method with fitness value as the objective function.
III. Slicing Technique
It is a program analysis technique which restricts the focus of a task to a specific executable subset of program.
Philip Samuel et al. [8] demonstrated a methodology for automated test case generation from UML sequence diagrams using dynamic slicing. The test adequacy criterion was formulated as slice coverage criterion. The message guards for sequence diagrams were identified and slices for test data were created with respect to each conditional predicates. Ranjita Kumari Swain et al. [9] used condition slicing to generate test cases for object oriented software from UML interaction diagram. Message guards on interaction diagrams were identified and dynamic conditional slices corresponding to each conditional predicates were created. Message flow dependence graph was drawn from UML sequence diagram and then conditional slicing was applied on predicate node of the graph to derive the number of test cases generated while maintaining all practically needful test cases.
IV. Model Checking
Model checking also known as property checking, is a program analysis technique. As the name specifies, it is a formal method that checks whether a finite state system conforms the correctness of its properties. Mingsong Chen et al. [10] used model checking to automatically generating test cases from UML activity diagrams. Specification coverage was used to generate properties as well as design models for enabling directed test generation using model- checking. Mingsong Chen et al. [11] used model checking for automatically generating test cases from UML activity diagrams. Coverage driven mapping rules automatically converted activity diagrams into input specification of formal model checker and a method automatically generated properties based on error models. Various model checking based test generation techniques were applied into the framework for efficient test case generation for UML diagrams.
V. Model Based testing
It is a testing technique in which test cases are automatically generated from a model that describes the functional behaviour of System under Tests. Mingsong Chen et al. [12] demonstrated an approach that did not directly derive test cases from activity diagrams rather it selected test cases from randomly generated test cases based on given test adequacy criterion. A reduced set of test cases were selected according to test adequacy criterion by matching the
program execution traces with behaviour of the activity diagram. Yin Yongfeng et al. [13] expressed the relations between UML modelling and Real time embedded software testing. Test cases were generated for real-time embedded software based on the extensions of UML diagrams and scenario technology. Changai Sun et al. [14] used a tool TSGen to automatically generate a complete suite of test scenarios from UML activity diagrams. TSGen read in modeling artifacts from a UML modeling tool ArgoUML , then executed the preprocessing and finally derived a complete suite of test scenarios. Xin Chen et al. [15] used a method to automatically generate test inputs for java programs that used runtime behaviour of programs as feedback with respect to simple path coverage criterion in UML activity diagrams and picked useful test cases. Based on the feedbacks collected, a classifier was constructed for each decision node in activity diagrams and automated executable test cases were generated. Ranjita Kumari Swain et al. [16] used a function minimisation technology for automated test case generation from UML statechart diagrams. It used Depth First Search algorithm to select the conditional predicates which were then converted to source code to generate the test cases automatically. A technique called Function Minimisation Technique sorts these test cases. Puneet E. Patel and Nitin N. Patil compared and implemented two approach to generate test cases from UML activity diagram automatically [17]. One generated test cases from UML activity diagrams with UML 2.0 syntax and use case scope presented by Debasis Kundu and Debasis Samanta in 2009 and other one was automatic Test Case Generation From UML Activity Diagram using Activity Path presented by Yasir Dawood and Salman Almulham in 2010. Anbunathan R and AnirbanBasu generated both manual and automated test cases from UML class diagrams [18]. Class diagrams and corresponding state diagrams were parsed to extract the desired information which was then used for generating test cases from classical testing methods such as Basis path, DD path and DU path. Ajay Kumar Jena et al. [19] generated manual test cases from UML activity diagrams on ATM case study taking activity coverage criteria as test criterion. Ashish Verma and Dr. Maitrayee Dutta used an integrated tool to automatically generate test cases of object oriented applications for UML diagrams based on behaviour [20]. Collaborative test cases were generated by parsing the petal files from UML diagrams using Pattern discovery and Information Retrieval process.
. Table 1: Summary for Previous Paper
Table 2: Summary for Previous Paper Continue...
IV. CONCLUSION
The main objective of the study was to collect relevant data to understand various testing techniques available and to determine probability of improvements in them. There is numerous numbers of techniques available for testing. We need to gain deeper insights into existing measures to determine the need of new measures and better compare the techniques to explore new strategies or methodologies for improvisation. Unified Modelling Language has become a de facto standard in the field of software engineering. Test cases have been generated both manually and automated from UML diagrams. New techniques for generating efficient, prioritised and optimised test cases from UML diagrams need to be explored on next research paper.
REFERENCE
[1] Nicha Kosindrdecha and Jirapun Daengdej “A test case generation technique and process” Journal of Software Engineering 4(4) 265287 2010, Academic Journal Inc., 2010 ISSN 1819-4311
[2] Eric James Rapos and Juergen Dingel, „„Incremental Test Case Generation for UML-RT Models Using Symbolic Execution‟‟, 5th International Conference on Software Testing, Verification and Validation (ICST), IEEE, pp. 962-963, 2012.
[3] Supasit Monpratarnchai, Shoichiro Fujiwara, Asako Katayama and Tadahiro Uehara, „„An Automated Testing Tool for Java Application Using Symbolic Execution based Test Case Generation‟‟, 20th AsiaPacific Software Engineering Conference, IEEE, pp. 93-98, 2013.
[4] M. Prasanna and K.R. Chandran, „„Automatic Test Case Generation for UML Object diagrams using Genetic Algorithm‟‟, International Journal of Advances in Soft Computing and its Applications(ICSRS), Vol. 1, No. 1, pp. 19-32, July 2009.
[5] Izzat Alsmadi, „„ Using Genetic Algorithms for Test case generation and Selection Optimisation‟‟, 23rd Canadian Conference on Electrical and Computer Engineering (CCECE), IEEE, pp. 1-4, 2010.
[6] Sangeeta Sabharwal, Ritu Sibal and Chayanika Sharma, „„Applying Genetic Algorithm for Prioritization of Test Case Scenarios Derived from UML Diagrams‟‟, International Journal of Computer Science Issues{IJCSI), Vol. 8, Issue 3, No. 2, pp.433-444, May 2011.
[7] Soma Sekhara Babu Lam, M L Hari Prasad Rajub, Uday Kiran M, Swaraj Chb and Praveen Ranjan Srivastav, „„ Automated Generation of Independent Paths and Test Suite Optimization Using Artificial Bee Colony‟‟, Elsevier International Conference on Communication Technology and System Design, Procedia Engineering, Vol. 30, pp. 191 – 200, 2011.
[8] Philip Samuel, Rajib Mall and Sandeep Sahoo, „„UML Sequence Diagram Based Testing Using Slicing‟‟, IEEE Indicon 2005 Conference, pp.176178, 11-13 Dec. 2005.
[9] Ranjita Kumari Swaina, Vikas Panthi and Prafulla Kumar Behera, „„Test Case Design Using Slicing of UML Interaction Diagram‟‟, 2nd International Conference on Communication, Computing & Security [ICCCS-2012], Procedia Technology, Vol. 6, pp. 136 – 144, 2012.
[10] Mingsong Chen, Prabhat Mishra and Dhrubajyoti Kalita, „„ Coverage-driven Automatic Test Generation for UML Activity Diagrams‟‟, Great Lakes Symposium on VLSI (GLSVLSI), ACM, pp.139-142, 2008.
[11] Mingsong Chen , Prabhat Mishra and Dhrubajyoti Kalita, „„Efficient test case generation for validation of UML activity diagrams‟‟, Springer Design Automation for Embedded Systems, LLC , Vol. 14, Issue 2, pp.
105-130, 2010.
[12] Mingsong Chen, Xiaokang Qiu, Wei Xu, Linzhang Wang, Jianhua Zhao and Xuandong Li, „„UML Activity Diagram-Based Automatic Test Case Generation For Java Programs‟‟, The Computer Journal, Vol. 52, No.
5, pp. 545-556, 2007.
[13] Yin Yongfeng, Liu Bin, Lu Minyan, Li Zhen, „„Test Cases Generation for Embedded Real-time Software Based on Extended UML‟‟, International Conference on Information Technology and Computer Science, IEEE, pp. 69-74, 2009.
[14] Chang-ai Sun, Baobao Zhang and Jin Li, „„TSGen: A UML Activity Diagram-based Test Scenario Generation Tool‟‟, International Conference on Computational Science and Engineering (CSE), IEEE, Vol.
2, pp. 853-858, 2009
[15] Xin Chen, Nan Ye, Peng Jiang, Lei Bu and Xuandong Li, „„Feedback-directed test case generation based on UML activity diagrams‟‟, 5th International Conference on Secure Software Integration and Reliability Improvement Companion (SSIRI-C), IEEE, pp. 9-10, 2011.
[16] Ranjita Kumari Swain, Vikas Panthi, Prafulla kumar Behra and Durga Prasad Mohapatra, „„Automatic Test case Generation From UML State Chart Diagram‟‟, International Journal of Computer Applications (0975 – 8887), Volume 42, No.7, pp. 27-36, March 2012.
[17] Puneet E. Patel and Nitin N. Patil, „„Test cases Formation using UML Activity Diagram‟‟, International Conference on Communication Systems and Network Technologies, IEEE, pp. 884889, 2013.
[18] Anbunathan R and AnirbanBasu, „„Dataflow test case generation from UML Class diagrams‟‟, International Conference on Computational Intelligence and Computing Research (ICCIC), IEEE, pp. 1-9, 2013.
[19] Ajay kumar Jena, Santosh Kumar Swain and Durga prasad Mohapatra, „„ A novel approach for test case generation from UML activity Diagram‟‟, International Conference on Issues and challenges in Intelligent computing Techniques(ICICT), IEEE, pp. 621-629, 2014.
[20] Verma, A., & Dutta, M. (2014). Automated Test case generation using UML diagrams based on behavior. International Journal of Innovations in Engineering and Technology (IJIET), 4(1), 31-39.