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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Alshanqiti, A., Heckel, R.: Towards dynamic reverse engineering visual contracts from Java. Electron. Commun. EASST 67, 1–12 (2014)
Clarke Jr., E.M., Grumberg, O., Peled, D.A.: Model Checking. MIT Press, Cambridge (1999)
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)
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)
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
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
Dotti, F.L., Ribeiro, L., dos Santos, O.M., Pasini, F.: Verifying object-based graph grammars. Soft. Syst. Model. 5(3), 289–311 (2006)
Duarte, L.M.: Behaviour Model Extraction using Context Information. Ph.D. thesis, Imperial College London, University of London, November 2007
Duarte, L.M., Kramer, J., Uchitel, S.: Using contexts to extract models from code. Softw. Syst. Model. 16(2), 523–557 (2017)
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
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)
Ernst, M.D.: Static and dynamic analysis: Synergy and duality. In: Workshop on Dynamic Analysis, Portland, OR, USA, pp. 24–27, May 2003
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
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
Keller, R.: Formal verification of parallel programs. Commun. ACM 19(7), 371–384 (1976)
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)
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
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
Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformation: Foundations, vol. I. World Scientific, Singapore (1997)
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
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)
Zhao, C., Kong, J., Zhang, K.: Program behavior discovery and verification: a graph grammar approach. IEEE Trans. Softw. Eng. 36(3), 431–448 (2010)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
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)