Likely correct software
          
          2023-11-28
        
        
          Introduction
          
            - 
              Idea
              
                - We have a definition of correctness
- We know software is the result of a development process
- We know software has architectural layers
 
- 
              Proposal
              
                - 
                  The software architecture design process should produce likely
                  correct deliverables
                
- 
                  The software development process should produce likely correct
                  deliverables
                
 
The software development process and correctness
          
            - Software development is a process 1
- 
              The process can use different methods
              
                - Better the method, formalism
- Better the deliverable
- Better the correctness
 
Formalism, correctness, cost 1
          
            
              
            
            
              
                | Formal | Provably correct | Expensive | 
              
                | Semi formal | Likely correct | Affordable | 
              
                | Informal | Maybe correct | Minimal, but it’s a debt | 
            
          
          
        
        
        
          Likely correct software development process
          
            - Relies on semi formal methods
- Produces likely correct deliverables
- At an affordable cost
How to develop likely correct software?
          
            - 
              Identify the exact steps
              
                - Of the software development process
- With its inputs and outputs
 
- 
              For each step
              
                - Find a semi formal method
- That will produce a semi formal deliverable
- Which is likely correct
 
The software development process
          
            
              
            
            
              
                | Problem | Understanding | Model | 
              
                | Model | Design | Specification | 
              
                | Specification | Implementation | Code | 
              
                | Code | Verification | Software | 
            
          
        
        
        
          Understanding
          
            - 
              Input
              
                - The problem
- Informal, comes as is
- A document in plain english
 
- 
              Deliverable
              
                - The mental model of the problem
- In a structured, standardized document
 
Methods for understanding
          
            - 
              The scientific method 1
              
                - Produces a thesis, dissertation
- Where the hypothesis is supported, not proven
- But good enough to be likely correct
 
- 
              Design in practice 2
              
                - It’s like the scientific method
- Taylored to software development
 
Design
          
            - 
              Input
              
                - The mental model of the problem
- In a structured, standardized document
 
- 
              Deliverable
              
                - The exact specification of the problem
- In a structured, standardized document
- Or, better, in executable english 1
 
Methods for design
          
            - 
              Concept-based design 1
              
                - Concepts are semi formal
- Concept composition is transactional
- Concepts translate to executable specifications
 
- 
              We couldn’t find other methods
              
                - Functional programming might be a way
- Category theory is definitively a way 2
 
Implementation
          
            - 
              Input
              
                - The exact specification of the problem
- In an executable specification format
 
- 
              Deliverable
              
                - Totally correct 1 code
- “The algorithm terminates”
- No impossible states 2
 
Methods for implementation
          
            - 
              Pattern matching 1 2
              
                - Built-in in most languages
 
- 
              Finite-state machine 3 4
              
                - Also visualizes the business logic
- For designers, executives
 
Verification
          
            - 
              Input
              
                - Totally correct code
- The algorithm terminates
- No impossible states
 
- 
              Deliverable
              
                - Partially correct code 1
- “If an answer is returned it’s correct”
 
Methods for verification
          
            - 
              100% code coverage 1
              
                - All code paths checked
- Not all possible answers checked
 
- 
              Property based testing 2
              
                - All code paths checked
- All possible answers checked
 
A likely correct software development process is
          
            - 
              Likely correct understanding ✅
              
            
- 
              Likely correct design ✅❓
              
                - A single method so far
- The most difficult part
 
- 
              Likely correct implementation ✅
              
                - Even provably correct is possible
 
- 
              Likely correct verification ✅
              
                - Even provably correct is possible