Abstract
We present a static analysis-based technique for reverse engineering finite state machine models from a large subset of sequential Java programs. Our approach enumerates all feasible program paths in a class using symbolic execution and records execution summary for each path. Subsequently, it creates states and transitions by analyzing symbolic execution summaries. Our approach also detects any unhandled exceptions.
Similar content being viewed by others
Notes
Symbolic execution has inherent limitations, which makes it infeasible to explore all paths of an arbitrary method in the presence of loops and recursions. We discuss implementation details of our symbolic execution engine in Sect. 4.
References
Beydeda, S., Gruhn, V.: Black- and white-box self-testing cots components. In: International Conference on Software Engineering and Knowledge Engineering, pp. 104–109 (2004)
Corbett, J.C., Dwyer, M.B., Hatcliff, J., Laubach, S., Pasareanu, C.S., Zheng, H.: Bandera: extracting finite-state models from Java source code. In: Proceedings of ICSE, pp. 439–448 (2000)
Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: Proceedings of the 2006 International Workshop on Dynamic Systems Analysis, WODA ’06, pp. 17–24 (2006)
Guéhéneuc, Y.G.: Automated reverse-engineering of UML v2.0 dynamic models. In: Proceedings of the 6th ECOOP Workshop on Object-Oriented Reengineering (2005)
Gallagher, L., Offutt, J., Cincotta, A.: Integration testing of object-oriented components using finite state machines. Softw. Test. Verif. Reliab. 16(4), 215–266 (2006)
Harel, D.: Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8(3) (1987)
Graphviz—graph visualization software. http://www.graphviz.org
Java pathfinder. http://goo.gl/reTQe
King, J.C.: Symbolic execution and program testing. Commun. ACM 19, 385–394 (1976)
Koskimies, K., Mäkinen, E.: Automatic synthesis of state machines from trace diagrams. Softw. Pract. Exp. 24(7), 643–658 (1994)
Koskimies, K., Systa, T., Tuomi, J., Mannisto, T.: Automated support for modeling OO software. Software, IEEE 15(1), 87–94 (1998)
Kung, D.C., Suchak, N., Gao, J., Hsia, P., Toyoshima, Y., Chen, C.: On object state testing. In: Proceedings of Computer Software and Applications Conference, pp. 222–227. IEEE Computer Society Press (1994)
Larsen, L. Harrold, M.J.: Slicing object-oriented software. In: ICSE, pp. 495–505 (1996)
Logozzo, F., Fähndrich, M.: On the relative completeness of bytecode analysis versus source code analysis. In: Proceedings of CC ’08, LNCS (2008)
Pasareanu, C.S., Mehlitz, P.C., Bushnell, D.H., Gundy-Burlet, K., Lowry, M.R., Person, S., Pape, M.: Combining unit-level symbolic execution and system-level concrete execution for testing nasa software. In: ISSTA, pp. 15–26 (2008)
Peterson, J.L.: Petri Net Theory and the Modeling of Systems. Prentice Hall PTR, Upper Saddle River (1981)
Sen, T., Mall, R.: State-model-based regression test reduction for component-based software. ISRN J. Softw. Eng. 2012, 1–9 (2012). Article No 561502. doi:10.5402/2012/561502
Somé, S.S., Lethbridge, T.: Enhancing program comprehension with recovered state models. In: IWPC, pp. 85–96 (2002)
Suman, R.R., Mall, R., Sukumaran, S., Satpathy, M.: Extracting state models for black-box software components. J. Object Technol. 9(3), 79–103 (2010)
Systä, T., Koskimies, K., Müller, H.: Shimba-an environment for reverse engineering java software systems. Softw. Pract. Exp. 31(4), 371–394 (2001)
Tonella, P., Potrich, A.: Reverse Engineering of Object Oriented code. Springer, Berlin (2005)
Wagner, S., Jürjens, J.: Model-based identification of fault-prone components. In: EDCC, pp. 435–452 (2005)
Walkinshaw, N., Bogdanov, K., Ali, S., Holcombe, M.: Automated discovery of state transitions and their functions in source code. Softw. Test. Verif. Reliab. 18(2), 99–121 (2008)
Walkinshaw, N., Bogdanov, K., Holcombe, M., Salahuddin, S.: Reverse engineering state machines by interactive grammar inference. In: 14th Working Conference on Reverse Engineering, 2007. WCRE 2007, pp. 209–218. IEEE (2007)
Xie, T., Marinov, D., Schulte, W., Notkin, D.: Symstra: A framework for generating object-oriented unit tests using symbolic execution. In: Proceedings of the 11th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS’05, pp. 365–381 (2005)
Xie, T., Notkin, D.: Automatic extraction of object-oriented observer abstractions from unit-test executions. In: ICFEM, pp. 290–305 (2004)
Acknowledgments
We are thankful to the anonymous reviewers who provided thoughtful comments on our work which, we believe, have greatly enriched this work.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by Prof. Gary Leavens.
Rights and permissions
About this article
Cite this article
Sen, T., Mall, R. Extracting finite state representation of Java programs. Softw Syst Model 15, 497–511 (2016). https://doi.org/10.1007/s10270-014-0415-3
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10270-014-0415-3