Skip to main content

Graph Grammar Extraction from Source Code

  • Conference paper
  • First Online:
Book cover Formal Methods: Foundations and Applications (SBMF 2017)

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

Included in the following conference series:

Abstract

We present an approach for the extraction of Graph Grammars (GGs) from Java source code. A GG consists of an initial graph, describing the initial state of a system, and a set of rules, modeling the possible changes of state. We generate a GG based on execution traces collected from annotated code, following the main ideas from an existing approach for extracting Labelled Transition Systems (LTS) based on context information (combination of block of code, values of attributes, and evaluated path conditions). Since GGs are data-driven, in contrast to the action-based formalism of LTS, we have adapted the existing technique to focus on data information. The approach is partially supported by a tool and the generated GGs can serve as input to existing analysis tools. We illustrate the approach with a case study and compare the resulting GG with a GG manually created by an expert for the same system.

This work is partially supported by CNPq/Brazil.

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 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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

References

  1. Alshanqiti, A., Heckel, R.: Towards dynamic reverse engineering visual contracts from Java. Electron. Commun. EASST 67, 1–12 (2014)

    Google Scholar 

  2. Clarke Jr., E.M., Grumberg, O., Peled, D.A.: Model Checking. MIT Press, Cambridge (1999)

    Google Scholar 

  3. Cook, J.E., Wolf, A.L.: Discovering models of software processes from event-based data. ACM Trans. Softw. Eng. Methodol. 7(3), 215–249 (1998)

    Article  Google Scholar 

  4. Cordy, J.R., Dean, T.R., Malton, A.J., Schneider, K.A.: Source transformation in software engineering using the TXL transformation system. Inf. Softw. Technol. 44(13), 827–837 (2002)

    Article  Google Scholar 

  5. Corradini, A., Dotti, F.L., Foss, L., Ribeiro, L.: Translating Java code to graph transformation systems. In: Ehrig, H., Engels, G., Parisi-Presicce, F., Rozenberg, G. (eds.) ICGT 2004. LNCS, vol. 3256, pp. 383–398. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30203-2_27

    Chapter  Google Scholar 

  6. da Costa Cavalheiro, S.A., Foss, L., Ribeiro, L.: Theorem proving graph grammars with attributes and negative application conditions. Theor. Comput. Sci. 686, 25–77 (2017). https://doi.org/10.1016/j.tcs.2017.04.010

  7. Dotti, F.L., Ribeiro, L., dos Santos, O.M., Pasini, F.: Verifying object-based graph grammars. Soft. Syst. Model. 5(3), 289–311 (2006)

    Article  Google Scholar 

  8. Duarte, L.M.: Behaviour Model Extraction using Context Information. Ph.D. thesis, Imperial College London, University of London, November 2007

    Google Scholar 

  9. Duarte, L.M., Kramer, J., Uchitel, S.: Using contexts to extract models from code. Softw. Syst. Model. 16(2), 523–557 (2017)

    Article  Google Scholar 

  10. Duarte, L.M., Kramer, J., Uchitel, S.: Towards faithful model extraction based on contexts. In: Fiadeiro, J.L., Inverardi, P. (eds.) FASE 2008. LNCS, vol. 4961, pp. 101–115. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78743-3_9

    Chapter  Google Scholar 

  11. Ehrig, H., Engels, G., Kreowski, H.J., Rozenberg, G. (eds.): Handbook of Graph Grammars and Computing by Graph Transformation, Applications, Languages, and Tools, vol. II. World Scientific, Singapore (1999)

    Google Scholar 

  12. Ernst, M.D.: Static and dynamic analysis: Synergy and duality. In: Workshop on Dynamic Analysis, Portland, OR, USA, pp. 24–27, May 2003

    Google Scholar 

  13. Henzinger, T., Jahla, R., Majumdar, R., Sutre, G.: Lazy abstraction. In: ACM Symposium on Principles of Programming Languages, pp. 58–70. ACM Press, Portland, January 2002

    Google Scholar 

  14. Holzmann, G., Smith, M.: A practical method for verifying event-driven software. In: International Conference on Software Engineering, pp. 597–607. ACM, New York, May 1999

    Google Scholar 

  15. Keller, R.: Formal verification of parallel programs. Commun. ACM 19(7), 371–384 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  16. Lorenzoli, D., Mariani, L., Pezze, M.: Inferring state-based behavior models. In: WODA 2006: Proceedings of the 2006 International Workshop on Dynamic Systems Analysis, pp. 25–32. ACM Press, New York (2006)

    Google Scholar 

  17. de Oliveira, M., Ribeiro, L., Mauro Duarte, L., Cota, E.: Specification of models based on contexts using graph grammars. In: 2013 2nd Workshop-School on Theoretical Computer Science (WEIT), pp. 129–134, October 2013

    Google Scholar 

  18. Rensink, A.: The GROOVE simulator: a tool for state space generation. In: Pfaltz, J.L., Nagl, M., Böhlen, B. (eds.) AGTIVE 2003. LNCS, vol. 3062, pp. 479–485. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-25959-6_40

    Chapter  Google Scholar 

  19. Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformation: Foundations, vol. I. World Scientific, Singapore (1997)

    Google Scholar 

  20. Taentzer, G.: AGG: a graph transformation environment for modeling and validation of software. In: Pfaltz, J.L., Nagl, M., Böhlen, B. (eds.) AGTIVE 2003. LNCS, vol. 3062, pp. 446–453. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-25959-6_35

    Chapter  Google Scholar 

  21. Walkinshaw, N., Taylor, R., Derrick, J.: Inferring extended finite state machine models from software executions. In: 20th Working Conference on Reverse Engineering (WCRE), pp. 301–310 (2013)

    Google Scholar 

  22. Zhao, C., Kong, J., Zhang, K.: Program behavior discovery and verification: a graph grammar approach. IEEE Trans. Softw. Eng. 36(3), 431–448 (2010)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lucio Mauro Duarte .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Duarte, L.M., Ribeiro, L. (2017). Graph Grammar Extraction from Source Code. In: Cavalheiro, S., Fiadeiro, J. (eds) Formal Methods: Foundations and Applications. SBMF 2017. Lecture Notes in Computer Science(), vol 10623. Springer, Cham. https://doi.org/10.1007/978-3-319-70848-5_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-70848-5_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-70847-8

  • Online ISBN: 978-3-319-70848-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics