Skip to main content

A Novel Approach to Generating Test Cases with Genetic Programming

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Business Information Processing ((LNBIP,volume 224))

Abstract

Part of the automating software testing procedure includes the automation of test cases. Automation can lower the cost and effort and at the same time can increase the quality of test cases and consequently the testing procedure. Many different approaches for test case generation are available: generation from code, formal methods and different models, among others also from UML diagrams, more precisely from UML activity diagrams. Researchers use different techniques, of which genetic programming (GP) is very popular and was used in our research. In the proposed approach we generated test cases from the UML activity diagram, from which we constructed the binary decision tree structure, which is used as an instance in the evolution process of GP. The default tree structure is used throughout the whole evolution process, only the content (the testing parameters) of the nodes changes. The process of evolution consists of several genetic operators, such as selection, crossover and mutation. The main novelty of our method is a different fitness function than we can find in existing literature. In contrast to related work where the coverage is used - we used the error occurrence for our metric. The proposed method is demonstrated on the example of an automated teller machine (ATM), where we show how the full automation of test case generation and testing is a major advantage of our method.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Samuel, P., Mall, R., Bothra, A.K.: Automatic test case generation using unified modeling language (UML) state diagrams. IET Softw. 2(2), 79–93 (2008)

    Article  Google Scholar 

  2. Swain, R., Panthi, V., Behera, P.K., Mohapatra, D.P.: Automatic test case generation from UML state chart diagram. Int. J. Comput. Appl. 42(7), 26–36 (2012)

    Google Scholar 

  3. Gulia, P., Chillar, R.S.: A new approach to generate and optimize test cases for UML state diagram using genetic algorithm. SIGSOFT Softw. Eng. Notes 37(3), 1–5 (2012)

    Article  Google Scholar 

  4. Shamsoddin-Motlagh, E.: A review of automatic test cases generation. Int. J. Comput. Appl. 57(13), 25–29 (2012)

    Google Scholar 

  5. IEEE: IEEE Standard for Software and System Test Documentation (2008)

    Google Scholar 

  6. Li, L., He, T., Tang, S.: Consistency checking and test generation for UML statechart diagram via extended context-free grammar (2012)

    Google Scholar 

  7. Schlick, R., Herzner, W., Jöbstl, E.: Fault-based generation of test cases from UML-models – approach and some experiences. In: Flammini, F., Bologna, S., Vittorini, V. (eds.) SAFECOMP 2011. LNCS, vol. 6894, pp. 270–283. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  8. Hametner, R., Kormann, B., Vogel-Heuser, B., Winkler, D., Zoitl, A.: Test case generation approach for industrial automation systems (2011)

    Google Scholar 

  9. Swain, S., Mohapatra, D., Mall, R.: Test case generation based on use case and sequence diagram. IJSE 3, 1–32 (2010)

    Google Scholar 

  10. OMG: Unified Modeling Language Version 2.4.1 (2011)

    Google Scholar 

  11. Samuel, P., Joseph, A.T.: Test Sequence Generation from UML Sequence Diagrams (2008)

    Google Scholar 

  12. Gantait, A.: Test Case Generation and Prioritization from UML Models (2011)

    Google Scholar 

  13. Kundu, D., Samanta, D.: A novel approach to generate test cases from UML activity diagrams. J. Object Technol. 8(3), 65–83 (2009)

    Article  Google Scholar 

  14. Sharma, C., Sabharwal, S., Sibal, R.: A survey on software testing techniques using genetic algorithm. IJCSI 10(1), 381–393 (2013)

    Google Scholar 

  15. Shirole, M., Kumar, R.: UML behavioral model based test case generation: a survey. SIGSOFT Softw. Eng. Notes 38(4), 1–13 (2013)

    Article  Google Scholar 

  16. Doungsa-ard, C., Dahal, K., Hossain, A., Suwannasart, T.: Test Data Generation from UML State Machine Diagrams using GAs (2007)

    Google Scholar 

  17. Lefticaru, R., Ipate, F.: Automatic State-Based Test Generation Using Genetic Algorithms (2007)

    Google Scholar 

  18. Lefticaru, R., Ipate, F.: Functional Search-Based Testing from State Machines (2008)

    Google Scholar 

  19. Shirole, M., Suthar, A., Kumar, R.: Generation of improved test cases from UML state diagram using genetic algorithm. In: Proceedings of the 4th India Software Engineering Conference, ISEC 2011, pp. 125–134. ACM, New York (2011)

    Google Scholar 

  20. Shirole, M., Kommuri, M., Kumar, R.: Transition sequence exploration of UML activity diagram using evolutionary algorithm. In: Proceedings of the 5th India Software Engineering Conference, ISEC 2012, pp. 97–100. ACM, New York (2012)

    Google Scholar 

  21. Koza, J.R.: Survey of genetic algorithms and genetic programming. In: Wescon Conference Record, Western Periodicals Company, pp. 589–594 (1995)

    Google Scholar 

  22. D’haeseleer, P.: Context preserving crossover in genetic programming. In: International Conference on Evolutionary Computation, pp. 256–261 (1994)

    Google Scholar 

Download references

Acknowledgements

This work was partly supported by the Slovenian Research Agency (SRA) under The Young Researchers Programme (SICRIS/SRA code 35512, RO 0796, Programme P2-0057).

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Sašo Karakatič or Tina Schweighofer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Karakatič, S., Schweighofer, T. (2015). A Novel Approach to Generating Test Cases with Genetic Programming. In: Uden, L., Heričko, M., Ting, IH. (eds) Knowledge Management in Organizations. KMO 2015. Lecture Notes in Business Information Processing, vol 224. Springer, Cham. https://doi.org/10.1007/978-3-319-21009-4_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-21009-4_20

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-21008-7

  • Online ISBN: 978-3-319-21009-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics