Advertisement

Extended Code Coverage for AspectJ-Based Runtime Verification Tools

  • Omar Javed
  • Yudi Zheng
  • Andrea Rosà
  • Haiyang Sun
  • Walter Binder
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10012)

Abstract

Many runtime verification tools for the Java virtual machine rely on aspect-oriented programming, particularly on AspectJ, to weave the verification logic into the observed program. However, AspectJ imposes several limitations on the verification tools, such as a restricted join point model and the inability of weaving certain classes, particularly the Java and Android class libraries. In this paper, we show that our domain-specific aspect language DiSL can overcome these limitations. While offering a programming model akin to AspectJ, DiSL features an extensible join point model and ensures weaving with complete bytecode coverage for Java and Android. We present a new compiler that translates runtime-verification aspects written in AspectJ to DiSL. Hence, it is possible to use existing, unmodified runtime verification tools on top of the DiSL framework to bypass the limitations of AspectJ. As a case study, we show that the AspectJ-based runtime verification tool JavaMOP significantly benefits from the automated translation of AspectJ to DiSL code, gaining increased code coverage. Thanks to DiSL, JavaMOP analyses are able to unveil violations in the Java class library that cannot be detected when using AspectJ.

Notes

Acknowledgement

The research presented in this paper was supported by Oracle (ERO project 1332), by the Swiss National Science Foundation (project 200021\(\_\)141002), by the European Commission (contract ACP2-GA-2013-605442), and by the Swiss Government Excellence Scholarship (ESKAS-Nr: 2015.0989).

References

  1. 1.
    Jin, D., Meredith, P.O.N., Lee, C., Roşu, G.: JavaMOP: efficient parametric runtime monitoring framework. In: ICSE, pp. 1427–1430 (2012)Google Scholar
  2. 2.
    Colombo, C., Pace, G.J., Schneider, G.: LARVA–safer monitoring of real-time Java programs (tool paper). In: SEFM, pp. 33–37 (2009)Google Scholar
  3. 3.
    Bodden, E., Hendren, L., Lam, P., Lhoták, O., Naeem, N.A.: Collaborative runtime verification with tracematches. In: Sokolsky, O., Taşıran, S. (eds.) RV 2007. LNCS, vol. 4839, pp. 22–37. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-77395-5_3 CrossRefGoogle Scholar
  4. 4.
    Reger, G., Cruz, H.C., Rydeheard, D.: MarQ: monitoring at runtime with QEA. In: Baier, C., Tinelli, C. (eds.) TACAS 2015. LNCS, vol. 9035, pp. 596–610. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46681-0_55 Google Scholar
  5. 5.
    Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–354. Springer, Heidelberg (2001). doi: 10.1007/3-540-45337-7_18 CrossRefGoogle Scholar
  6. 6.
    Xiang, C., Qi, Z., Binder, W.: Flexible and extensible runtime verification for Java (Extended Version). Int. J. Softw. Eng. Knowl. Eng. 25, 1595–1609 (2015)CrossRefGoogle Scholar
  7. 7.
    Marek, L., Villazón, A., Zheng, Y., Ansaloni, D., Binder, W., Qi, Z.: DiSL: a domain-specific language for bytecode instrumentation. In: AOSD, pp. 239–250 (2012)Google Scholar
  8. 8.
    Binder, W., Moret, P., Tanter, É., Ansaloni, D.: Polymorphic bytecode instrumentation. Softw. Pract. Exp. (2015) doi: 10.1002/spe.2385
  9. 9.
    Marek, L., Kell, S., Zheng, Y., Bulej, L., Binder, W., Tůma, P., Ansaloni, D., Sarimbekov, A., Sewe, A.: ShadowVM: robust and comprehensive dynamic program analysis for the Java platform. In: GPCE, pp. 105–114 (2013)Google Scholar
  10. 10.
    Kell, S., Ansaloni, D., Binder, W., Marek, L.: The JVM is not observable enough (and What to do about it). In: VMIL, pp. 33–38 (2012)Google Scholar
  11. 11.
    Sun, H., Zheng, Y., Bulej, L., Villazón, A., Qi, Z., Tůma, P., Binder, W.: A programming model and framework for comprehensive dynamic analysis on Android. In: MODULARITY, pp. 133–145 (2015)Google Scholar
  12. 12.
    Zheng, Y., Kell, S., Bulej, L., Sun, H., Binder, W.: Comprehensive multi-platform dynamic program analysis for Java and Android. IEEE Softw. 33, 55–63 (2016)CrossRefGoogle Scholar
  13. 13.
    Moret, P., Binder, W., Tanter, E.: Polymorphic bytecode instrumentation. In: AOSD, pp. 129–140 (2011)Google Scholar
  14. 14.
    Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: Abc: an extensible AspectJ compiler. In: AOSD, pp. 87–98 (2005)Google Scholar
  15. 15.
    Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: an extensible compiler framework for Java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003). doi: 10.1007/3-540-36579-6_11 CrossRefGoogle Scholar
  16. 16.
    Vallée-Rai, R., Gagnon, E., Hendren, L., Lam, P., Pominville, P., Sundaresan, V.: Optimizing Java bytecode using the Soot framework: is it feasible? In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 18–34. Springer, Heidelberg (2000). doi: 10.1007/3-540-46423-9_2 CrossRefGoogle Scholar
  17. 17.
    Arzt, S., Rasthofer, S., Bodden, E.: Instrumenting Android and Java applications as easy as abc. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 364–381. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-40787-1_26 CrossRefGoogle Scholar
  18. 18.
    Seyster, J., Dixit, K., Huang, X., Grosu, R., Havelund, K., Smolka, S.A., Stoller, S.D., Zadok, E.: InterAspect: aspect-oriented instrumentation with GCC. Formal Methods Syst. Des. 41, 295–320 (2012)CrossRefzbMATHGoogle Scholar
  19. 19.
    Falcone, Y., Currea, S.: Weave droid: aspect-oriented programming on Android devices: fully embedded or in the cloud. In: ASE, pp. 350–353 (2012)Google Scholar
  20. 20.
    Bodden, E.: Easily instrumenting Android applications for security purposes. In: CCS, pp. 1499–1502 (2013)Google Scholar
  21. 21.
    Falcone, Y., Currea, S., Jaber, M.: Runtime verification and enforcement for Android applications with RV-Droid. In: Qadeer, S., Tasiran, S. (eds.) RV 2012. LNCS, vol. 7687, pp. 88–95. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-35632-2_11 CrossRefGoogle Scholar
  22. 22.
    Daian, P., Falcone, Y., Meredith, P., Şerbănuţă, T.F., Shiriashi, S., Iwai, A., Rosu, G.: RV-Android: efficient parametric Android runtime verification, a brief tutorial. In: Bartocci, E., Majumdar, R. (eds.) RV 2015. LNCS, vol. 9333, pp. 342–357. Springer, Heidelberg (2015). doi: 10.1007/978-3-319-23820-3_24 CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Omar Javed
    • 1
  • Yudi Zheng
    • 1
  • Andrea Rosà
    • 1
  • Haiyang Sun
    • 1
  • Walter Binder
    • 1
  1. 1.Faculty of InformaticsUniversità della Svizzera Italiana (USI)LuganoSwitzerland

Personalised recommendations