Skip to main content
Log in

Systematic approach for constructing an understandable state machine from a contract-based specification: controlled experiments

  • Regular Paper
  • Published:
Software & Systems Modeling Aims and scope Submit manuscript

Abstract

Contract-based specifications using OCL or JML are employed widely to describe the behaviors of systems. However, complex behaviors might not be understood using these specifications because they focus on each individual method instead of the relationships between them. State machines (SMs) can be used to model the dynamic behavior including acceptable event sequences. However, the manual construction of SMs is a time-consuming and error-prone task. Many studies have aimed to construct SMs from contract-based specifications. However, existing SM construction approaches are not concerned with certain qualities of the SMs, such as understandability. In this study, we aimed to develop a combined atomic condition-based approach for constructing highly understandable SMs from formal specifications. We conducted two controlled experiments to evaluate the understandability of the SMs constructed: technology-oriented and human-oriented evaluations. Two existing SM construction approaches, i.e., condition-partitioning-based approach and experience-based approach, were used as the controls in the two experiments, for comparison with the proposed approach. In the technology-oriented experiment, 36 SMs were constructed from 12 specifications using the three approaches. A paired-samples Wilcoxon’s signed-rank test was used to test the differences in the values of a SM understandability metric based on cohesion and coupling metrics. In the human-oriented experiment, we used 15 of the 36 SMs and the differences between the understandability correctness (the number of correct answers/the number of answered questions) measured by 23 participants were tested using an independent t test. The results of the two experiments showed that the understandability of SMs constructed using the proposed approach was significantly better than that of SMs constructed using the two control approaches (\({p} < 0.05\)). The proposed approach does not support advanced features such as the containers of contract-based specifications and the hierarchy/concurrency of SMs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28

Similar content being viewed by others

Notes

  1. Note that we do not distinguish between the terms system, component, and object in this paper. When we say system, we actually refer to an object specified with contract-based notation or the state machine. Therefore, we use the terms system, component, and object interchangeably in this paper.

  2. The materials used in this study, including the exercises, the 12 specifications, and the 36 SMs, are available from http://square.cse.pusan.ac.kr/jhbae/smgen/SMGen_Materials_JHBae.zip.

