Skip to main content

Towards Model-Driven Unit Testing

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4364))

Abstract

The Model-Driven Architecture (MDA) approach for constructing software systems advocates a stepwise refinement and transformation process starting from high-level models to concrete program code. In contrast to numerous research efforts that try to generate executable function code from models, we propose a novel approach termed model-driven monitoring. On the model level the behavior of an operation is specified with a pair of UML composite structure diagrams (visual contract), a visual notation for pre- and post-conditions. The specified behavior is implemented by a programmer manually. An automatic translation from our visual contracts to JML assertions allows for monitoring the hand-coded programs during their execution.

In this paper we present how we extend our approach to allow for model-driven unit testing, where we utilize the generated JML assertions as test oracles. Further, we present an idea how to generate sufficient test cases from our visual contracts with the help of model-checking techniques.

This paper is an abbreviated version of our same-titled contribution to MoDeV2a 2006. For related work, refer to the longer version in the MoDeV2a 2006 workshop proceedings or to our web page at http://www.upb.de/cs/ag-engels.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Meservy, T.O., Fenstermacher, K.D.: Transforming software development: An MDA road map. IEEE Computer 38(9), 52–58 (2005)

    Google Scholar 

  2. Lohmann, M., Sauer, S., Engels, G.: Executable visual contracts. In: Erwig, M., Schürr, A. (eds.) 2005 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC’05), pp. 63–70. IEEE Computer Society Press, Los Alamitos (2005)

    Chapter  Google Scholar 

  3. Engels, G., Lohmann, M., Sauer, S., Heckel, R.: Model-driven monitoring: An application of graph transformation for design by contract. In: International Conference on Graph Transformation (ICGT) 2006, September 2006 (accepted for publication, 2006)

    Google Scholar 

  4. Heckel, R., Lohmann, M.: Model-driven development of reactive informations systems: From graph transformation rules to JML contracts. International Journal on Software Tools for Technology Transfer (STTT) (accepted for publication, 2006)

    Google Scholar 

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

    Google Scholar 

  6. Leavens, G., Cheon, Y.: Design by Contract with JML (2003)

    Google Scholar 

  7. Beck, K.: Test Driven Development: By Example. Addison-Wesley Professional, Reading (2002)

    Google Scholar 

  8. Beck, K.: Extreme Programming Explained. Embrace Change. The XP Series. Addison-Wesley Professional, Reading (1999)

    Google Scholar 

  9. Heckel, R., Lohmann, M.: Towards model-driven testing. Electr. Notes Theor. Comput. Sci. 82(6) (2003)

    Google Scholar 

  10. Antoy, S., Hamlet, D.: Automatically checking an implementation against its formal specification. IEEE Transactions on Software Engineering 26(1), 55–69 (2000), doi:10.1109/32.825766

    Article  Google Scholar 

  11. OMG (Object Management Group): UML 2.0 superstructure specification - revised final adopted specification (2004)

    Google Scholar 

  12. Heckel, R., Ehrig, H., Wolter, U., Corradini, A.: Double-pullback transitions and coalgebraic loose semantics for graph transformation systems. APCS (Applied Categorical Structures) 9(1), 83–110 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  13. Habel, A., Heckel, R., Taentzer, G.: Graph grammars with negative application conditions. Fundamenta Informaticae 26(3,4), 287–313 (1996)

    MATH  MathSciNet  Google Scholar 

  14. Binder, R.V.: Testing Object-Oriented Systems. Addison-Wesley, Reading (2000)

    Google Scholar 

  15. Rensink, A., Schmidt, Á., Varró, D.: Model checking graph transformations: A comparison of two approaches. In: Ehrig, H., Engels, G., Parisi-Presicce, F., Rozenberg, G. (eds.) ICGT 2004. LNCS, vol. 3256, pp. 226–241. Springer, Heidelberg (2004)

    Google Scholar 

  16. Lohmann, M., Engels, G., Sauer, S.: Model-driven monitoring: Generating assertions from visual contracts. In: 21st IEEE/ACM International Conference on Automated Software Engineering (ASE) 2006 Demonstration Session, September 2006, ACM Press, New York (2006)

    Google Scholar 

  17. Rensink, A.: The GROOVE simulator: A tool for state space generation. In: Pfaltz, J.L., Nagl, M., Böhlen, B. (eds.) AGTIVE 2003. LNCS, vol. 3062, pp. 479–485. Springer, Heidelberg (2004)

    Google Scholar 

  18. Cheon, Y., Leavens, G.T.: A simple and practical approach to unit testing: The JML and JUnit way. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 231–255. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Thomas Kühne

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer Berlin Heidelberg

About this paper

Cite this paper

Engels, G., Güldali, B., Lohmann, M. (2007). Towards Model-Driven Unit Testing. In: Kühne, T. (eds) Models in Software Engineering. MODELS 2006. Lecture Notes in Computer Science, vol 4364. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69489-2_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-69489-2_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-69488-5

  • Online ISBN: 978-3-540-69489-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics