The partial application of formal software development methods
DOI:
https://doi.org/10.18372/2073-4751.87.21690Keywords:
formal methods, programming by contract, Liskov substitution principle, GSL, early error detection, unit testing, algebraic specificationAbstract
The article examines the problem of the practical application of formal software development methods, in particular, their partial implementation in individual modules of software systems. The relevance of the study is due to the difficulty of the full-scale use of formal methods in real projects because of the high entry barrier and the need to use specialized specification languages. The aim of the work is to substantiate and experimentally verify the possibility of using the design-by-contract approach with the GSL library for early error detection during the development process.
The work analyzes a classic example of a violation of the Liskov substitution principle based on the well-known inheritance example of the "rectangle" and "square" classes. Formal specifications of the requirements for these classes are given in algebraic form and implemented as preconditions, postconditions, and invariants in the program code. It is shown that without considering the full set of requirements of the base and derived classes, contract checking does not ensure early defect detection. The importance of correct and complete encoding of the axioms of the base and derived classes when implementing them in the chosen programming language is emphasized.
Experimental results demonstrate that the correct implementation of contracts makes it possible to detect errors already at the unit testing stage, before interaction with client code. This refutes the original author's claim that it is impossible to verify the correctness of the model without its use by a client. The practical significance of the work lies in confirming the feasibility of the partial application of formal methods, which helps to increase software reliability without significantly affecting the performance of the final product.
References
1. Walk K., Lucas P. On the formal description of PL/I. Annual Review in Automatic Programming. 1969. Vol. 6. P. 105–182.
2. Bjørner D. (ed.). The Vienna Development Method: The Meta-Language. Berlin ; Heidelberg : Springer-Verlag, 1978. Vol. 61. (Lecture Notes in Computer Science).
3. Meyer B. Object-oriented Software Construction. 2nd ed. Santa Barbara : ISE Inc, 2000. 1284 p.
4. Haxthausen A.E. Lecture notes on the raise development method. Department of Information Technology, Technical University of Denmark. Lyngby, 1999. (Lecture notes, DTU IMM).
5. Haxthausen A.E. Алгебраїчне проєктування класу / пер. з англ. О.Г. Піскунов. 2010. 23 с. URL: https://www.researchgate.net/publication/334173954 (дата звернення: 03.04.2026). DOI: 10.13140/RG.2.2.32601.53600
6. Jacky J. The Way of Z: Practical Programming with formal Methods. New York : Cambridge University Press, 1997. DOI: 10.1109/MC.2010.22
7. Parnas D.L. Really rethinking ’formal methods’. Computer (IEEE Computer Society). 2010. Vol. 43. P. 28–34. DOI: 10.1007/s10270-023-01124-2
8. Gleirscher M., Marmsoler D., Woodcock J. A manifesto for applicable formal methods. Software and Systems Modeling. 2023. Vol. 22, no. 6. P. 1737–1749. DOI: 10.32689/maup.it.2023.5.7
9. Піскунов О.Г., Тупко Н.П., Петренко І.А. Алгебраїчне проєктування програмного забезпечення. Інформаційні технології та суспільство. 2024. № 5 (11). С. 50–59. DOI:10.1007/s10270-023-01124-2
10. Grassmann H.G. Die Ausdehnungslehre: vollständig und in strenger Form bearbeitet. Leipzig : Otto Wigand, 1862.
11. Піскунов О.Г. Класи та проєктування програмного забезпечення. 2026. 172 с. URL: https://www.researchgate.net/publication/395422671 (дата звернення: 03.04.2026). DOI: 10.32689/maup.it.2025.3.18
12. Піскунов О.Г., Тупко Н.П., Хребет В.Г. Арифметичні обчислення та небезпечність універсального поліморфізму. Інформаційні технології та суспільство. 2025. Вип. 3 (18). С. 128–135. DOI: 10.32689/maup.it.2025.3.18
13. Stroustrup B., Sutter H. C++ Core Guidelines. 2024. URL: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines (дата звернення: 03.04.2026). DOI: 10.1145/197320.197383
14. Liskov B., Wing J. A Behavioral Notion of Subtyping. ACM Transactions on Programming Languages and Systems. 1994. Vol. 16, no. 6. P. 1811–1841.
15. Martin R. The Liskov Substitution Principle. C++ Report. 1996. URL: https://objectmentor.com/resources/articles/lsp.pdf (дата звернення: 03.04.2026).
16. Martin R. Clean Architecture: A Craftsman’s Guide to Software Structure and Design. Upper Saddle River : Prentice Hall, 2017. 432 p. (Robert C. Martin Series).
17. Піскунов О.Г. Про відмінності між поняттями типу та класу. Вісник Київського Національного університету ім. Т.Г.Шевченка: комп’ютерні науки. 2015. № 3. С. 106–114.
Downloads
Published
How to Cite
Issue
Section
License

This work is licensed under a Creative Commons Attribution 4.0 International License.
The scientific journal adheres to the principles of Open Access and provides free, immediate, and permanent access to all published materials without financial, technical, or legal barriers for readers.
All articles are published in Open Access under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.
Copyright
Authors who publish their works in the journal:
-
retain the copyright to their publications;
-
grant the journal the right of first publication of the article;
-
agree to the distribution of their materials under the CC BY 4.0 license;
-
have the right to reuse, archive, and distribute their works (including in institutional and subject repositories), provided that proper reference is made to the original publication in the journal.



