Abstract
Runtime exceptions are difficult to be detected by static analysis tools and their occurrences in runtime often cause software systems to crash or unexcepted termination. Therefore, it is necessary to detect the existence of runtime exceptions in the program before it is executed. In this paper, we describe a novel program segment testing technique for detecting potential occurrences of runtime exceptions during the program construction process. Our testing technique is characterized by three steps. The first step is to determine the target program segment in which potential runtime exceptions may occur during the program execution. The second step is to form an appropriate environment to test the program segment by determining the values of the variables. The final step is to carry out the testing and determine whether the runtime exceptions will occur and will be handled properly during the system execution. This paper also presents a case study to demonstrate that the technique is effective.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Myers, G.J., Sandler, C., Badgett, T.: The Art of Software Testing. John Wiley & Sons (2011)
Sy, N.T., Deville, Y.: Automatic test data generation for programs with integer and float variables, pp. 13–21. IEEE (2001)
https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html
Jamil, M.A., Arif, M., Abubakar, N.S.A., Ahmad, A.: Software Testing Techniques: A Literature Review, pp. 177–182. IEEE (2016)
Ostrand, T.: White‐Box testing. In: Encyclopedia of Software Engineering (2002)
Beizer, B.: Black-Box Testing: Techniques for Functional Testing of Software and Systems. John Wiley & Sons, Inc. (1995)
Dadeau, F., Peureux, F.: Grey-box Testing and Verification of Java/JML, pp. 298–303. IEEE (2011)
Runeson, P.: A survey of unit testing practices. IEEE Softw. 23, 22–29 (2006)
Jorgensen, P.C., Erickson, C.: Object-oriented integration testing. Commun. ACM 37, 30–38 (1994)
Borjesson, E., Feldt, R.: Automated system testing using visual GUI testing tools: a comparative study in industry. In: 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation, pp. 350–359. IEEE (2012)
Walkinshaw, N., Roper, M., Wood, M.: The Java System Dependence Graph, pp. 55–64. IEEE (2003)
Weiser, M.: Program slicing. IEEE Trans. Softw. Eng. (4) 352–357 (1984)
Agrawal, H., Horgan, J.R.: Dynamic program slicing. ACM SIGPlan Notices 25, 246–256 (1990)
Sinha, S., Shah, H., Görg, C., Jiang, S., Kim, M., Harrold, M.J.: Fault localization and repair for Java runtime exceptions. In: Proceedings of the Eighteenth International Symposium on Software Testing and Analysis, pp. 153–164 (2009)
Jones, J.A., Harrold, M.J.: Empirical evaluation of the tarantula automatic fault-localization technique. In: Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering, pp. 273–282 (2005)
Pytlik, B., Renieris, M., Krishnamurthi, S., Reiss, S.P.: Automated fault localization using potential invariants. arXiv preprint cs/0310040 (2003)
Edvardsson, J.: A survey on automatic test data generation. In: Proceedings of the 2nd Conference on Computer Science and Engineering, pp. 21–28. Citeseer (1999)
Candea, G., Godefroid, P.: Automated software test generation: some challenges, solutions, and recent advances. In: Steffen, B., Woeginger, G. (eds.) Computing and Software Science. LNCS, vol. 10000, pp. 505–531. Springer, Cham (2019). https://doi.org/10.1007/978-3-319-91908-9_24
Sinha, S., Harrold, M.J., Rothermel, G.: System-dependence-graph-based slicing of programs with arbitrary interprocedural control flow. In: Proceedings of the 21st International Conference on Software Engineering, pp. 432–441. IEEE (1999)
Kim, H., Choi, T.-H., Jung, S.-C., Kim, H.-C., Lee, O., Doh, K.-G.: Applying dataflow analysis to detecting software vulnerability. In: 2008 10th International Conference on Advanced Communication Technology, pp. 255–258. IEEE (2008)
Livshits, V.B., Lam, M.S.: Finding security vulnerabilities in java applications with static analysis. In: USENIX Security Symposium, p. 18. (2005)
Kim, Y., Kim, Y., Kim, T., Lee, G., Jang, Y., Kim, M.: Automated unit testing of large industrial embedded software using concolic testing. In: 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 519–528. IEEE (2013)
Luckeneder, C., Kaindl, H., Korinek, M.: Automated Unit Testing in Model-based Embedded Software Development, pp. 427–434 (2017)
Liu, S.: Software construction monitoring and predicting for human-machine pair programming. In: Duan, Z., Liu, S., Tian, C., Nagoya, F. (eds.) SOFL+MSVL 2018. LNCS, vol. 11392, pp. 3–20. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-13651-2_1
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Rao, L., Liu, S., Liu, A. (2023). Testing Program Segments to Detect Runtime Exceptions in Java. In: Liu, S., Duan, Z., Liu, A. (eds) Structured Object-Oriented Formal Language and Method. SOFL+MSVL 2022. Lecture Notes in Computer Science, vol 13854. Springer, Cham. https://doi.org/10.1007/978-3-031-29476-1_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-29476-1_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-29475-4
Online ISBN: 978-3-031-29476-1
eBook Packages: Computer ScienceComputer Science (R0)