Abstract
An assertion is a Boolean expression embedded in a program that must hold during the execution. Executable assertions are a simple but practical way to check assumptions and code logic at runtime. Assertions are written by referring to concrete program states. In this paper, we recognize a variety of assertions that we call design assertions. These are assertions written to ensure design constraints and properties, not detailed implementation decisions, and thus can detect major problems in the implementation such as design drift or corrosion. However, they are written by referring to concrete program states, thus causing readability and maintenance problems. To address these problems, we propose to write design constraints at a higher abstraction level by referring to abstract program states. We explain our approach using the Dart/Flutter platform, but it should work in other languages and platforms with similar assertion facilities.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Avila, C., Flores, G., Cheon, Y.: A library-based approach to translating OCL constraints to JML assertions for runtime checking. In: International Conference on Software Engineering Research and Practice, Las Vegas, Nevada, 14–17 July, pp. 403–408 (2008)
Avila, C., Sarcar, A., Cheon, Y., Yeep, C.: Runtime constraint checking approaches for OCL, a critical comparison, In: International Conference on Software Engineering and Knowledge Engineering, 1–3 July, San Francisco, CA, pp. 393–398 (2010)
Borgida, A., Mylopoulos, J., Reiter, R.: ‘. . . and nothing else changes’: the frame problem in procedure specifications. In: Proceedings of 1993 15th International Conference on Software Engineering, pp. 303–314. IEEE (1993)
Bracha, G.: The Dart Programming Language. Addison-Wesley, Boston (2016)
Briand, L., Dzidek, W., Labiche, Y.: Instrumenting contracts with aspect-oriented programming to increase observability and support debugging. In: International Conference on Software Maintenance, Budapest, Hungary, 25–30 September, pp. 687–690. IEEE (2005)
Chalin, P.: Ensuring that your dart will hit the mark: an introduction to dart contracts. In: International Conference on Information Reuse and Integration, Redwood City, CA, 13–15 August, pp. 369–377. IEEE (2014)
Cheon, Y.: Toward more effective use of assertions for mobile app development. In: International Conference on Progress in Informatics and Computing, Shanghai, China, 17–19 December, pp. 319–323. IEEE (2021)
Cheon, Y., Avila, C., Roach, S., Munoz, C.: Checking design constraints at run-time using OCL and AspectJ. Int. J. Softw. Eng. 2(3), 5–28 (2009)
Cheon, Y., Leavens, T., Sitaraman, M., Edwards, S.: Model variables: cleanly supporting abstraction in design by contract. Softw. Pract. Exp. 35(6), 583–599 (2005)
Flutter Homepage. https://flutter.dev/. Accessed 6 Nov 2021
Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley, Boston (1999)
Hamie, A.: Translating the object constraint language into the java modeling language. In: ACM Symposium on Applied Computing, Nicosia, Cyprus, 14–17 March, pp. 1531–1535. ACM (2004)
Leavens, G., Cheon, Y., Clifton, C., Ruby, C., Cok, D.: How the design of JML accommodates both runtime assertion checking and formal verification. Sci. Comput. Program. 55(1–3), 185–208 (2005)
Perry, D., Wolf, A.: Foundations for the study of software architecture. ACM SIGSOFT Softw. Eng. Notes 17(4), 40–52 (1992)
Richters, M., Gogolla, M.: Aspect-oriented monitoring of UML and OCL constraints. In: AOSD Modeling with UML Workshop, San Francisco, CA, 20 October 2003 (2003)
Spivey, S.: The Z Notation: A Reference Manual. Prentice Hall, Hoboken (1992)
Warmer, J., Kleppe, A.: The Object Constraint Language: Getting Your Models Ready for MDA, 2nd edn. Addison-Wesley, Hoboken (2003)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Cheon, Y. (2022). Design Assertions: Executable Assertions for Design Constraints. In: Gervasi, O., Murgante, B., Misra, S., Rocha, A.M.A.C., Garau, C. (eds) Computational Science and Its Applications – ICCSA 2022 Workshops. ICCSA 2022. Lecture Notes in Computer Science, vol 13381. Springer, Cham. https://doi.org/10.1007/978-3-031-10548-7_45
Download citation
DOI: https://doi.org/10.1007/978-3-031-10548-7_45
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-10547-0
Online ISBN: 978-3-031-10548-7
eBook Packages: Computer ScienceComputer Science (R0)