References

  1. Pigoski, T.M.: Practical Software Maintenance: Best Practices for Managing Your Software Investment. Wiley, New York (1996)

    Google Scholar 

  2. Cruz-Lemus, J.A., Maes, A., Genero, M., Poels, G., Piattini, M.: The impact of structural complexity on the understandability of UML statechart diagrams. Inf. Sci. 180(11), 2209–2220 (2010)

    Article  MathSciNet  Google Scholar 

  3. Corbi, T.A.: Program understanding: challenge for the 1990s. IBM Syst. J 28(2), 294–306 (1989)

    Article  Google Scholar 

  4. Endres, A.: An analysis of errors and their causes in system programs. In: Proceedings of the International Conference on Software Engineering, pp. 327–336 (1975)

  5. Meyer, B.: Applying ’Design by Contract’. Computer 25(10), 40–51 (1992)

    Article  Google Scholar 

  6. Meyer, B.: Eiffel: The Language. Prentice Hall, Englewood Cliffs (1992)

    MATH  Google Scholar 

  7. Warmer, J.B., Anneke, G.K.: The Object Constraint Language: Getting Your Models Ready for MDA. Addison-Wesley Professional, Reading (2003)

    Google Scholar 

  8. Duke, R., Rose, G., Smith, G.: Object-Z: a specification language advocated for the description of standards. Comput. Stand. Interfaces 17(5), 511–533 (1995)

    Article  Google Scholar 

  9. Leavens, G.T., Baker, A.L., Ruby, C.: JML: a Java modeling language. In: Proceedings of the International Workshop on Formal Underpinnings of Java (1998)

  10. Murray, L., Carrington, D., MacColl, I., McDonald, J., Strooper, P.: Formal derivation of finite state machines for class testing. In: Proceedings of the Z Formal Specification Notation, pp. 42–59 (1998)

  11. OMG: UML 2.0 Superstructure Specification (2004)

  12. Google: Android Developer’s Reference, Accessed 2012, http://developer.android.com/reference/

  13. IBM: Rational StateMate, Accessed 2012, http://www-01.ibm.com/software/awdtools/statemate/

  14. David, A., Möller, M.O., Yi. W.: Formal verification of UML statecharts with real-time extensions. In: Proceedings of the Fundamental Approaches to Software Engineering, pp. 218–232 (2002)

  15. Kim, Y.G., Hong, H.S., Bae, D.H., Cha, S.D.: Test cases generation from UML state diagrams. IEE Proc. Softw. 146(4), 187–192 (1999)

    Article  Google Scholar 

  16. Köhler, H.J., Nickel, U., Niere, J., Zündorf, A.: Integrating UML diagrams for production control systems. In: Proceedings of the International Conference on Software Engineering, pp. 241–251 (2000)

  17. 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 the International Conference on Software Engineering, pp. 439–448 (2000)

  18. Dick, J., Faivre, A.: Automating the generation and sequencing of test cases from model-based specifications. In: FME’93: Industrial-Strength Formal Methods, Fifth Int’l Symp. Formal Methods Europe, pp. 268–284 (1993)

  19. Kuske, S., Gogolla, M., Kollmann, R., Kreowski, H.J.: An integrated semantics for UML class, object and state diagrams based on graph transformation. In: Proceedings of the International Conference on Integrated Formal Methods, pp. 11–28 (2002)

  20. Winkelmann, J., Taentzer, G., Ehrig, K., Küster, J.M.: Translation of restricted OCL constraints into graph constraints for generating meta model instances by graph grammars. In: Proceedings of the International Workshop on Graph Transformations and Visual Modeling, pp. 159–170 (2006)

  21. Carrington, D., MacColl, I., McDonald, J., Murray, L., Strooper, P.: From object-Z specifications to classbench test suites. Softw. Test. Verif. Reliab. 10(2), 111–137 (2000)

    Article  Google Scholar 

  22. Hierons, R.M.: Testing from a Z specification. Softw. Test. Verif. Reliab. 7(1), 19–33 (1997)

    Article  Google Scholar 

  23. Sun, J., Dong, J.S.: Design synthesis from interaction and state-based specifications. IEEE Trans. Softw. Eng. 32(6), 349–364 (2006)

    Article  Google Scholar 

  24. Yue, T., Ali, S., Briand, L.C.: Automated transition from use cases to UML state machines to support state-based testing. In: Proceedings of the Modeling Foundations and Applications, pp. 115–131 (2011)

  25. Scandurra, P., Arnoldi, A., Yue, T., Dolci, M.: Functional requirements validation by transforming use case models into abstract state machines. In: Proceedings of the 27th Annual ACM Symposium on Applied Computing, pp. 1063–1068 (2012)

  26. Liang, H., Dingel, J., Diskin, Z.: A comparative survey of scenario-based to state-based model synthesis approaches. In: Proceedings of the International Workshop on Scenarios and State Machines: Models, Algorithms, and Tools, pp. 5–12 (2006)

  27. Harel, D., Kugler, H.: Synthesizing state-based object systems from LSC specifications. Int. J. Found. Comput. Sci. 13(1), 5–51 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  28. Maoz, S., Sa’ar, Y.: Assume-guarantee scenarios: semantics and synthesis. In: Model Driven Engineering Languages and Systems, pp. 335–351 (2012)

  29. Whittle, J., Schumann, J.: Generating statechart designs from scenarios. Proceedings of the International Conference on Software Engineering, pp. 314–323 (2000)

  30. Uchitel, S., Kramer, J., Magee, J.: Synthesis of behavioral models from scenarios. IEEE Trans. Softw. Eng. 29(2), 99–115 (2003)

    Article  Google Scholar 

  31. 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)

    Article  Google Scholar 

  32. Lorenzoli, D., Mariani, L., Pezzè, M.: Automatic generation of software behavioral models. In: Proceedings of the International Conference on Software Engineering, pp. 501–510 (2008)

  33. Binder, R.V.: Testing Object-Oriented Systems: Models, Patterns, and Tools. Addison-Wesley, Reading (2000)

    Google Scholar 

  34. Budgen, D., Burn, A.J., Brereton, O.P., Kitchenham, B.A., Pretorius, R.: Empirical evidence about the UML: a systematic literature review. Softw. Pract. Exp. 41(4), 363–392 (2011)

    Article  Google Scholar 

  35. Ali, S., Yue, T., Briand, L.C.: Does aspect-oriented modeling help improve the readability of UML state machines? Softw. Syst. Model. 13(3), 1189–1221 (2012)

    Article  Google Scholar 

  36. Bae, J.H., Chae, H.S.: An automatic approach to generating state diagram from contract-based class. In: Proceedings of the International Conference on Engineering of Computer Based Systems, pp. 323–331 (2009)

  37. Bae, J.H., Jeong, Y.J., Cha, H.S., Chang, C.K.: Semantics based cohesion and coupling metrics for evaluating understandability of state diagrams. In: Proceedings of the Software and Applications Conference, pp. 383–392 (2011)

  38. Briand, L.C., Cui, J., Labiche, Y.: Towards automated support for deriving test data from UML statecharts. In: Proceedings of the International Unified Modeling Language Conference, pp. 249–264 (2003)

  39. Grunske, L., Geiger, L., Zündorf, A., Van Eetvelde, N., Van Gorp, P., Varro, D.: Using graph transformation for practical model-driven software engineering. In: Model-driven Software Development, pp. 91–117 (2005)

  40. El-Emam, K., Melo, W.: The prediction of faulty classes using object-oriented design metrics. J. Syst. Softw. 56(1), 63–75 (2001)

    Article  Google Scholar 

  41. Canonical Ltd: Ubuntu Manuals - Pylint. [Online]. http://manpages.ubuntu.com/manpages/raring/man1/pylint.1.html (2010)

  42. Sun, J., Dong, J.S.: Extracting FSMs from object-Z specifications with history invariants. In: Proceedings of the International Conference on Engineering of Complex Computer Systems, pp. 96–105 (2005)

  43. Zimmerman, M.K., Lundqvist, K., Leveson, N.: Investigating the readability of state-based formal requirements specification languages. In: Proceedings of the International Conference on Software Engineering, pp. 33–43 (2002)

  44. Ali, S., Briand, L.C., Hemmati, H.: Modeling robustness behavior using aspect-oriented modeling to support robustness testing of industrial systems. Softw. Syst. Model. 11(4), 633–670 (2012)

    Article  Google Scholar 

  45. Back, R.J.R.: A calculus of refinements for program derivations. Acta Inf. 25(6), 593–624 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  46. Basili, V.R.: Software Modeling and Measurement: The Goal/Question/Metric Paradigm (1992)

  47. Chan, E., Bloor, C.: Formal specification of managed objects in an object-oriented network management system using object-Z. In: Proceedings of the Southeastern Symposium System Theory, pp. 206–210 (1995)

  48. Gomaa, H.: Designing Software Product Lines with UML: From UseCases to Pattern-Based Software Architectures. Addison-Wesley, Reading (2004)

    Google Scholar 

  49. Cruz-Lemus, J.A., Genero, M., Piattini, M.: Metrics for UML statechart diagrams. In: Genero, M., Piattini, M., Colero, C. (eds.) Metrics for Software Conceptual Models, pp. 59–98. Imperial College Press, London (2005)

    Google Scholar 

  50. Beckert, B., Hähnle, R., Schmitt, P.H.: The Key Approach, http://www.key-project.org/thebook/examples/05FormalSpecification/ATM_Example_JML (1998)

  51. Preibusch, S., Kammüller, F.: Checking the TWIN elevator system by translating object-Z to SMV. In: Proceedings of the International Conference on Formal Methods for Industrial Critical Systems, pp. 38–55 (2008)

  52. Stoddart, B.: The specification and refinement of an environmental model. In: Proceedings of the Z Formal Specification Notation, pp. 24–41 (1998)

  53. Smith, G.: A semantic integration of object Z and CSP for the specification of concurrent systems. In: Proceedings of the FME ’97: Industrial Benefit of Formal Methods (1997)

  54. Mouchawrab, S., Briand, L.C., Labiche, Y., Di Penta, M.: Assessing, comparing, and combining state machine-based testing and structural testing: a series of experiments. IEEE Trans. Softw. Eng. 37(2), 161–187 (2011)

    Article  Google Scholar 

  55. Antoniol, G., Briand, L.C., Di Penta, M., Labiche, Y.: A case study using the round-trip strategy for state-based class testing. In: Proceedings of the International Symposium on Software Reliability Engineering, pp. 269–279 (2002)

  56. Derrick, J., North, S., Simons, A.J.H.: Z2SAL—building a model checker for Z. In: Proceedings of the Abstract State Machines, B and Z (ABZ), pp. 280–293 (2008)

  57. Ruhroth, T., Wehrheim, H.: Refinement-preserving co-evolution. In: Proceedings of the International Conference on Formal Methods and Software Engineering, pp. 620–638 (2009)

  58. Briand, L.C., Bunse, C., Daly, J.: A controlled experiment for evaluating quality guidelines on the maintainability of object-oriented designs. IEEE Trans. Softw. Eng. 27(6), 513–530 (2001)

    Article  Google Scholar 

  59. Nugroho, A.: Level of detail in UML models and its impact on model comprehension: a controlled experiment. Inf. Softw. Technol. 51(12), 1670–1685 (2009)

    Article  Google Scholar 

  60. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B., Wesslén, A.: Experimentation in Software Eng. Kluwer, Dordrecht (2012)

    Book  MATH  Google Scholar 

  61. Casella, G., Berger, R.: Statistical Inference, 2nd edn. Duxbury, Pacific Grove (2001)

    MATH  Google Scholar 

  62. Lei, S., Smith, M.R.: Evaluation of several nonparametric bootstrap methods to estimate confidence intervals for software metrics. IEEE Trans. Softw. Eng. 29(11), 996–1004 (2003)

    Article  Google Scholar 

  63. Arisholm, E., Sjoberg, D.I.K.: Evaluating the effect of a delegated versus centralized control style on the maintainability of object-oriented software. IEEE Trans. Softw. Eng. 30(8), 521–534 (2004)

    Article  Google Scholar 

  64. Holt, R.W., Boehm-Davis, D.A., Shultz, A.C.: Mental representations of programs for student and professional programmers. In: Proceedings of the International Workshop on Empirical Studies of Programmers, pp. 33–46 (1987)

  65. Höst, M., Regnell, B., Wohlin, C.: Using students as subjects—a comparative study of students and professionals in lead-time impact assessment. Empir. Softw. Eng. 5(3), 201–214 (2000)

    Article  MATH  Google Scholar 

  66. Miller, G.A.: The magical number seven, plus or minus two: some limits on our capacity for processing information. Psychol. Rev. 63(2), 81–97 (1956)

    Article  Google Scholar 

  67. Lucia, A.D., Gravino, C., Oliveto, R., Tortora, G.: An experimental comparison of ER and UML class diagrams for data modelling. Empir. Softw. Eng. 15(5), 455–492 (2010)

    Article  Google Scholar 

  68. Cartwright, M., Shepperd, M.: An empirical investigation of an object-oriented software system. IEEE Trans. Softw. Eng. 26(8), 786–796 (2000)

    Article  Google Scholar 

  69. Eichelberger, H., Schmid, K.: Guidelines on the aesthetic quality of UML class diagrams. Inf. Softw. Technol. 51(12), 1686–1698 (2009)

    Article  Google Scholar 

Download references

Acknowledgments

This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MEST) (No. NRF-2012R1A2A2A01015660).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Heung Seok Chae.

Additional information

Communicated by Prof. Jon Whittle.

Appendix

Appendix

Table 36 lists the size and complexity of the SMs. The rows are the systems and the columns are the approaches and the elemental metrics.

Table 36 Summary of the state machines

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bae, J.H., Chae, H.S. Systematic approach for constructing an understandable state machine from a contract-based specification: controlled experiments. Softw Syst Model 15, 847–879 (2016). https://doi.org/10.1007/s10270-014-0440-2

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-014-0440-2

Keywords

Navigation