Skip to main content

Automatic Generation of Specification-Based Test Cases by Applying Genetic Algorithms in Reinforcement Learning

  • Conference paper
Structured Object-Oriented Formal Language and Method (SOFL+MSVL 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9559))

Abstract

Automatic test pattern generation by applying genetic algorithms in reinforcement learning is proposed and the results of evaluation with an ATM system which assuming the existence of a bug related to a global variable are reported. For software development based on formal specifications, a number of methods for the automatic generation of test cases have previously been proposed. However, most of those methods are for testing whether or not the specifications are correctly implemented, and the problem of automatically generating test cases for which all of the paths can be traversed, including paths that were not anticipated, remains unsolved. We have previously demonstrated the feasibility of using genetic algorithms as an effective approach to that problem by evaluation with a simple test problem that assumes a single-variable input and evaluation assuming that the total number of paths is known. Here, we use a genetic algorithm in which the test cases are used as the gene locus values in the chromosome with redundant gene length and the difference vector is used for performing mutation. We compare this approach to the pairwise method and the vibration method, which are leading research areas, in a more realistic testing environment such as evaluation of ATM system programs. We show that the proposed method can provide higher program path coverage than the previous methods and effectively generates test cases for a bug related to a global variable.

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

Access this chapter

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

Institutional subscriptions

References

  1. Horcher, H.-M.: Improving software tests using Z specifications. In: Proceeding 9th International Conference of Z Users, The Z Formal specification Notation (1995)

    Google Scholar 

  2. Spivey, J.M.: The Z notation: A Reference Manual, 2nd edn. Prentice Hall (1992)

    Google Scholar 

  3. Offutt, J., Abdurazik, A.: Generating tests from UML specifications. In: France, R.B. (ed.) UML 1999. LNCS, vol. 1723, pp. 416–429. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  4. Rumbaugh, J., Jacobson, I., Booch, G.: The Unified Modeling Language Reference Manual. Addison-Wesley Object Technology Series (1998)

    Google Scholar 

  5. Chang, J., Richardson, D.J.: Structural specification-based testing: automated support and experimental evaluation. In: Proceeding 7th ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 285–302, September 1999

    Google Scholar 

  6. Sanker, S., Hayes, R.: Specifying and testing software components using ADL. Technical Report SMLI TR-94-23, Cun Microsystems Laboratories, Inc., Mountain View, CA, April 1994

    Google Scholar 

  7. Boyapati, C., Khurshid, S., Marinov, D.: Korat: automatically testing based on java predicates. ISSTA 2002 Proceedings of the ACM SIGSOFT International Symposium on Software testing and analysis, pp. 123–133 (2002)

    Google Scholar 

  8. Sánchez, M.A.: Specification-based Testing, pp. 12–47 (1997)

    Google Scholar 

  9. Marinov, D., Khurshid, S.: TestEra: a novel framework for automated testing of Java programs. In: Proceeding 16th IEEE International Conference on Automated Software Engineering, San Diego, November 2001

    Google Scholar 

  10. Jackson, D., Schechter, I., Shlyakhter, I.: ALCOA: the alloy constraint analyzer. In: Proceeding 22nd international Conference on Software Engineering(ICSE), Limerick, June 2000

    Google Scholar 

  11. Cheon, Y., Leavens, G.T.: A simple and practical approach to unit testing: the JML and JUnit way. Technical Report 01–12, Department of Computer Science, Iowa State University, November 2001

    Google Scholar 

  12. Liu, S., Nakajima, S.: A “Vibration" method for automatically generating test cases based on formal specifications. In: Software Engineering Conference, 2011 18th Asia Pacific, pp. 73–80, 5–8 December 2011

    Google Scholar 

  13. Liu, S., Nakajima, S.: A decompositional approach to automatic test cases generation based on formal specification. In 4th IEEE International Conference on Secure Software Integration and Reliability Improvement, pp. 147–155. IEEE CS Press, Singapore, 9–11 June 2010

    Google Scholar 

  14. Reeves, C.R.: Modern Heuristic Techniques for Combinatorial Problems. Blackwell Scientific, Oxford (1993)

    MATH  Google Scholar 

  15. Beasley, J.E.: A genetic algorithm for the set covering problem. Eur. J. Oper. Res. 94, 392–404 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  16. Beasley, D., Bull, D.R., Martin, R.R.: An overview of genetic algorithms: Part I, fundamentals. Univ. Comput. 15(2), 58–59 (1993)

    Google Scholar 

  17. http://www.kailesoft.cn (cited 7 July 2014)

  18. Pargas, R.P., Harrold, M.J., Peck, R.R.: Test-data generation using genetic algorithms. J. Softw. Testing Verification Reliab. 9(4), 263–282 (1999)

    Article  Google Scholar 

  19. Zhou, Y., Sugihara, T., Sato, Y.: Applying GA with Tabu list for automatically generating test cases based on formal specification. In: Liu, S., Duan, Z. (eds.) SOFL+MSVL 2014. LNCS, vol. 8979, pp. 17–31. Springer, Heidelberg (2015)

    Google Scholar 

Download references

Acknowledgements

We would like to show my deepest gratitude to Prof. Shaoying Liu of the Department of Computer and Information Sciences in Hosei University for their valuable comments and discussions on experimental results.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yuji Sato .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Sato, Y., Sugihara, T. (2016). Automatic Generation of Specification-Based Test Cases by Applying Genetic Algorithms in Reinforcement Learning. In: Liu, S., Duan, Z. (eds) Structured Object-Oriented Formal Language and Method. SOFL+MSVL 2015. Lecture Notes in Computer Science(), vol 9559. Springer, Cham. https://doi.org/10.1007/978-3-319-31220-0_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-31220-0_5

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-31219-4

  • Online ISBN: 978-3-319-31220-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics