Skip to main content

Unit Testing of Database-Driven Java Enterprise Edition Applications

  • Conference paper
  • First Online:
Tests and Proofs (TAP 2017)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10375))

Included in the following conference series:

Abstract

The Java Enterprise Edition (Java EE) platform and its persistence API are widely adopted technologies to develop applications that interact with database systems. Many control flows of these applications strongly depend on a specific database state. This paper presents an automatic test-case generation approach for applications in this environment. The approach generates both test data for the application’s input, as well as entity objects for the different database states that are required to cover a respective control flow. We integrate constraints from symbolically executing a control flow with constraints on a required database state. We also support typical Java EE functionalities in the symbolic execution, e.g. dependency injection. An experimental evaluation shows an increase in control-flow coverage by our approach.

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

Notes

  1. 1.

    http://docs.oracle.com/html/E13946_04/ejb3_langref.html, accessed January 2017.

  2. 2.

    http://arquillian.org/, accessed March 2017.

  3. 3.

    If an explored path contains a bug, the input values that trigger it can be derived from the path condition.

  4. 4.

    https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html, accessed March 2017.

  5. 5.

    https://docs.oracle.com/javaee/7/tutorial/partpersist.htm, Chap. 40.

  6. 6.

    From a database point of view, this corresponds to a constraint \(e1.foreignKey = e2.primaryKey\).

  7. 7.

    http://wildfly.org/, accessed March 2017.

  8. 8.

    http://arquillian.org/, accessed March 2017.

  9. 9.

    https://github.com/wwu-pi/tap17-muggl-javaee.

  10. 10.

    http://www.eclemma.org/jacoco/, accessed March 2017.

References

  1. Ait-Kaci, H.: Warren’s Abstract Machine: A Tutorial Reconstruction. MIT Press, Cambridge (1991)

    Google Scholar 

  2. Arcuri, A., Fraser, G.: Java enterprise edition support in search-Based JUnit test generation. In: Sarro, F., Deb, K. (eds.) SSBSE 2016. LNCS, vol. 9962, pp. 3–17. Springer, Cham (2016). doi:10.1007/978-3-319-47106-8_1

    Chapter  Google Scholar 

  3. Diakopoulos, N., Cass, S.: Interactive: The Top Programming Languages 2016. IEEE Spectrum (2016). http://spectrum.ieee.org/static/interactive-the-top-programming-languages-2016

  4. Ebersole, S.: Semantic Query Model and Interpreter for HQL/JPQL and JPA Criteria Queries. Hibernate (2017). https://github.com/hibernate/hibernate-semantic-query

  5. Emmi, M., Majumdar, R., Sen, K.: Dynamic test input generation for database applications. In: Proceedings of the 2007 International Symposium on Software Testing and Analysis, pp. 151–162. ACM (2007)

    Google Scholar 

  6. Ernsting, M., Majchrzak, T.A., Kuchen, H.: Dynamic solution of linear constraints for test case generation. In: Margaria, T., Qiu, Z., Yang, H. (eds.) 6th International Conference on Theoretical Aspects of Software Engineering, pp. 271–274. IEEE, Beijing (2012)

    Google Scholar 

  7. Fraser, G., Arcuri, A.: EvoSuite: automatic test suite generation for object-oriented software. In: Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering, pp. 416–419. ACM (2011)

    Google Scholar 

  8. Gould, C., Su, Z., Devanbu, P.: Static checking of dynamically generated queries in database applications. In: Proceedings of the 26th International Conference on Software Engineering, pp. 645–654. IEEE Computer Society (2004)

    Google Scholar 

  9. King, J.C.: Symbolic execution and program testing. Commun. ACM 19(7), 385–394 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  10. Kuchcinski, K., Szymanek, R.: Jacop - Java constraint programming solver. In: Proceedings of of CP Solvers: Modeling, Applications, Integration, and Standardization (2013)

    Google Scholar 

  11. Lindholm, T., Yelln, F., Bracha, G., Buckley, A.: The Java Virtual Machine Specification, Java SE 8 Edion. Addison Wesley, Boston (2014)

    Google Scholar 

  12. Majchrzak, T.A., Kuchen, H.: Automated test case generation based on coverage analysis. In: Proceedings of the 3rd IEEE International Symposium on Theoretical Aspects of Software Engineering, pp. 259–266. Tianjin, China (2009)

    Google Scholar 

  13. Pacheco, C., Lahiri, S.K., Ernst, M.D., Ball, T.: Feedback-directed random test generation. In: Proceedings of the 29th International Conference on Software Engineering, pp. 75–84. IEEE Computer Society (2007)

    Google Scholar 

  14. Parr, T.: The Definitive ANTLR 4 Reference. Pragmatic Bookshelf, Raleigh (2013)

    Google Scholar 

  15. Prasetya, I.: T3i: a tool for generating and querying test suites for Java. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 950–953. ACM (2015)

    Google Scholar 

  16. Sakti, A., Pesant, G., Guéhéneuc, Y.G.: Instance generator and problem representation to improve object oriented code coverage. IEEE Trans. Softw. Eng. 41(3), 294–313 (2015)

    Article  Google Scholar 

  17. Taneja, K., Zhang, Y., Xie, T.: MODA: automated test generation for database applications via mock objects. In: Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, pp. 289–292. ACM (2010)

    Google Scholar 

  18. Yi, Q., Yang, Z., Guo, S., Wang, C., Liu, J., Zhao, C.: Postconditioned symbolic execution. In: 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST), pp. 1–10. IEEE (2015)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Andreas Fuchs .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Fuchs, A., Kuchen, H. (2017). Unit Testing of Database-Driven Java Enterprise Edition Applications. In: Gabmeyer, S., Johnsen, E. (eds) Tests and Proofs. TAP 2017. Lecture Notes in Computer Science(), vol 10375. Springer, Cham. https://doi.org/10.1007/978-3-319-61467-0_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-61467-0_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-61466-3

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics