skip to main content
10.1145/2428516.2428525acmconferencesArticle/Chapter ViewAbstractPublication PagesmodelsConference Proceedingsconference-collections
research-article

Automatic generation of test models and properties from UML models with OCL constraints

Published:30 September 2012Publication History

ABSTRACT

Model-Based Testing and Property-Based Testing are two testing methodologies that usually facilitate the automation of the generation of test cases, using either models or properties as basis to derive complete test suites. In doing so, they also contribute to reduce both the source code needed for testing purposes and the time spent on writing those tests, hence saving effort and increasing maintainability.

In this paper, we describe how to generate complete property-based test suites automatically translated from a model that describes the system under test, specifically a UML model with OCL constraints. The proposed approach can be applied to both stateless and stateful components.

We have used QuickCheck, an automatic property-based testing tool for test case generation, execution and diagnosis, as support tool. Our method produces QuickCheck executable test models as output, so we use the same tool to run and evaluate them. As part of our work, we analyze and discuss the advantages and disadvantages of our approach in contrast to writing test suites manually.

References

  1. S. Ali, M. Z. Iqbal, A. Arcuri, and L. Briand. A search-based ocl constraint solver for model-based test data generation. In 11th International Conference on Quality Software, QSIC '11, pages 41--50. IEEE Computer Society, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Arts, L. M. Castro, and J. Hughes. Testing erlang data types with quviq quickcheck. In ACM SIGPLAN Workshop on Erlang, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Arts, J. Hughes, J. Johansson, and U. Wiger. Testing telecoms software with quviq quickcheck. In ACM SIGPLAN workshop on Erlang (ERLANG'06), New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. Baker, Z. R. Dai, J. Grabowski, O. Haugen, I. Schieferdecker, and C. Williams. Model-Driven Testing: Using the UML Testing Profile. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Barnett, K. Leino, and W. Schulte. The spec# programming system: An overview. pages 49--69. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Benattou, J. M. Bruel, and N. Hameurlain. Generating test data from ocl specification. In ECOOP Workshop on Integration and Transformation of UML models, 2002.Google ScholarGoogle Scholar
  7. A. D. Brucker, M. P. Krieger, D. Longuet, and B. Wolff. A specification-based test case generation method for uml/ocl. In International Conference on Models in Software Engineering, MODELS'10, pages 334--348, Berlin, Heidelberg, 2011. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. L. M. Castro and T. Arts. Testing data consistency of data-intensive applications using quickcheck. Electronic Notes in Theoretical Computer Science, 271:41--62, 2011. Proceedings of the 10th Spanish Conference on Programming and Languages (PROLE 2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Y. Cheon and G. T. Leavens. A simple and practical approach to unit testing: The jml and junit way. In 16th European Conference on Object-Oriented Programming, ECOOP'02, pages 231--255, London, UK, 2002. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. I. Ciupa and A. Leitner. Automatic testing based on design by contract. In 6th Annual International Conference on Object-Oriented and Internet-based Technologies, Concepts, and Applications for a Networked World (Net. ObjectDays 2005), pages 545--557, 2005.Google ScholarGoogle Scholar
  11. K. Claessen and J. Hughes. Quickcheck: a lightweight tool for random testing of haskell programs. In 5th ACM SIGPLAN International Conference on Functional Programming, ICFP '00, pages 268--279, New York, NY, USA, 2000. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. Claessen and J. Hughes. Quickcheck: a lightweight tool for random testing of haskell programs. In International Conference on Functional Programming, pages 268--279, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. Demuth. The dresden ocl toolkit and its role in information systems development. In 13th International Conference on Information Systems Development: Methods and Tools, Theory and Practice Conference, Advances in Theory, Practice and Education, 9--11 September, 2004.Google ScholarGoogle Scholar
  14. B. Demuth, S. Loecher, and S. Zschaler. Structure of the dresden ocl toolkit extended abstract. In 2nd International Fujaba Days "MDA with UML and Rule-based Object Manipulation", September 15--17, 2004.Google ScholarGoogle Scholar
  15. J. Derrick, N. Walkinshaw, T. Arts, C. B. Earle, F. Cesarini, L.-A. Fredlund, V. Gulías, J. Hughes, and S. Thompson. Property-based testing - the protest project. Lecture Notes in Computer Science, 6286 LNCS:250--271, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. C. Dias Neto, R. Subramanyan, M. Vieira, and G. H. Travassos. A survey on model-based testing approaches: a systematic review. In 1st ACM international Workshop on Empirical assessment of Software Engineering Languages and Technologies (WEASELTech '07), pages 31--36, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jinterface. http://www.erlang.org/doc/apps/jinterface/index.html, 2012.Google ScholarGoogle Scholar
  18. M. Karaorman, U. Hölzle, and J. L. Bruno. jcontractor: A reflective java library to support design by contract. In 2nd International Conference on Meta-Level Architectures and Reflection, Reflection '99, pages 175--196, London, UK, UK, 1999. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Kramer. icontract - the java(tm) design by contract(tm) tool. In Technology of Object-Oriented Languages and Systems (TOOLS '98), pages 295--307, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. G. T. Leavens and Y. Cheon. Design by contract with jml. www.jmlspecs.org, 2006.Google ScholarGoogle Scholar
  21. P. Madsen. Testing by contract - combining unit testing and design by contract. Proceedings of the Nordic workshop on Software Development Tools and Techniques, 2002.Google ScholarGoogle Scholar
  22. B. Meyer. Applying "design by contract". Computer, 25(10):40--51, Oct. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. B. Meyer. Object-Oriented Software Construction. Prentice-Hall, Inc., second edition, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. Moiseev, S. Hayashi, and M. Saeki. Generating assertion code from ocl: A transformational approach based on similarities of implementation languages. In 12th International Conference on Model Driven Engineering Languages and Systems, MODELS '09, pages 650--664, Berlin, Heidelberg, 2009. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Parasoft corporation. http://www.parasoft.com/, 2012.Google ScholarGoogle Scholar
  26. J. Rumbaugh, I. Jacobson, and G. Booch. Unified Modeling Language Reference Manual, The (2nd Edition). Pearson Higher Education, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. P. A. Salas and B. K. Aichernig. Automatic Test Case Generation for OCL: a Mutation Approach. Technical report, 2005.Google ScholarGoogle Scholar
  28. M. Utting and B. Legeard. Practical Model-Based Testing: A Tools Approach. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. M. Utting, A. Pretschner, and B. Legeard. A taxonomy of model-based testing. Technical report, April 2006.Google ScholarGoogle Scholar
  30. J. Warmer and A. Kleppe. The Object Constraint Language: Getting Your Models Ready for MDA. Addison-Wesley Longman Publishing Co., Inc., 2 edition, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Y. Wu, M. Chen, and J. Offutt. Uml-based integration testing for component-based software. In International Conference on COTS-Based Software Systems, pages 251--260, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Zeller and R. Hildebrandt. Simplifying and isolating failure-inducing input. IEEE Transactions on Software Engineering, 28:2002, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automatic generation of test models and properties from UML models with OCL constraints

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                OCL '12: Proceedings of the 12th Workshop on OCL and Textual Modelling
                September 2012
                66 pages
                ISBN:9781450317993
                DOI:10.1145/2428516

                Copyright © 2012 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 30 September 2012

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader