An Empirical Study of Exception Handling Practices in Android Applications
Keywords:
Android; exception handling; software reliability; lifecycle-aware analysis; empirical software engineering; static analysisAbstract
Exception handling is a central reliability mechanism in Android applications, yet its empirical characterization remains difficult because handlers are distributed across lifecycle callbacks, framework boundaries, asynchronous tasks, and third-party libraries. Raw counts of try and catch blocks obscure whether an exception is recovered, suppressed, propagated, logged, or made inevitable by a lifecycle path. This article develops a rigorous empirical framework and analytical assessment for studying exception handling practices in Android apps. The central contribution is a lifecycle-aware measurement model that connects handler forms to throw sites, recovery actions, propagation risk, and app-level variation. The framework combines bytecode extraction, lifecycle-augmented call graphs, a multidimensional coding taxonomy, and multilevel statistical estimands. It distinguishes syntactic handler presence from semantic containment and treats app-level clustering as a first-order design issue rather than a nuisance. Published evidence on Java and Android exception handling motivates the constructs; the analysis derives the conditions under which handler density, catch coverage, propagation risk, and lifecycle exposure become informative rather than misleading. The resulting design supports reproducible comparisons across applications, libraries, and development contexts, and it yields concrete implications for static analysis tooling, code review, and exception-handling testing in mobile software. The paper does not substitute speculative performance claims for evidence; instead, it specifies what must be measured and why those measurements matter.
References
1. Robillard, M. P., & Murphy, G. C. (2003). Static analysis to support the evolution of exception structure in object-oriented systems. ACM Transactions on Software Engineering and Methodology, 12(2), 191–221.
2. Sinha, S., & Harrold, M. J. (2000). Analysis and testing of programs with exception handling constructs. IEEE Transactions on Software Engineering, 26(9), 849–871.
3. Cabral, B., & Marques, P. (2007). Exception handling: A field study in Java and .NET. In E. Ernst (Ed.), ECOOP 2007 – Object-oriented programming (Lecture Notes in Computer Science, Vol. 4609, pp. 151–175). Springer.
4. Jo, J.-W., Chang, B.-M., Yi, K., & Choe, K.-M. (2004). An uncaught exception analysis for Java. Journal of Systems and Software, 72(1), 59–69.
5. Fu, C., & Ryder, B. G. (2007). Exception-chain analysis: Revealing exception handling architecture in Java server applications. In Proceedings of the 29th International Conference on Software Engineering (pp. 230–239). IEEE Computer Society.
6. Weimer, W., & Necula, G. C. (2008). Exceptional situations and program reliability. ACM Transactions on Programming Languages and Systems, 30(2), Article 8.
7. Google. (2022). The activity lifecycle. Android Developers. https://developer.android.com/guide/components/activities/activity-lifecycle
8. Arzt, S., Rasthofer, S., Fritz, C., Bodden, E., Bartel, A., Klein, J., Le Traon, Y., Octeau, D., & McDaniel, P. (2014). FlowDroid: Precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for Android apps. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (pp. 259–269). ACM.
9. Coelho, R., Almeida, L., Gousios, G., van Deursen, A., & Treude, C. (2017). Exception handling bug hazards in Android: Results from a mining study and an exploratory survey. Empirical Software Engineering, 22(6), 3003–3045.
10. Nakshatri, S., Hegde, M., & Thandra, S. (2016). Analysis of exception handling patterns in Java projects: An empirical study. In Proceedings of the 13th International Conference on Mining Software Repositories (pp. 500–503). ACM.
11. Linares-Vásquez, M., Bavota, G., Bernal-Cárdenas, C., Di Penta, M., Oliveto, R., & Poshyvanyk, D. (2013). API change and fault proneness: A threat to the success of Android apps. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering (pp. 477–487). ACM.
12. McDonnell, T., Ray, B., & Kim, M. (2013). An empirical study of API stability and adoption in the Android ecosystem. In 2013 IEEE International Conference on Software Maintenance (pp. 70–79). IEEE.
13. Wei, F., Roy, S., Ou, X., & Robby. (2014). Amandroid: A precise and general inter-component data flow analysis framework for security vetting of Android apps. In Proceedings of the 2014 ACM SIGSAC Conference on Computer and Communications Security (pp. 1329–1341). ACM.
14. Octeau, D., McDaniel, P., Jha, S., & Bartel, A. (2012). Effective inter-component communication mapping in Android with Epicc: An essential step towards holistic security analysis. In Proceedings of the 21st USENIX Security Symposium. USENIX Association.
15. Runeson, P., & Höst, M. (2009). Guidelines for conducting and reporting case study research in software engineering. Empirical Software Engineering, 14(2), 131–164.
16. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M. C., Regnell, B., & Wesslén, A. (2012). Experimentation in software engineering. Springer.
17. Kitchenham, B. A., Pfleeger, S. L., Pickard, L. M., Jones, P. W., Hoaglin, D. C., El Emam, K., & Rosenberg, J. (2002). Preliminary guidelines for empirical research in software engineering. IEEE Transactions on Software Engineering, 28(8), 721–734.
18. Raudenbush, S. W., & Bryk, A. S. (2002). Hierarchical linear models: Applications and data analysis methods (2nd ed.). Sage.
19. Easterbrook, S., Singer, J., Storey, M.-A., & Damian, D. (2008). Selecting empirical methods for software engineering research. In F. Shull, J. Singer, & D. I. K. Sjøberg (Eds.), Guide to advanced empirical software engineering (pp. 285–311). Springer.
Downloads
Published
Issue
Section
License
Copyright (c) 2023 Computer Science and Engineering Transactions

This work is licensed under a Creative Commons Attribution 4.0 International License.
