Skip to main content
Log in

ANCHOR: locating android framework-specific crashing faults

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Android framework-specific app crashes are hard to debug. Indeed, the callback-based event-driven mechanism of Android challenges crash localization techniques that are developed for traditional Java programs. The key challenge stems from the fact that the buggy code location may not even be listed within the stack trace. For example, our empirical study on 500 framework-specific crashes from an open benchmark has revealed that 37 percent of the crash types are related to bugs that are outside the stack traces. Moreover, Android programs are a mixture of code and extra-code artifacts such as the Manifest file. The fact that any artifact can lead to failures in the app execution creates the need to position the localization target beyond the code realm. In this paper, we propose Anchor , a two-phase suspicious bug location suggestion tool. Anchor specializes in finding crash-inducing bugs outside the stack trace. Anchor is lightweight and source code independent since it only requires the crash message and the apk file to locate the fault. Experimental results, collected via cross-validation and in-the-wild dataset evaluation, show that Anchor is effective in locating Android framework-specific crashing faults. Finally, we put our empirical study results openly accessible at https://github.com/anchor-locator/anchor.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. Kotlin has also been widely used in recent years as an alternative for Android app development, it is designed to fully interoperate with Java.

  2. https://github.com/y20k/transistor/issues/21.

  3. Android framework methods are not visible or understandable to general developers, hence greater challenge is acknowledged for locating framework-specific crashes compared to developer-written methods. Fan et al. (2018b), Kong et al. (2019).

  4. https://developer.android.com/reference.

  5. https://stackoverflow.com.

  6. https://github.com.

  7. The Main Activity of an app is the first screen shown to the user when launched.

