Interactive Measures for Mining Understandable State Machines from Embedded Software: Experiments and Case Studies

  • Wasim SaidEmail author
  • Jochen Quante
  • Rainer Koschke
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 991)


State machines are a commonly used formalism for specifying the behavior of a software component, which could also be helpful for program comprehension. Therefore, it is desirable to extract state machine models from code and also from legacy models. The main drawback of fully-automatic state machine mining approaches is that the mined models are too detailed and not understandable. In our previous work [1], we presented different measures for the interaction with the state machine extraction process, such as selecting a subset of state variables, reducing the state variable range and providing additional user constraints. These measures aimed to reduce the complexity of the mined state machines to an understandable degree. In this article, which is an extended version of [1], we evaluate the approach through a case study with twelve professional developers from the automotive supplier company Bosch. The study shows that adding our interactive measures to the model mining process leads to understandable state machines, which can be very helpful in a rich set of use cases in addition to program comprehension, such as debugging, validation and verification. Furthermore, we conduct an experiment to evaluate the required computation time of the interactive measures against the fully-automatic mining. The experiment shows that the interactive approach can drastically reduce the computation time.


Model mining Program comprehension Software analysis Static analysis Reverse engineering User interaction State machines 


  1. 1.
    Said, W., Quante, J., Koschke, R.: Towards interactive mining of understandable state machine models from embedded software. In: Proceedings of the 6th International Conference on Model-Driven Engineering and Software Development: MODELSWARD, vol. 1, pp. 117–128 (2018)Google Scholar
  2. 2.
    Fjeldstad, R.K., Hamlen, W.T.: Application program maintenance study: report to our respondents. In: Proceedings of GUIDE 48 (1984)Google Scholar
  3. 3.
    Ko, A.J., Myers, B.A., Coblenz, M.J., Aung, H.H.: An exploratory study of how developers seek, relate, and collect relevant information during software maintenance tasks. IEEE Trans. Softw. Eng. 32, 971–987 (2006)CrossRefGoogle Scholar
  4. 4.
    Minelli, R., Mocci, A., Lanza, M.: I know what you did last summer: an investigation of how developers spend their time. In: Proceedings of 23rd International Conference on Program Comprehension, pp. 25–35 (2015)Google Scholar
  5. 5.
    Roehm, T., Tiarks, R., Koschke, R., Maalej, W.: How do professional developers comprehend software? In: Proceedings of 34th ICSE, pp. 255–265 (2012)Google Scholar
  6. 6.
    Broy, M., Kirstan, S., Krcmar, H., Schätz, B., Zimmermann, J.: What is the benefit of a model-based design of embedded software systems in the car industry? In: Software Design and Development: Concepts, Methodologies, Tools, Applications, pp. 310–334 (2013)Google Scholar
  7. 7.
    Kung, D.C., Suchak, N., Gao, J.Z., Hsia, P., Toyoshima, Y., Chen, C.: On object state testing. In: Proceedings of 18th International Computer Software and Applications Conference (COMPSAC), pp. 222–227 (1994)Google Scholar
  8. 8.
    Sen, T., Mall, R.: Extracting finite state representation of Java programs. Softw. Syst. Model. 15, 497–511 (2016)CrossRefGoogle Scholar
  9. 9.
    Cheng, K.T., Krishnakumar, A.S.: Automatic functional test generation using the extended finite state machine model. In: Proceedings of 30th ACM/IEEE Design Automation Conference, pp. 86–91 (1993)Google Scholar
  10. 10.
    King, J.C.: Symbolic execution and program testing. J. ACM 19, 385–394 (1976)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Godefroid, P., Klarlund, N., Sen, K.: DART: directed automated random testing. In: Proceedings of PLDI, pp. 213–223 (2005)CrossRefGoogle Scholar
  12. 12.
    Hoffmann, A., Quante, J., Woehrle, M.: Experience report: white box test case generation for automotive embedded software. In: Proceedings of 9th International Conference on Software Testing, Verification and Validation Workshops, TAIC-PART Workshop, pp. 269–274 (2016)Google Scholar
  13. 13.
    Said, W., Quante, J., Koschke, R.: On state machine mining from embedded control software. In: Proceedings of the 34th International Conference on Software Maintenance and Evolution (ICSME). (2018)Google Scholar
  14. 14.
    Quante, J.: A program interpreter for arbitrary abstractions. In: 16th International Working Conference on Source Code Analysis and Manipulation, pp. 91–96 (2016)Google Scholar
  15. 15.
    Nejmeh, B.A.: NPATH: a measure of execution path complexity and its applications. Commun. ACM 31, 188–200 (1988)CrossRefGoogle Scholar
  16. 16.
    Miranda, D., Genero, M., Piattini, M.: Empirical validation of metrics for UML statechart diagrams. In: Camp, O., Filipe, J.B.L., Hammoudi, S., Piattini, M. (eds.) Enterprise Information Systems V, pp. 101–108. Springer, Netherlands (2005). Scholar
  17. 17.
    Weiser, M.: Program slicing. In: Proceedings of 5th International Conference on Software Engineering (1981) 439–449Google Scholar
  18. 18.
    Horwitz, S., Reps, T.W., Binkley, D.: Interprocedural slicing using dependence graphs. In: Proceedings of Conference on Programming Language Design and Implementation, pp. 35–46 (1988)Google Scholar
  19. 19.
    Cadar, C., Dunbar, D., Engler, D.R.: KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In: 8th USENIX Symposium on Operating Systems Design and Implementation, pp. 209–224 (2008)Google Scholar
  20. 20.
    Ammons, G., Bodík, R., Larus, J.R.: Mining specifications. In: Proceedings of 29th Symposium on Principles of Programming Languages, pp. 4–16 (2002)Google Scholar
  21. 21.
    Whaley, J., Martin, M.C., Lam, M.S.: Automatic extraction of object-oriented component interfaces. SIGSOFT Softw. Eng. Notes 27, 218–228 (2002)CrossRefGoogle Scholar
  22. 22.
    Lo, D., Khoo, S.C., Liu, C.: Efficient mining of iterative patterns for software specification discovery. In: Proceedings of 13th International Conference on Knowledge Discovery and Data Mining, pp. 460–469 (2007)Google Scholar
  23. 23.
    Shoham, S., Yahav, E., Fink, S.J., Pistoia, M.: Static specification mining using automata-based abstractions. IEEE Trans. Softw. Eng. 34, 651–666 (2008)CrossRefGoogle Scholar
  24. 24.
    Eisenbarth, T., Koschke, R., Vogel, G.: Static object trace extraction for programs with pointers. J. Syst. Softw. 77, 263–284 (2005)CrossRefGoogle Scholar
  25. 25.
    Walkinshaw, N., Bogdanov, K., Ali, S., Holcombe, M.: Automated discovery of state transitions and their functions in source code. Softw. Test. Verif. Reliab. 18, 99–121 (2008)CrossRefGoogle Scholar
  26. 26.
    Walkinshaw, N., Bogdanov, K., Holcombe, M., Salahuddin, S.: Reverse engineering state machines by interactive grammar inference. In: Proceedings of 14th Working Conference on Reverse Engineering (WCRE), pp. 209–218 (2007)Google Scholar
  27. 27.
    Corbett, J.C., Dwyer, M.B., Hatcliff, J., Laubach, S., Pasareanu, C.S., Robby, Zheng, H.: Bandera: extracting finite-state models from Java source code. In: Proceedings of 22nd ICSE, pp. 439–448 (2000)Google Scholar
  28. 28.
    Xie, T., Martin, E., Yuan, H.: Automatic extraction of abstract-object-state machines from unit-test executions. In: Proceedings of 28th ICSE, pp. 835–838 (2006)Google Scholar
  29. 29.
    Tonella, P., Potrich, A.: Reverse Engineering of Object Oriented Code. Springer, New York (2011). Scholar
  30. 30.
    Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: Proceedings of International Workshop on Dynamic Systems Analysis, pp. 17–24 (2006)Google Scholar
  31. 31.
    van den Brand, M., Serebrenik, A., van Zeeland, D.: Extraction of state machines of legacy C code with Cpp2XMI. In: Proceedings of 7th Belgian-Netherlands Software Evolution Workshop, pp. 28–30 (2008)Google Scholar
  32. 32.
    Knor, R., Trausmuth, G., Weidl, J.: Reengineering C/C++ source code by transforming state machines. In: van der Linden, F. (ed.) ARES 1998. LNCS, vol. 1429, pp. 97–105. Springer, Heidelberg (1998). Scholar
  33. 33.
    Abadi, M., Feldman, Y.A.: Automatic recovery of statecharts from procedural code. In: International Conference on Automated Software Engineering, pp. 238–241 (2012)Google Scholar
  34. 34.
    Somé, S.S., Lethbridge, T.: Enhancing program comprehension with recovered state models. In: 10th International Workshop on Program Comprehension (IWPC), pp. 85–93 (2002)Google Scholar
  35. 35.
    Jiresal, R., Makkapati, H., Naik, R.: Statechart extraction from code - an approach using static program analysis and heuristics based abstractions. In: Proceedings of 2nd India Workshop on Reverse Engineering (2011)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Robert Bosch GmbH, Corporate ResearchRenningenGermany
  2. 2.University of BremenBremenGermany

Personalised recommendations