Skip to main content

A Network-Based Approach for Reducing Test Suites While Maintaining Code Coverage

  • Conference paper
  • First Online:
Book cover Complex Networks and Their Applications VIII (COMPLEX NETWORKS 2019)

Part of the book series: Studies in Computational Intelligence ((SCI,volume 882))

Included in the following conference series:

Abstract

An effective test suite can be desirable for its ability to protect the code when introducing changes aiming at providing further functionalities, for refactoring, etc. An ample test suite, while taking considerable resources and time to execute, could be as effective as a smaller one having the same code coverage. This paper proposes an approach to reduce the number of test cases needed while ensuring the same code coverage of a large test suite. The approach is totally automatic, comprising test cases generation, code coverage computation, and reduction on the number of test cases. For finding the minimum subset of test cases, the code coverage problem has been formulated as a Set Cover problem. Our solution is based on Integer Linear Programming and on the properties of the Control Flow Graph. We evaluated the proposed solution on four sample software systems. The results show a drastic reduction on the number of tests, hence their execution time.

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 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 219.99
Price excludes VAT (USA)
  • Durable hardcover 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

Notes

  1. 1.

    https://www.vagrantup.com.

  2. 2.

    https://cobertura.github.io/cobertura/.

  3. 3.

    We consider the size of a family as its number of sets.

  4. 4.

    For clarity of exposition we define the Set Cover ILP formalisation in the context of our test optimisation problem.

  5. 5.

    http://www.gnu.org/software/glpk/.

  6. 6.

    http://www.gnu.org/software/glpk/.

  7. 7.

    https://jgrapht.org/.

References

  1. Agitar one - automated JUnit generation. www.agitar.com/solutions/products/automated_junit_generation.html

  2. Coffee4j - combinatorial test and fault characterization framework. coffee4j.github.io

  3. Beck, K., Gamma, E.: Extreme Programming Explained: Embrace Change. Addison-Wesley Professional, Reading (2000)

    Google Scholar 

  4. Calvagna, A., Tramontana, E.: Automated conformance testing of java virtual machines. In: Proceedings of IEEE Conference on Complex, Intelligent, and Software Intensive Systems (CISIS), Taichung, Taiwan (2013)

    Google Scholar 

  5. Chen, Z., Zhang, X., Xu, B.: A degraded ILP approach for test suite reduction. In: Proceedings of SEKE (2008)

    Google Scholar 

  6. Feige, U.: A threshold of ln n for approximating set cover. J. ACM (JACM) 45(4), 634–652 (1998)

    Article  Google Scholar 

  7. Fornaia, A., Mongiovì, M., Pappalardo, G., Tramontana, E.: A general powerful graph pattern matching system for data analysis. In: International Conference on Complex Networks and their Applications. Springer (2018)

    Google Scholar 

  8. Fraser, G., Arcuri, A.: EvoSuite: automatic test suite generation for object-oriented software. In: Proceedings of ACM SIGSOFT Symposium and European Conference on Foundations of Software Engineering (2011)

    Google Scholar 

  9. Gotlieb, A., Marijan, D.: Flower: optimal test suite reduction as a network maximum flow. In: Proceedings of ACM International Symposium on Software Testing and Analysis (2014)

    Google Scholar 

  10. Hsu, H.Y., Orso, A.: MINTS: a general framework and tool for supporting test-suite minimization. In: Proceedings of IEEE ICSE (2009)

    Google Scholar 

  11. Jatana, N., Suri, B., Kumar, P., Wadhwa, B.: Test suite reduction by mutation testing mapped to set cover problem. In: Proceedings of ACM International Conference on Information and Communication Technology for Competitive Strategies (2016)

    Google Scholar 

  12. Murphy, C., Zoomkawalla, Z., Narita, K.: Automatic test case generation and test suite reduction for closed-loop controller software. Technical report, University of Pennsylvania, Department of Computer and Information Science (2013)

    Google Scholar 

  13. Pacheco, C., Ernst, M.D.: Randoop: feedback-directed random testing for java. In: Proceedings of OOPSLA Companion (2007)

    Google Scholar 

  14. Panda, S., Mohapatra, D.P.: Regression test suite minimization using integer linear programming model. Softw. Pract. Exp. 47(11), 1539–1560 (2017)

    Article  Google Scholar 

  15. Rothermel, G., Untch, R.H., Chu, C., Harrold, M.J.: Prioritizing test cases for regression testing. IEEE Trans. Softw. Eng. 27(10), 929–948 (2001)

    Article  Google Scholar 

  16. Shamshiri, S., Just, R., Rojas, J.M., Fraser, G., McMinn, P., Arcuri, A.: Do automatically generated unit tests find real faults? An empirical study of effectiveness and challenges. In: Proceedings of IEEE/ACM ASE (2015)

    Google Scholar 

  17. Shu, G., Sun, B., Henderson, T.A., Podgurski, A.: JavaPDG: a new platform for program dependence analysis. In: Proceedings of IEEE International Conference on Software Testing, Verification and Validation (2013)

    Google Scholar 

  18. Tallam, S., Gupta, N.: A concept analysis inspired greedy algorithm for test suite minimization. ACM SIGSOFT Softw. Eng. Notes 31(1), 35–42 (2006)

    Article  Google Scholar 

  19. Xu, S., Miao, H., Gao, H.: Test suite reduction using weighted set covering techniques. In: Proceedings of IEEE International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing (2012)

    Google Scholar 

Download references

Acknowledgement

This work is supported by the CLARA project, SCN 00451, funded by MIUR within the “Smart Cities and Communities and Social Innovation” initiative.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Misael Mongiovì .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Mongiovì, M., Fornaia, A., Tramontana, E. (2020). A Network-Based Approach for Reducing Test Suites While Maintaining Code Coverage. In: Cherifi, H., Gaito, S., Mendes, J., Moro, E., Rocha, L. (eds) Complex Networks and Their Applications VIII. COMPLEX NETWORKS 2019. Studies in Computational Intelligence, vol 882. Springer, Cham. https://doi.org/10.1007/978-3-030-36683-4_14

Download citation

Publish with us

Policies and ethics