References

  • Abreu, R., Zoeteweij, P., Van Gemund, A.J.: On the accuracy of spectrum-based fault localization. In: Testing: Academic and Industrial Conference Practice and Research Techniques-MUTATION (TAICPART-MUTATION 2007), IEEE, pp. 89–98 (2007)

  • Abreu, R., Zoeteweij, P., Golsteijn, R., Van Gemund, A.J.: A practical evaluation of spectrum-based fault localization. J. Syst. Softw. 82(11), 1780–1792 (2009a)

    Article  Google Scholar 

  • Abreu, R., Zoeteweij, P., Van Gemund, A.J.: Spectrum-based multiple fault localization. In: 2009 IEEE/ACM International Conference on Automated Software Engineering, IEEE, pp. 88–99 (2009b)

  • Allix, K., Bissyande, T.F., Klein. J., Traon, Y.L.: AndroZoo: Collecting Millions of Android Apps for the Research Community. In: 2016 IEEE/ACM 13th Working Conference on Mining Software Repositories (MSR), pp 468–471, (2016) https://doi.org/10.1109/MSR.2016.056

  • Arzt, S., Rasthofer, S., Fritz, C., Bodden, E., Bartel, A., Klein, J., Le Traon, Y., Octeau, D., McDaniel, P.: Flowdroid: Precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for android apps. ACM Sigplan Not. ACM 49, 259–269 (2014)

    Article  Google Scholar 

  • Bartel, A., Klein, J., Le Traon, Y., Monperrus, M.: Dexpler: converting android dalvik bytecode to jimple for static analysis with soot. In: Proceedings of the ACM SIGPLAN International Workshop on State of the Art in Java Program analysis, pp 27–38 (2012)

  • Bielik, P., Raychev, V., Vechev, M.: Scalable race detection for android applications. ACM SIGPLAN Not. 50(10), 332–348 (2015)

    Article  Google Scholar 

  • Fan, L., Su, T., Chen, S., Meng, G., Liu, Y., Xu, L., Pu, G.: Efficiently manifesting asynchronous programming errors in android apps. In: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp 486–497 (2018a)

  • Fan, L., Su, T., Chen, S., Meng, G., Liu, Y., Xu, L., Pu, G., Su, Z.: Large-scale analysis of framework-specific exceptions in android apps. In: Proceedings of the 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE), IEEE, pp 408–419 (2018b)

  • Fraunhofer (2020) Codeinspect tool of fraunhofer. https://codeinspect.sit.fraunhofer.de/

  • Gómez, M., Rouvoy, R., Adams, B., Seinturier, L.: Reproducing context-sensitive crashes of mobile apps using crowdsourced monitoring. In: International Conference on Mobile Software Engineering and Systems (2016)

  • Google (2020) Crashes | android developers. https://developer.android.com/topic/performance/vitals/crash

  • Gu, Y., Xuan, J., Zhang, H., Zhang, L., Fan, Q., Xie, X., Qian, T.: Does the fault reside in a stack trace? assisting crash localization by predicting crashing fault residence. J. Syst. Softw. 148, 88–104 (2019)

    Article  Google Scholar 

  • Huang, Y., Li, L.: Naive bayes classification algorithm based on small sample set. In: 2011 IEEE International Conference on Cloud Computing and Intelligence Systems, IEEE, pp 34–39 (2011)

  • Inc A: Diagnosing and resolving bugs in your running app. https://developer.apple.com/documentation/xcode/diagnosing_and_resolving_bugs_in_your_running_app

  • Indi, T.S., Yalagi, P.S., Nirgude, M.A.: Use of java exception stack trace to improve bug fixing skills of intermediate java learners. In: 2016 International Conference on Learning and Teaching in Computing and Engineering (LaTICE), IEEE, pp 194–198 (2016)

  • Jiang, S., Zhang, H., Wang, Q., Zhang, Y.: A debugging approach for java runtime exceptions based on program slicing and stack traces. In: 2010 10th International Conference on Quality Software, IEEE, pp 393–398 (2010)

  • 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, ACM, pp 273–282 (2005)

  • Kang, H., Jeong, K., Lee, K., Park, S., Kim, Y.: Android rmi: a user-level remote method invocation mechanism between android devices. J. Supercomput. 72(7), 2471–2487 (2016)

    Article  Google Scholar 

  • Kim, D., Wang, X., Kim, S., Zeller, A., Cheung, S.C., Park, S.: Which crashes should i fix first?: Predicting top crashes at an early stage to prioritize debugging efforts. IEEE Trans. Softw. Eng. 37(3), 430–447 (2011)

    Article  Google Scholar 

  • Kong, P., Li, L., Gao, J., Bissyandé, T.F., Klein, J.: Mining android crash fixes in the absence of issue- and change-tracking systems. In: International Symposium on Software Testing and Analysis (ISSTA), ACM, pp 78–89 (2019)

  • Koyuncu, A., Liu, K., Bissyandé, T.F., Kim, D., Monperrus, M., Klein, J., Le Traon, Y.: ifixr: bug report driven program repair. In: Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ACM, pp 314–325 (2019)

  • Lal, S., Sureka, A.: A static technique for fault localization using character n-gram based information retrieval model. In: Proceedings of the 5th India Software Engineering Conference, pp 109–118 (2012)

  • Li, L., Bartel, A., Bissyandé, T.F., Klein, J., Le Traon, Y., Arzt, S., Rasthofer, S., Bodden, E., Octeau, D., McDaniel, P.: Iccta: Detecting inter-component privacy leaks in android apps. In: Proceedings of the 37th International Conference on Software Engineering-Volume 1, IEEE Press, pp 280–291 (2015)

  • Li, L., Bissyandé, T.F., Octeau, D., Klein, J.: Droidra: Taming reflection to support whole-program analysis of android apps. In: The 2016 International Symposium on Software Testing and Analysis (ISSTA 2016) (2016a)

  • Li, L., Bissyandé, T.F., Papadakis, M., Rasthofer, S., Bartel, A., Octeau, D., Klein, J., Le Traon, Y.: Static analysis of android apps: a systematic literature review. Inf. Softw. Technol. 88, 67–95 (2017a)

    Article  Google Scholar 

  • Li, L., Gao, J., Hurier, M., Kong, P., Bissyandé, T.F., Bartel, A., Klein, J., Le Traon, Y.: Androzoo++: Collecting millions of android apps and their metadata for the research community. (2017b) arXiv preprint arXiv:170905281

  • Li, L., Bissyandé, T.F., Wang, H., Klein, J.: Cid: Automating the detection of api-related compatibility issues in android apps. In: The ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2018) (2018)

  • Li, Q., Jiang, Y., Gu, T., Xu, C., Ma, J., Ma, X., Lu, J.: Effectively manifesting concurrency bugs in android apps. In: 2016 23rd Asia-Pacific Software Engineering Conference (APSEC), IEEE, pp 209–216 (2016b)

  • LLC G: Codenames, tags, and build numbers. https://source.android.com/setup/start/build-numbers

  • LLC G App manifest overview. (2020a) https://developer.android.com/guide/topics/manifest/manifest-intro, Accessed: 2020-01-26

  • LLC G Test google play billing. (2020b) https://developer.android.com/google/play/billing/billing_testing.html, Accessed: 2020-01-26

  • Maiya, P., Kanade, A., Majumdar, R.: Race detection for android applications. ACM SIGPLAN Not. 49(6), 316–325 (2014)

    Article  Google Scholar 

  • Maji, A.K., Arshad, F.A., Bagchi, S., Rellermeyer, J.S.: An empirical study of the robustness of inter-component communication in android. In: IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2012), IEEE, pp 1–12 (2012)

  • Martin, W., Sarro, F., Jia, Y., Zhang, Y., Harman, M.: A survey of app store analysis for software engineering. IEEE Trans. Softw. Eng. 43(9), 817–847 (2016)

    Article  Google Scholar 

  • Metsis, V., Androutsopoulos, I., Paliouras, G.: Spam filtering with naive bayes-which naive bayes? CEAS Mountain View CA 17, 28–69 (2006)

    Google Scholar 

  • Miller, R., Siegmund, D.: Maximally selected chi square statistics. Biometrics, pp. 1011–1016 (1982)

  • Moran, K., Linares-Vásquez, M., Bernal-Cárdenas, C., Vendome, C., Poshyvanyk, D.: Automatically discovering, reporting and reproducing android application crashes. In: Software Testing, Verification and Validation (ICST), 2016 IEEE International Conference on, IEEE, pp 33–44 (2016)

  • Octeau, D., Luchaup, D., Dering, M., Jha, S., McDaniel, P.: Composite constant propagation: Application to android inter-component communication analysis. In: Proceedings of the 37th International Conference on Software Engineering-Volume 1, IEEE Press, pp 77–88 (2015)

  • Qin, J., Wang, W., Lu, Y., Xiao, C., Lin, X.: Efficient exact edit similarity query processing with the asymmetric signature scheme. In: Proceedings of the 2011 ACM SIGMOD International Conference on Management of data, pp 1033–1044 (2011)

  • Rish, I., et al.: An empirical study of the naive bayes classifier. In: IJCAI 2001 Workshop on Empirical Methods in Artificial Intelligence, vol 3, pp 41–46 (2001)

  • Schroter, A., Schröter, A., Bettenburg, N., Premraj, R.: Do stack traces help developers fix bugs? In: 2010 7th IEEE Working Conference on Mining Software Repositories (MSR 2010), IEEE, pp 118–121 (2010)

  • Shi Y, Karatzoglou A, Baltrunas L, Larson M, Oliver N, Hanjalic A (2012) Climf: learning to maximize reciprocal rank with collaborative less-is-more filtering. In: Proceedings of the sixth ACM conference on Recommender systems, pp 139–146

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

  • Song, W., Zhang, J., Huang, J.: Servdroid: detecting service usage inefficiencies in android applications. In: Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp 362–373 (2019)

  • Su, T., Fan, L., Chen, S., Liu, Y., Xu, L., Pu, G., Su, Z.: Why my app crashes understanding and benchmarking framework-specific exceptions of android apps. In: IEEE Transactions on Software Engineering (2020)

  • Tan, S.H., Dong, Z., Gao, X., Roychoudhury, A.: Repairing crashes in android apps. In: Proceedings of the 40th International Conference on Software Engineering, ACM, pp 187–198 (2018)

  • Tang, H., Wu, G., Wei, J., Zhong, H.: Generating test cases to expose concurrency bugs in android applications. In: Proceedings of the 31st IEEE/ACM international Conference on Automated software engineering, pp 648–653 (2016)

  • Verge T: How to stop facebook’s ios bug from crashing spotify, pinterest, tinder, and other apps. https://www.theverge.com/21319817/facebook-ios-sdk-bug-fix-spotify-pinterest-tinder-crash-iphone-ios

  • Walton, N.A., Poynton, M.R., Gesteland, P.H., Maloney, C., Staes, C., Facelli, J.C.: Predicting the start week of respiratory syncytial virus outbreaks using real time weather variables. BMC Med. Inform. Dec. Mak. 10(1), 68 (2010)

    Article  Google Scholar 

  • Wang, J., Jiang, Y., Xu, C., Li, Q., Gu, T., Ma, J., Ma, X., Lu, J.: Aatt+: effectively manifesting concurrency bugs in android apps. Sci. Comput. Program. 163, 1–18 (2018)

    Article  Google Scholar 

  • Wang, Q., Parnin, C., Orso, A.: Evaluating the usefulness of ir-based fault localization techniques. In: Proceedings of the 2015 International Symposium on Software Testing and Analysis, pp 1–11 (2015)

  • Wei, L., Liu, Y., Cheung, S.C.: Taming android fragmentation: Characterizing and detecting compatibility issues for android apps. In: Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, ACM, pp 226–237 (2016)

  • Wong, C.P., Xiong, Y., Zhang, H., Hao, D., Zhang, L., Mei, H.: Boosting bug-report-oriented fault localization with segmentation and stack-trace analysis. In: 2014 IEEE International Conference on Software Maintenance and Evolution, IEEE, pp 181–190 (2014)

  • Wong, W.E., Gao, R., Li, Y., Abreu, R., Wotawa, F.: A survey on software fault localization. IEEE Trans. Softw. Eng. 42(8), 707–740 (2016)

    Article  Google Scholar 

  • Wu, R., Zhang, H., Cheung, S.C., Kim, S.: Crashlocator: locating crashing faults based on crash stacks. In: Proceedings of the 2014 International Symposium on Software Testing and Analysis, ACM, pp 204–214 (2014)

  • Wu, T., Liu, J., Xu, Z., Guo, C., Zhang, Y., Yan, J., Zhang, J.: Light-weight, inter-procedural and callback-aware resource leak detection for android apps. IEEE Trans. Softw. Eng. 42(11), 1054–1076 (2016)

    Article  Google Scholar 

  • Yang, S., Yan, D., Wu, H., Wang, Y., Rountev, A.: Static control-flow analysis of user-driven callbacks in android applications. In: 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, IEEE, vol 1, pp 89–99 (2015)

  • Yang, Z., Yang, M.: Leakminer: Detect information leakage on android with static taint analysis. In: 2012 Third World Congress on Software Engineering, IEEE, pp 101–104 (2012)

  • Yang, Z., Nie, X., Xu, W., Guo, J.: An approach to spam detection by naive bayes ensemble based on decision induction. In: Sixth International Conference on Intelligent Systems Design and Applications, IEEE, vol 2, pp 861–866 (2006)

  • Zhao, Y., Yu, T., Su, T., Liu, Y., Zheng, W., Zhang, J., Halfond, W.G.: Recdroid: automatically reproducing android application crashes from bug reports. In: Proceedings of the 41st International Conference on Software Engineering, IEEE Press, pp 128–139 (2019)

  • Zhou, J., Zhang, H., Lo, D.: Where should the bugs be fixed? more accurate information retrieval-based bug localization based on bug reports. In: 2012 34th International Conference on Software Engineering (ICSE), IEEE, pp 14–24 (2012)

Download references

Acknowledgements

This work was supported by the Fonds National de la Recherche (FNR), Luxembourg, under CORE projects CHARACTERIZE C17/IS/11693861 and RECOMMEND 15/IS/10449467, and AFR-PhD project 11620657.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Li Li.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kong, P., Li, L., Gao, J. et al. ANCHOR: locating android framework-specific crashing faults. Autom Softw Eng 28, 10 (2021). https://doi.org/10.1007/s10515-021-00290-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10515-021-00290-1

Keywords

Navigation