As software in safety-critical systems, such as automotive, aviation, and medical systems, grows in complexity, stronger correctness guarantees beyond traditional testing are essential, as faults may endanger human lives. Typically, the functional correctness of such systems is ensured with post-hoc verification, which means that a program is verified after it has been completely implemented and specified with a pre- and postcondition contract. Usually, automated program verifiers are used for post-hoc verification. A major drawback of post-hoc verification is the lack of construction guidance, making fault localization difficult when verification fails. Faults may result from incorrect implementations, insufficient specifications, or unclosable proofs, leading to trial-and-error adjustments in the specification and code. Ideally, with a guided approach to construct correct software, the developer would think about the problem first rather than a concrete implementation and is then guided towards a correct solution without trial-and-error adjustments.
Correctness-by-Construction (CbC) integrates specification and verification into an incremental development process. Starting from a formal specification as an abstract Hoare triple, programs are progressively refined into verified implementations, checking the correctness of each refinement step. CbC provides benefits, such as early error detection and increased trust in the software through the structured development process. CbC is implemented in the tool CorC and first experiments with CorC show an increased proof efficiency compared to post-hoc verification for small algorithms. Despite these benefits, CbC has still mostly been applied to isolated algorithms. However, in modern software engineering, complex, large-scale software systems are developed in teams with different expertise. In particular, we identified four key challenges for applying CbC in modern software engineering: 1) structural complexity through object-orientation, 2) integration into existing development processes, 3) a high entry barrier due to limited verification expertise of developers, and 4) lack of support for advanced programming paradigms, such as those for highly configurable software systems.
In this thesis, we made three contributions that address these four challenges to extend CbC such that it is applicable in modern software engineering. First, we scale CbC to support object-oriented systems by introducing an object model with classes, fields, methods, inheritance, class invariants, and frames enabling encapsulation, inheritance, polymorphism, and dynamic dispatch. A roundtrip engineering process enables integration into established software development processes, such that CbC development can be combined with other quality assurance techniques. Second, to lower the entry barrier of using CbC for non-experts in software verification, we integrate a three-level process of increasing correctness guarantees that incorporates testing as an intermediate level between specifying and verifying. Since testing is a well-known quality assurance technique, developers get understandable test reports and can locate and fix major errors early in the design phase. We evaluate the three-level process quantitatively to assess its efficiency in locating faults and qualitatively to asses usability improvements. Third, we extend CbC to support highly configurable software systems. The challenge of highly configurable software systems is that they incorporate variability to enable the efficient development of whole product families. Therefore, we incorporate variability in the specification, the code constructs, and the verification strategies of CbC. We prove the soundness of these variability concepts and evaluate feasibility and proof efficiency of the verification strategies. Furthermore, we want to assess whether there is a trade-off between specification effort and proof efficiency when comparing CbC and post-hoc verification. Overall, our work enables CbC to be applied for object-oriented software and highly configurable software systems within software teams with varying expertise levels that use established software development processes.
| Related KIT institution | Institute of Information Security and Dependability (KASTEL) |
|---|---|
| Language | English |
| KITopen ID | 1000184252 |
| Keywords | Correctness-by-Construction, Formal Verification, Formal Specification, Software Product Line Engineering, Test Case Generation |
| Publisher | Karlsruher Institut für Technologie (KIT) |
| Size | xv, 197 p. |
| Faculty | Department of Informatics (INFORMATIK) |
| Institute | Institute of Information Security and Dependability (KASTEL) |
| Exam date | Jul 17, 2025 |
| Supervisors | Ina Schaefer Einar Broch Johnsen |
| Referenced in | OpenAlex |
| Sustainable Development Goals (SDGs) |