Skip to main content

Worst-Case Execution Time Test Generation for Solutions of the Knapsack Problem Using a Genetic Algorithm

  • Conference paper
Book cover Bio-Inspired Computing - Theories and Applications

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 472))

  • 1402 Accesses

Abstract

Worst-case execution time test generation can be hard if tested programs use complex heuristics. This is especially true in the case of the knapsack problem, which is often called “the easiest NP-complete problem”. For randomly generated test data, the expected running time of some algorithms for this problem is linear. We present an approach for generation of tests against algorithms for the knapsack problem. This approach is based on genetic algorithms. It is evaluated on five algorithms, including one simple branch-and-bound algorithm, two algorithms by David Pisinger and their partial implementations. The results show that the presented approach performs statistically better than generation of random tests belonging to certain classes. Moreover, a class of tests that are especially hard for one of the algorithms was discovered by the genetic algorithm.

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 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Source code for experiments (a part of this paper), https://github.com/mbuzdalov/papers/tree/master/2014-bicta-knapsacks

  2. Alander, J.T., Mantere, T., Moghadampour, G.: Testing Software Response Times Using a Genetic Algorithm. In: Proceedings of the 3rd Nordic Workshop on Genetic Algorithms and their Applications, pp. 293–298 (1997)

    Google Scholar 

  3. Alander, J.T., Mantere, T., Turunen, P.: Genetic Algorithm based Software Testing. In: Proceedings of the 3rd International Conference on Artificial Neural Networks and Genetic Algorithms, Norwich, UK, pp. 325–328 (April 1997)

    Google Scholar 

  4. Alander, J.T., Mantere, T., Turunen, P., Virolainen, J.: GA in Program Testing. In: Proceedings of the 2nd Nordic Workshop on Genetic Algorithms and their Applications, Vaasa, Finland, August 19-23, pp. 205–210 (1996)

    Google Scholar 

  5. Arkhipov, V., Buzdalov, M., Shalyto, A.: Worst-Case Execution Time Test Generation for Augmenting Path Maximum Flow Algorithms using Genetic Algorithms. In: Proceedings of the International Conference on Machine Learning and Applications, vol. 2, pp. 108–111. IEEE Computer Society (2013)

    Google Scholar 

  6. Buzdalov, M.: Generation of Tests for Programming Challenge Tasks on Graph Theory using Evolution Strategy. In: Proceedings of the International Conference on Machine Learning and Applications, vol. 2, pp. 62–65. IEEE Computer Society (2012)

    Google Scholar 

  7. Buzdalova, A., Buzdalov, M., Parfenov, V.: Generation of Tests for Programming Challenge Tasks Using Helper-Objectives. In: Ruhe, G., Zhang, Y. (eds.) SSBSE 2013. LNCS, vol. 8084, pp. 300–305. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  8. Chvatal, V.: Hard Knapsack Problems. Operations Research 28(6), 1402–1411 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  9. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., New York (1979)

    Google Scholar 

  10. Gross, H.G.: A Prediction System for Evolutionary Testability Applied to Dynamic Execution Time Analysis. Information and Software Technology 43(14), 855–862 (2001)

    Article  Google Scholar 

  11. Gross, H.G., Jones, B.F., Eyres, D.E.: Structural Performance Measure of Evolutionary Testing Applied to Worst-Case Timing of Real-Time Systems. IEEE Proceedings - Software 147(2), 25–30 (2000)

    Article  Google Scholar 

  12. Gross, H.G., Mayer, N.: Search-based Execution-Time Verification in Object-Oriented and Component-Based Real-Time System Development. In: Proceedings of the 8th IEEE International Workshop on Object-Oriented Real-Time Dependable Systems, pp. 113–120 (2003)

    Google Scholar 

  13. Moreno-Scott, J.H., Ortíz-Bayliss, J.C., Terashima-Marín, H., Conant-Pablos, S.E.: Challenging Heuristics: Evolving Binary Constraint Satisfaction Problems. In: Proceedings of Genetic and Evolutionary Computation Conference, pp. 409–416. ACM (2012)

    Google Scholar 

  14. Nemhauser, G., Ullmann, Z.: Discrete dynamic programming and capital allocation. Management Science 15(9), 494–505 (1969)

    Article  MathSciNet  MATH  Google Scholar 

  15. Pisinger, D.: Algorithms for Knapsack Problems. Ph.D. thesis, University of Copenhagen (February 1995)

    Google Scholar 

  16. R Core Team: R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria (2013), http://www.R-project.org/

  17. Rice, H.G.: Classes of recursively enumerable sets and their decision problems. Transactions of the American Mathematical Society 74(2), 358–366 (1953)

    Article  MathSciNet  MATH  Google Scholar 

  18. Tlili, M., Wappler, S., Sthamer, H.: Improving Evolutionary Real-Time Testing. In: Proceedings of Genetic and Evolutionary Computation Conference, pp. 1917–1924. ACM (2006)

    Google Scholar 

  19. Wegener, J., Mueller, F.: A Comparison of Static Analysis and Evolutionary Testing for the Verification of Timing Constraints. Real-Time Systems 21(3), 241–268 (2001)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Buzdalov, M., Shalyto, A. (2014). Worst-Case Execution Time Test Generation for Solutions of the Knapsack Problem Using a Genetic Algorithm. In: Pan, L., Păun, G., Pérez-Jiménez, M.J., Song, T. (eds) Bio-Inspired Computing - Theories and Applications. Communications in Computer and Information Science, vol 472. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-45049-9_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-45049-9_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-45048-2

  • Online ISBN: 978-3-662-45049-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics