Skip to main content
Log in

Model-based test case generation from UML sequence diagrams using extended finite state machines

  • Published:
Software Quality Journal Aims and scope Submit manuscript

Abstract

The effectiveness of model-based testing (MBT) is mainly due to its potential for automation. If the model is formal and machine-readable, test cases can be derived automatically. One of the most used formal modeling techniques is the interpretation of a system as an extended finite state machine (EFSM). However, formal models are not a common practice in the industry. The Unified Modeling Language (UML) has become the de facto standard for software modeling. Nevertheless, due to the lack of formal semantics, its diagrams can be given ambiguous interpretations and are not suitable for testing automation. This article introduces a systematic procedure for the generation of tests from UML models that uses concepts of model-driven engineering (MDE) for formalizing UML sequence diagrams into extended finite state machines and providing a precise semantics for them. It also applies ModelJUnit and JUnit libraries for an automatic generation of test cases. A case study was conducted in a real software towards the evaluation of its applicability.

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.

Institutional subscriptions

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

Similar content being viewed by others

Notes

  1. International consortium of companies that define and ratify standards in the area of object orientation.

  2. https://github.com/TESTSD2EFSM/SQJO

  3. SPIN as a general tool for verifying the correctness of distributed software models in a rigorous and mostly automated fashion.

