ALGEBRAIC SOFTWARE DESIGN
DOI:
https://doi.org/10.32689/maup.it.2023.5.7Keywords:
unsafety of universal inclusion polymorphism, functional type of class method, design by contract, RAISE method, algebraic equalities.Abstract
Abstract. The article discusses an algebraic approach to designing and testing software. The purpose of the article is to develop a class that implements Peano arithmetic. Peano arithmetic is one of the fundamental constructs in axiomatic mathematics. The arithmetic class presented in the article represents a semigroup of natural numbers and this class is the first example in the hierarchy of numerical classes (integers, integer rings, rational number fields) that demonstrates the potential unsafety of universal inclusion polymorphism and violations of the Liskov substitution principle. Research methods. During the study, basic principles of the Bertrand Meyer’s design by contract method and the formal development method RAISE are used, which allow applying formal logic. Scientific novelty. The modified interpretation of the functional type of class methods and the consistent use of requirements in the form of algebraic equalities make it possible at the time of design to indicate the unsafety of universal inclusion polymorphism. Additionally, attention is drawn to the categoricality (rigitity) of algebraic model, which makes incorrect implementations impossible, and to direct analogies between the axiomatic presentation of mathematical theory and the development of specifications. Furthermore, this approach significantly simplifies the of smoke test design. Conclusions. Algebraic design and testing are based on mathematical principles, allowing for the avoidance of ambiguity and uncertainty in functionality descriptions, ensuring accuracy and unambiguity in formulating specifications, automating the process of test cases design and verification of software requirements, thereby makes it easier to detect and correct a design and coding errors.
References
Піскунов О.Г. Типи, множини та класи. 2011. С. 19. URL: https://www.researchgate.net/publication/334174126 (дата звернення: 01.02.2024).
Піскунов О.Г. Про відмінності між поняттями типу та. Вісник Київського національного університету імені Тараса Шевченка. Серія : Фізико-математичні науки. 2015. № 3. С. 106–114.
Піскунов О.Г. LaTex та вимоги державного стандарту. 2022. С. 74. URL: https://www.researchgate.net/publication/359860334 (дата звернення: 01.02.2024).
Піскунов О.Г., Жултинська А.К. Документування процесу розробки програмного забезпечення. 2024. С. 324. URL: https://www.researchgate.net/publication/377261513 (дата звернення: 01.02.2024).
Піскунов О.Г., Рудик В.І., Петренко І.А. Арифметика Пеано: від специфікації до класу. 2022. С. 45. URL: https://www.researchgate.net/publication/365979331 (дата звернення: 01.02.2024).
Піскунов О.Г., Мічуда А.М. Переозначення додавання: небезпечне наслідування в групі цілих. 2023. С. 36. URL: https://www.researchgate.net/publication/366867037 (дата звернення: 01.02.2024).
Cardelli L., Abadi M. A theory of objects. New York: Springer-Verlag, 1996. Р. 396.
Cardelli L. A semantics of multiple inheritance. Information and Computation. 1988. № 76. P. 138–164.
Cody W., Waite W. Software manual for the elementary functions. New Jersey: Prentice-Hall, 1980. Р. 289.
Date, C.J. An Introduction to Database Systems, 7th Edition. London, UK: Addison-Wesley, 2000. 938 р.
Guttag J.V. Abstract Data Types and the Development of Data Structures. Communications of the ACM. 1977. Vol. 20. № 6. Р. 396-404.
Haxthausen A. Lecture Notes on The RAISE Development Method. Kongens Lyngby: DTU, 1999. Р. 20.
Jia X. ZTC: A Type Checker for Z Notation. User’s Guide (Version 2.03).Chicago: DePaul University, USA, 1998. Р. 44.
Martin R. Clean Architecture: A craftsman’s guide to software structure and design. Boston, U.S: Prentice-Hall, 2018, 378 p.
Meyer B. Object-Oriented Software Construction. Second Edition. London: Pearson Education, 2022. Р. 1024.
Myers G., Sandler C., Badgett T. The art of software testing, 3rd ed. New Jersey, USA:J. Wiley & Sons, Inc, 2012. 240 р.
Parnas D.L. Really rethinking ’formal methods’. New York, U.S: IEEE Computer Society, Computer, 2010, N 43, pp. 28–34.
Piskunov A.G. Inheritance of Abstract Automata. Вісник Київського національного університету імені Тараса Шевченка. Серія : Кібернетика. 2011. № 11. С. 40-44.
Spivey J.M. The Z Notation: A Reference Manual, 2nd edition. New Jersey: Prentice Hall International Series in Computer Science, 1992. Р. 158.
Stepanov A.A., Ros D.E. From Mathematics to Generic Programming. London, UK: Addison-Wesley, 2015, 285 p.
Wing J., Liskov B. Family Values: A Behavioral Notion of Subtyping. Pittsburgh,U.S: ACM, ACM Trans. Program. Lang. Syst., 16(6), 1994. pp 1812-1841 (дата звернення: 01.02.2024).
The RAISE Language Group. The RAISE SPECIFICATION LANGUAGE. Kongens Lyngby, Denmark: Prentice Hall Europe, 1992, 396 p.
Guttag, J.V. and Horning, J.J., The algebraic specifications of abstract data types. URL: https://www.semanticscholar.org/paper/The-algebraic-specification-of-abstract-data-types-Guttag-Horning/e4c8b1db0c839a07a833db51c5ac00e6ffd5a922 (дата звернення: 01.02.2024).