References

  • Bézivin, J., Jouault, F., Touzet, D. (2005). An introduction to the atlas model management architecture.

    Google Scholar 

  • Brosch, P., Egly, U., Gabmeyer, S., Kappel, G., Seidl, M., Tompits, H., et al. (2012). Towards scenario-based testing of UML diagrams. In A. D. Brucker & J. Julliand (Eds.), Tests and Proofs (pp. 149–155). Berlin Heidelberg, Berlin, Heidelberg: Springer.

    Chapter  Google Scholar 

  • Cartaxo, E.G., Neto, F.G.O., Machado, P.D.L. (2007). Test case generation by means of uml sequence diagrams and labeled transition systems. In: 2007 IEEE International Conference on Systems, Man and Cybernetics, 1292–1297. https://doi.org/10.1109/ICSMC.2007.4414060.

  • Czarnecki, K., & Helsen, S. (2006). Feature-based survey of model transformation approaches. IBM Systems Journal, 45(3), 621–645.

  • EMF, E.M.F. (2018). Acceleo. https://www.eclipse.org/acceleo/.

  • Favre, J.M. (2004). Towards a basic theory to model model driven engineering. In: 3rd Workshop in Software Model Engineering, WiSME, (pp. 262–271). Citeseer.

  • Fondement, F., Muller, P. A., Thiry, L., Wittmann, B., Forestier, G. (2013). Big metamodels are evil. In A. Moreira, B. Schätz, J. Gray, A. Vallecillo, & P. Clarke (Eds.), Model-Driven Engineering Languages and Systems (pp. 138–153). Berlin Heidelberg, Berlin, Heidelberg: Springer.

    Chapter  Google Scholar 

  • Grønmo, R., & Møller-Pedersen, B. (2010). From sequence diagrams to state machines by graph transformation. In L. Tratt & M. Gogolla (Eds.), Theory and Practice of Model Transformations (pp. 93–107). Berlin Heidelberg, Berlin, Heidelberg: Springer.

    Chapter  Google Scholar 

  • Hierons, R.M., Bogdanov, K., Bowen, J.P., Cleaveland, R., Derrick, J., Dick, J., Gheorghe, M., Harman, M., Kapoor, K., Krause, P., Lüttgen, G., Simons, A.J.H., Vilkomir, S., Woodward, M.R., Zedan, H. (2009). Using formal specifications to support testing. ACM Comput. Surv. 41(2), 1–76. https://doi.org/10.1145/1459352.1459354.

  • Kent, S. (2002). Model driven engineering. In: International Conference on Integrated Formal Methods (pp. 286–298). Springer.

  • Micskei, Z., & Waeselynck, H. (2010). The many meanings of UML 2 sequence diagrams: A survey. Software & Systems Modeling, 10(4), 489–514. https://doi.org/10.1007/s10270-010-0157-9.

  • ModelJUnit: The model-based testing tool. (2010). https://sourceforge.net/projects/modeljunit/.

  • Muthusamy, M., & Badurudeen, G. (2014). A new approach to derive test cases from sequence diagram. Journal of Information Technology & Software Engineering 04 https://doi.org/10.4172/2165-7866.1000128.

  • OMG, O.M.G.: Unified modeling language 2.5. (2015). https://www.omg.org/spec/UML/2.5/.

  • OMG, O.M.G.: MOF - meta object facility. (2016). https://www.omg.org/spec/MOF/.

  • Panthi, V., & Mohapatra, D.P. (2002). Automatic test case generation using sequence diagram. In: A. Kumar M., S. R., T.V.S. Kumar (eds.) Proceedings of International Conference on Advances in Computing, (pp. 277–284). Springer India, New Delhi.

  • Petre, M. (2013). UML in practice. In: Proceedings of the 2013 International Conference on Software Engineering, ICSE ’13, (pp. 722–731). IEEE Press, Piscataway, NJ, USA. http://dl.acm.org/citation.cfm?id=2486788.2486883.

  • Pressman, R. S. (2006). Engenharia de Software, 6 (edition ed.). Rio de Janeiro: Mcgraw-Hill Interamericana.

    Google Scholar 

  • Rocha, M., Simão, A., Sousa, T., Batista, M. (2019). Test case generation by EFSM extracted from UML sequence diagrams. In: The 31 International Conference on Software Engineering & Knowledge Engineering, (pp. 135–140). 10.18293/SEKE2019-133.

  • Rutle, A., Rossini, A., Lamo, Y., Wolter, U. (2008). Automatic definition of model transformations at the instance level. (pp. 80–81).

  • Schmidt, D. C. (2006). Guest editor’s introduction: Model-driven engineering. Computer, 39(2), 25–31. https://doi.org/10.1109/MC.2006.58.

    Article  Google Scholar 

  • Sen, S., Moha, N., Baudry, B., Jézéquel, J. M. (2009). Meta-model pruning. In A. Schürr & B. Selic (Eds.), Model Driven Engineering Languages and Systems (pp. 32–46). Berlin Heidelberg, Berlin, Heidelberg: Springer.

    Chapter  Google Scholar 

  • Seo, Y., Cheon, E.Y., Kim, J.A., Kim, H.S. (2016). Techniques to generate utp-based test cases from sequence diagrams using m2m (model-to-model) transformation. In: 2016 IEEE/ACIS 15th International Conference on Computer and Information Science (ICIS), (pp. 1–6). https://doi.org/10.1109/ICIS.2016.7550832.

  • Simão, A.S. (2016). Teste baseados em modelos. In: M.E. Delamaro, J.C. Maldonado, M. Jino (eds.) Introducao ao Teste de Software, chap.3, (pp. 39–57). Elsevier Editora Ltd.

  • Sommerville, I. (2007). Engenharia de Software. Pearson Brasil.

  • Steinberg, D., Budinsky, F., Paternostro, M., Merks, E. (2009). EMF: Eclipse Modeling Framework 2.0, 2nd edn. Addison-Wesley Professional.

  • Tripathy, A., & Mitra, A. (2013). Test case generation using activity diagram and sequence diagram. In: A. Kumar M., S. R., T.V.S. Kumar (eds.) Proceedings of International Conference on Advances in Computing, (pp. 121–129). Springer India, New Delhi.

  • Utting, M. (2012). How to design extended finite state machine test models in java. In: J. Zander, I. Schieferdecker, P.J. Mosterman (eds.), Model-Based Testing for Embedded Systems (pp. 147–170). CRC Press/Taylor and Francis Group, Boca Raton, FL. https://eprints.qut.edu.au/56821/.

  • Utting, M., Pretschner, A., Legeard, B. (2012). A taxonomy of model-based testing approaches. Softw. Test. Verif. Reliab., 22(5), 297–312. https://doi.org/10.1002/stvr.456.

  • Yang, R., Chen, Z., Zhang, Z., Xu, B. (2015). Efsm-based test case generation: Sequence, data, and oracle. International Journal of Software Engineering and Knowledge Engineering, 25(04), 633–667. https://doi.org/10.1142/S0218194015300018.

Download references

Acknowledgements

The authors are grateful to the anonymous reviewers for their helpful suggestions. This investigation was partially funded by FAPESP (grants 2013/07375-0 and 2019/06937-0).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mauricio Rocha.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Rocha, M., Simão, A. & Sousa, T. Model-based test case generation from UML sequence diagrams using extended finite state machines. Software Qual J 29, 597–627 (2021). https://doi.org/10.1007/s11219-020-09531-0

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-020-09531-0

Keywords

Navigation