SlideShare a Scribd company logo
1 of 43
Classic Model Checking in Reactive
                  Software Systems




                                          US Naval Postgraduate School

                                                     Donna A. Dulo
                                                             US Dept of Army
                                                                Fall 2007


SW 4920 Formal Verification & Validation of Reactive Software Systems
Model Checking is a cornerstone of
           verification engineering.
                                           - Amir Pneuli, 1996 Turing Award Recipient




SW 4920 Formal Verification & Validation of Reactive Software Systems
Agenda

                               Introduction to Classic Model Checking
                               The Concept
                               The Issues
                               Classic Model Checkers
                               Future Trends
                               Conclusion




SW 4920 Formal Verification & Validation of Reactive Software Systems
Introduction to Classic Model
                                        Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking

                     Classic Model Checking refers to the Set of Non-Execution
                     Based Algorithmic Approaches for Checking a Property
                     expressed as:


                                      A Linear Time Logic (LTL) Formula
                                      A Computational Tree Logic (CTL) Formula
                                      A CTL* Formula
                                      A Finite State Automaton


                     Against a model, which can be expressed as:
                                      A Finite State Machine
                                      A Kripke Structure

SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking

                     • Verification of finite state systems

                     • Verification is performed automatically

                     • Exhaustive search of the state space of the system to
                     determine if the specification is true or false

                     • Terminates with a Boolean: T/F (yes/no) that demonstrates a
                     behavior which falsifies a property

                     • Always provides a counterexample

                             • Fault Trace

                             • Clues for fixing the problem

SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking


                 • Implemented by Algorithms with reasonable efficiency


                 • Can be used with other methodologies such as abstraction

                 and induction to verify some systems that are not finite space

                 • Transform an academic discipline into a viable practical

                 technique for designers in the field

                 • Simulations can be run by non-mathematicians in industrial

                 settings


SW 4920 Formal Verification & Validation of Reactive Software Systems
Why Formal Verification Through Model Checking?


                                                     • Advent of Complex, Safety Critical Systems

                                                     • Exponential growth in possible state space in
                                                     complex system of systems designs that need to be
                                                     evaluated

                                                     • What trajectories will have the fatal flaw in the
                                                     system?

                                                             • Formal verification conducts an exhaustive
                                                             exploration of all possible behaviors

                                                             • Goal is completeness in exploration

                                                             • Overarching goals are Safety, Predictability
                                                             and Reliability of system software

SW 4920 Formal Verification & Validation of Reactive Software Systems
The Concept of Classical Model
                                    Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
The Goal of Classic Model Checking

                   Program
           void addSpaceParameters(Object
           1) {
               buffer[wing1] = x;                                                 System OK
               buffer [wing 2] = y;
               resolution = x + y;
           }
           Object SW4920() {
               …                                                        Model
           }
                                                                        Checker
                                                                                  ERROR
                                                                                  Trace
               Requirements

                   Requirement 1 ….
                   Requirement 2 …
                   Requirement 3 …
                   ….
                   Requirement n




SW 4920 Formal Verification & Validation of Reactive Software Systems
The Implementation of Classic Model
                                      Checking
     Finite State Model

                                                                                  System OK



                                                                        Model
                                                                        Checker
                                                                                   ERROR
                                                                                   Trace

Temporal Logic Formula
                                                                                  Error 1…

               Φ
               ( −> ◊ Ω)                                                          Error 2…
                                                                                  Error 3…
                                                                                  …
                                                                                  Error n




SW 4920 Formal Verification & Validation of Reactive Software Systems
Applying Model Checking to a Design

              In general, applying model checking to a design is comprised of
              three critical steps:



                                              1. Modeling


                                              2. Specification


                                              3. Verification

SW 4920 Formal Verification & Validation of Reactive Software Systems
Applying Model Checking to a Design


              Modeling

                      • Conversion of design into a Formalism accepted by Model
                      Checker

                      • In some cases, this is a simple compilation task

                      • For time and memory limited systems, abstraction is required

                              • Elimination of Irrelevant details

                              • Elimination of Unimportant/Trivial details




SW 4920 Formal Verification & Validation of Reactive Software Systems
Applying Model Checking to a Design

              Specification

                      • Statement of the properties the design must satisfy

                      • Presented in a Logical Formalism

                      • Use of temporal logic to assert how system behavior will evolve
                      over Time

                      • Critical Issue  Completeness

                              • Impossible in complex systems to cover entire state space

                              • Goal is as much completeness as possible in the
                              specification

SW 4920 Formal Verification & Validation of Reactive Software Systems
Applying Model Checking to a Design

              Verification

                      • In an ideal situation, it is completely automatic, although most
                      results need to be manually verified

                      • Negative Result Case:

                              • Error Trace is Provided

                              • Used as a counterexample for the checked property

                              • Assists designed in tracing error

                      • Once error is traced and rectified, model checking needs to be
                      repeated


SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking in the Waterfall
                                 Model


                                                                               Classic Model Checking

                     Requirements

                                                  Design

                                                                        Code
                                                                                  Test

                                                                                       Maintenance
             “Modern” Model Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
The Issues in Classical Model Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
Benefits of Classic Model Checking

       • Automatic Verification

               • Invariants & Safety Properties

               • Absence of Dead-lock and Live-lock

               • Complex Event Sequencing Properties

       • In contract to testing: Gives Complete Coverage through Exhaustive
       Exploration of all System Paths

       • A solid compliment to other software quality assurance techniques

       • Used successfully for years in the Hardware and Protocol realms




SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                   Model Construction




SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking
                                                   Model Construction
                   Program                                      Finite State Model
          void addSpaceParameters(Object
          1) {
              buffer[wing1] = x;                                                     Model
              buffer [wing 2] = y;
              resolution = x + y;
                                                 GAP                                 Checker
          }
          Object SW4920() {
              …
          }




       Semantic Gap:
       Programming Languages
                             - Methods, Inheritance, Exceptions, etc…………….
       Model Description Languages
                             - Automata
SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                Property Specification




SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                Property Specification
             It’s Difficult to Formalize a Requirement in Temporal Logic


          “Between the key being inserted and the key being removed, the
          ignition can be activated at most twice.”


           []((keyIn / <>keyRem) ->
             ((!activate / !keyRem) U
               (keyRem / ((activate / !keyRem) U
                 (keyRem / ((!activate / !keyRem) U
                   (keyRem / ((activate / !keyRem) U
                     (keyRem / (!activate U
           keyRem))))))))))


SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                       State Explosion




SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                       State Explosion


              • Costly in Terms of Time and Memory


              • A single 32 bit integer variable induces effectively 2^32 states


              • Explosive growth limits software scalability


              • Large or complex systems are impossible to verify


              • Completeness is not possible



SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                  Output Interpretation




SW 4920 Formal Verification & Validation of Reactive Software Systems
Challenges of Classic Model Checking

                                                Output Interpretation


       • Raw Error Traces may be 1000’s of Lines Long
                                                                         ERROR
       • Mapping of Error Traces to Code Can be Difficult                Trace

       • Mapping made Difficult by:
                                                                        Error 1…
               • Semantic Gap                                           Error 2…
                                                                        Error 3…
                                                                        …
               • Encoding of Complex Features                           Error n



               • Multiple Optimizations

               • Multiple Transformations


SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking Programs




SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checkers


           Most popular developed in academia Classic
           Model Checkers available in the public domain:



                                                           SPIN
                                                           SMV




SW 4920 Formal Verification & Validation of Reactive Software Systems
SMV Classic Model Checker

          • Symbolic Model Verifier
          • Developed in early 1990’s by Kenneth McMillan
          • Can verify specifications up to 10^1300 reachable states
          • Based on CTL
          • Input:
                  • State Machine Model
                  • Temporal Logic Formulas
          • SMV checks to see that the formulas are consistent with the
          model
          • Reports an Error Trace and in some cases a Counterexample
          • Open Source with many Variations/Extensions


SW 4920 Formal Verification & Validation of Reactive Software Systems
SPIN Classic Model Checker
          • Automata Based Model Checking Tool
          • Developed in 1995 with significant popularity since
          • Promela (Process Meta Language)
          • LTL based  Formulae Converted to Buchi automata
          • SPIN can also act as a simulator following one possible
          execution path through the system and providing an execution
          trace
          • Supports modeling of asynchronous distributed algorithms and
          non-deterministic automata
          • Options:
                  • Partial Order Reduction
                  • State Compression
                  • Weak Fairness Enforcement
SW 4920 Formal Verification & Validation of Reactive Software Systems
Model Checking Example in ADA

There are seven steps in model checking properties of an Ada program:


1. Conversion of the original Ada program to a safe finite-state variant
2. Translation to SEDL (SmallEiffel Dynamic Linking) compiler
3. Definition of program features to be reasoned about
4. Translation to model checker input
5. Property specification using defined features
6. Execution of the model checker
7. Interpretation of counter-examples for false results




SW 4920 Formal Verification & Validation of Reactive Software Systems
Model Checking Example in ADA

                                                                                                             LTL


                                                                                     State/Event
                                                                                      Predicate
                                                                                     Definitions
                                                                                                             SPIN
                                                                                                   Promela          True

                                 Program Abstraction,
                                                                                                                    or
        ADA                      Configuration,                     ADA to SEDL
                                 Restriction &                                           INCA                       Counter-
       Source                                                                     SEDL
                                 Specification             Ada                                                      Example

                                                                                                    TRANS    SMV



                                                                                                             CTL


                      An ADA Translation Toolset




SW 4920 Formal Verification & Validation of Reactive Software Systems
Variants of Classic Model Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
Variants of Classic Model Checking


                      Symbolic Trajectory Evaluation (STE)


                      Generalized Symbolic Trajectory Evaluation (GSTE)


                      Model Checking with Theorem Proving


                      FORTE




SW 4920 Formal Verification & Validation of Reactive Software Systems
Symbolic Trajectory Evaluation (STE)


                  • Lattice Based Model Checking based on Symbolic Simulation
                  • Less Sensitive to State Explosion
                  • Easier to Use than Classic Model Checkers
                  • Medium to Large Design Checking with High Automation
                  • Technological Breakthroughs in Model Checking
                          • Dynamic Model Pruning
                          • Advanced Parametric Techniques
                          • Case Splitting on Input Data Space
                  • Limitation: Finite Model Space



SW 4920 Formal Verification & Validation of Reactive Software Systems
Generalized Symbolic Trajectory Evaluation
                                  (GSTE)

                     • Generalized Theory of STE


                     • Extends STE Model Checking to include

                     Verification of Ω-regular Properties

                     • Maintains Time and Space Efficiency


                     • Infinite Space


                     • Still in Research & Development



SW 4920 Formal Verification & Validation of Reactive Software Systems
Classic Model Checking with Theorem
                                     Proving
               • A Promising Approach to Verifying Large Systems with Complex
               Properties that do not Lend Themselves well to Either Approach
               Alone

               • Model Checking has Capacity Limits that Need to be Decomposed

               • Theorem Proving Composes and Decomposes Model Checking
               Results instead of Formalizing Arbitrary Mathematical Results

               • Model Checking and Theorem Proving are Tightly Integrated

               • Result: Model Checking Results with no Need for Translation or
               Reformulation

                       • Increased Capacity Space

                       • More Efficiency

SW 4920 Formal Verification & Validation of Reactive Software Systems
FORTE
                                    Formal Tools Environment
                 • Intel Custom Built Verification Environment
                         • Classic Model Checking Engines
                         • Binary Decision Diagrams
                         • Theorem Proving
                         • “FL” Functional Programming Language (Strongly Typed)
                         • Symbolic Trajectory Evaluation
                 • Next Generation Platform includes reFLect Programming
                 Language
                         • Redesign of FL Core
                         • Enhanced Support for Reflection
                 • A Platform Well Suited for Describing and Manipulating High
                 Level Design Specifications

SW 4920 Formal Verification & Validation of Reactive Software Systems
Conclusion on Classic Model Checking




SW 4920 Formal Verification & Validation of Reactive Software Systems
Coverage Space of Classic Model Checking

                                                                               • Limited in Specification Coverage

     Specification Coverage
                                                                                   • Specifications are Text Based
                                                                                   • Difficult to Visualize
                                                                                   • Difficult to Validate
                                                                               • Very Limited in Program Coverage
                                                                                   • State Explosion Problem
                                                                                   • Limited to Finite State
                                                       Verification Coverage
  Program Coverage
                                                                                   • Abstractions Required
                                                                               • High Verification Coverage
                         The Coverage Cuboid
                                                                                   • Automatic
                                                                                   • 100% Coverage
                                                                                   • No Special Drivers Required

SW 4920 Formal Verification & Validation of Reactive Software Systems
Cost Space of Classic Model Checking

                                                                           • High in Specification Cost

     Specification Cost
                                                                               • Specifications are Text Based
                                                                               • Difficult to Visualize
                                                                               • Difficult to Validate
                                                                           • High in Program Cost
                                                                               • State Explosion Problem
                                                                               • Limited to Finite State
                                                       Verification Cost
                                                                               • Abstractions Required
                                                                           • Low in Verification Cost

                          The Cost Cuboid
                                                                               • Automatic
Program Cost
                                                                               • 100% Coverage
                                                                               • No Special Drivers Required

SW 4920 Formal Verification & Validation of Reactive Software Systems
Questions?




SW 4920 Formal Verification & Validation of Reactive Software Systems
References
       Clark, E.M., Grumberg, O., & Peled, D.A. (1999). Model Checking. MIT Press: Cambridge.


       Corbett, J.C. & Pasareneau, C. (2007). Translating Ada programs for Model Checking. University of Hawaii.


       Drusinski, D., Michael, J.B., & Shing, M. (2007). “Three Dimensions of Formal Validation and Verification
                       of Reactive System Behaviors. US Naval Postgraduate School, NPS-CS-07-008.


       Dwyer, M., Hatcliff, J. & Avrunin, G. (2004). Software Model Checking for Embedded Systems. Kansas State
       University.


       Intel Corporation. (2007). “Classic Model Checking Introduction”. www.intel.com.




SW 4920 Formal Verification & Validation of Reactive Software Systems

More Related Content

What's hot

Bristol 2009 q1_blackmore_tim
Bristol 2009 q1_blackmore_timBristol 2009 q1_blackmore_tim
Bristol 2009 q1_blackmore_timObsidian Software
 
Using formal methods in Industrial Software Development
Using formal methods in Industrial Software DevelopmentUsing formal methods in Industrial Software Development
Using formal methods in Industrial Software DevelopmentRobert van Lieshout
 
Formal Method for Avionics Software Verification
 Formal Method for Avionics Software Verification Formal Method for Avionics Software Verification
Formal Method for Avionics Software VerificationAdaCore
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog Ramdas Mozhikunnath
 
Introduction to formal methods
Introduction to formal methodsIntroduction to formal methods
Introduction to formal methodsInzemamul Haque
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow TestingHirra Sultan
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testingHimanshu
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 sessionSameh El-Ashry
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniquesFincy V.J
 
Unit 3 Control Flow Testing
Unit 3   Control Flow TestingUnit 3   Control Flow Testing
Unit 3 Control Flow Testingravikhimani
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocksNirav Desai
 
Basics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesBasics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesArrow Devices
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingTestbytes
 
Software Testing Techniques: An Overview
Software Testing Techniques: An Overview Software Testing Techniques: An Overview
Software Testing Techniques: An Overview QA InfoTech
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASESalman Memon
 

What's hot (20)

Bristol 2009 q1_blackmore_tim
Bristol 2009 q1_blackmore_timBristol 2009 q1_blackmore_tim
Bristol 2009 q1_blackmore_tim
 
Using formal methods in Industrial Software Development
Using formal methods in Industrial Software DevelopmentUsing formal methods in Industrial Software Development
Using formal methods in Industrial Software Development
 
system verilog
system verilogsystem verilog
system verilog
 
Formal Method for Avionics Software Verification
 Formal Method for Avionics Software Verification Formal Method for Avionics Software Verification
Formal Method for Avionics Software Verification
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
Introduction to formal methods
Introduction to formal methodsIntroduction to formal methods
Introduction to formal methods
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 session
 
SECh1920
SECh1920SECh1920
SECh1920
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
Unit 3 Control Flow Testing
Unit 3   Control Flow TestingUnit 3   Control Flow Testing
Unit 3 Control Flow Testing
 
testing
testingtesting
testing
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocks
 
Basics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesBasics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow Devices
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Software Testing Techniques: An Overview
Software Testing Techniques: An Overview Software Testing Techniques: An Overview
Software Testing Techniques: An Overview
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
 
Black box & white-box testing technique
Black box & white-box testing techniqueBlack box & white-box testing technique
Black box & white-box testing technique
 

Viewers also liked

Formal Verification Techniques
Formal Verification TechniquesFormal Verification Techniques
Formal Verification TechniquesDVClub
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking TutorialAnit Thapaliya
 
Modeling Flexible Business Processes with Business Rule Patterns
Modeling Flexible Business Processes with Business Rule PatternsModeling Flexible Business Processes with Business Rule Patterns
Modeling Flexible Business Processes with Business Rule PatternsDragan Gasevic
 
Experience with Formal Methods, Especially Sequential Equivalence Checking
Experience with Formal Methods, Especially Sequential Equivalence CheckingExperience with Formal Methods, Especially Sequential Equivalence Checking
Experience with Formal Methods, Especially Sequential Equivalence CheckingDVClub
 
Formal Verification Theory and Practice
Formal Verification Theory and PracticeFormal Verification Theory and Practice
Formal Verification Theory and PracticeDVClub
 
The Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control ProjectThe Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control ProjectAdaCore
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notationVlad Patryshev
 
Agile Software Development Overview
Agile Software Development OverviewAgile Software Development Overview
Agile Software Development OverviewDUONG Trong Tan
 
Jarrar: First Order Logic
Jarrar: First Order LogicJarrar: First Order Logic
Jarrar: First Order LogicMustafa Jarrar
 

Viewers also liked (12)

Formal Verification Techniques
Formal Verification TechniquesFormal Verification Techniques
Formal Verification Techniques
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking Tutorial
 
Formal verification
Formal verificationFormal verification
Formal verification
 
Modeling Flexible Business Processes with Business Rule Patterns
Modeling Flexible Business Processes with Business Rule PatternsModeling Flexible Business Processes with Business Rule Patterns
Modeling Flexible Business Processes with Business Rule Patterns
 
Experience with Formal Methods, Especially Sequential Equivalence Checking
Experience with Formal Methods, Especially Sequential Equivalence CheckingExperience with Formal Methods, Especially Sequential Equivalence Checking
Experience with Formal Methods, Especially Sequential Equivalence Checking
 
Formal Verification Theory and Practice
Formal Verification Theory and PracticeFormal Verification Theory and Practice
Formal Verification Theory and Practice
 
Temporal logic-model-checking
Temporal logic-model-checkingTemporal logic-model-checking
Temporal logic-model-checking
 
The Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control ProjectThe Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control Project
 
Formal methods 4 - Z notation
Formal methods   4 - Z notationFormal methods   4 - Z notation
Formal methods 4 - Z notation
 
Agile Software Development Overview
Agile Software Development OverviewAgile Software Development Overview
Agile Software Development Overview
 
Jarrar: First Order Logic
Jarrar: First Order LogicJarrar: First Order Logic
Jarrar: First Order Logic
 
First order logic
First order logicFirst order logic
First order logic
 

Similar to Classic Formal Methods Model Checking

Test and integration in REC
Test and integration in RECTest and integration in REC
Test and integration in RECkatybairstow
 
Quality Assurance in REC Group
Quality Assurance in REC GroupQuality Assurance in REC Group
Quality Assurance in REC Grouptonyroz
 
Zapewnienie jakości w Grupie REC
Zapewnienie jakości w Grupie RECZapewnienie jakości w Grupie REC
Zapewnienie jakości w Grupie RECtonyroz
 
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGES
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGESOS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGES
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGESIJCSES Journal
 
A survey of software testing
A survey of software testingA survey of software testing
A survey of software testingTao He
 
Michael.aguilar
Michael.aguilarMichael.aguilar
Michael.aguilarNASAPMC
 
01 software test engineering (manual testing)
01 software test engineering (manual testing)01 software test engineering (manual testing)
01 software test engineering (manual testing)Siddireddy Balu
 
Accelerated test case - Anish bhanu
Accelerated test case - Anish bhanuAccelerated test case - Anish bhanu
Accelerated test case - Anish bhanuRoopa Nadkarni
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4JAMK
 
testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2Dr. Ahmed Al Zaidy
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing QuestionsUser1test
 
Тестирование спецификаций
Тестирование спецификацийТестирование спецификаций
Тестирование спецификацийSQALab
 
Software Quality Models Presentation.pptx
Software Quality Models Presentation.pptxSoftware Quality Models Presentation.pptx
Software Quality Models Presentation.pptxsyedadamiya
 
Verifikasi dan Validasi keamanan informasi
Verifikasi dan Validasi keamanan informasiVerifikasi dan Validasi keamanan informasi
Verifikasi dan Validasi keamanan informasirizqiariy
 
SE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software TestingSE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software TestingAmr E. Mohamed
 
Software engineering
Software engineeringSoftware engineering
Software engineeringGuruAbirami2
 
A framework for distributed control and building performance simulation
A framework for distributed control and building performance simulationA framework for distributed control and building performance simulation
A framework for distributed control and building performance simulationDaniele Gianni
 

Similar to Classic Formal Methods Model Checking (20)

Test and integration in REC
Test and integration in RECTest and integration in REC
Test and integration in REC
 
Quality Assurance in REC Group
Quality Assurance in REC GroupQuality Assurance in REC Group
Quality Assurance in REC Group
 
Zapewnienie jakości w Grupie REC
Zapewnienie jakości w Grupie RECZapewnienie jakości w Grupie REC
Zapewnienie jakości w Grupie REC
 
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGES
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGESOS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGES
OS VERIFICATION- A SURVEY AS A SOURCE OF FUTURE CHALLENGES
 
A survey of software testing
A survey of software testingA survey of software testing
A survey of software testing
 
Verification strategies
Verification strategiesVerification strategies
Verification strategies
 
Michael.aguilar
Michael.aguilarMichael.aguilar
Michael.aguilar
 
01 software test engineering (manual testing)
01 software test engineering (manual testing)01 software test engineering (manual testing)
01 software test engineering (manual testing)
 
Higher Order Testing
Higher Order TestingHigher Order Testing
Higher Order Testing
 
Accelerated test case - Anish bhanu
Accelerated test case - Anish bhanuAccelerated test case - Anish bhanu
Accelerated test case - Anish bhanu
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4
 
testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing Questions
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
Тестирование спецификаций
Тестирование спецификацийТестирование спецификаций
Тестирование спецификаций
 
Software Quality Models Presentation.pptx
Software Quality Models Presentation.pptxSoftware Quality Models Presentation.pptx
Software Quality Models Presentation.pptx
 
Verifikasi dan Validasi keamanan informasi
Verifikasi dan Validasi keamanan informasiVerifikasi dan Validasi keamanan informasi
Verifikasi dan Validasi keamanan informasi
 
SE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software TestingSE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software Testing
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
A framework for distributed control and building performance simulation
A framework for distributed control and building performance simulationA framework for distributed control and building performance simulation
A framework for distributed control and building performance simulation
 

Classic Formal Methods Model Checking

  • 1. Classic Model Checking in Reactive Software Systems US Naval Postgraduate School Donna A. Dulo US Dept of Army Fall 2007 SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 2. Model Checking is a cornerstone of verification engineering. - Amir Pneuli, 1996 Turing Award Recipient SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 3. Agenda Introduction to Classic Model Checking The Concept The Issues Classic Model Checkers Future Trends Conclusion SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 4. Introduction to Classic Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 5. Classic Model Checking Classic Model Checking refers to the Set of Non-Execution Based Algorithmic Approaches for Checking a Property expressed as:  A Linear Time Logic (LTL) Formula  A Computational Tree Logic (CTL) Formula  A CTL* Formula  A Finite State Automaton Against a model, which can be expressed as:  A Finite State Machine  A Kripke Structure SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 6. Classic Model Checking • Verification of finite state systems • Verification is performed automatically • Exhaustive search of the state space of the system to determine if the specification is true or false • Terminates with a Boolean: T/F (yes/no) that demonstrates a behavior which falsifies a property • Always provides a counterexample • Fault Trace • Clues for fixing the problem SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 7. Classic Model Checking • Implemented by Algorithms with reasonable efficiency • Can be used with other methodologies such as abstraction and induction to verify some systems that are not finite space • Transform an academic discipline into a viable practical technique for designers in the field • Simulations can be run by non-mathematicians in industrial settings SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 8. Why Formal Verification Through Model Checking? • Advent of Complex, Safety Critical Systems • Exponential growth in possible state space in complex system of systems designs that need to be evaluated • What trajectories will have the fatal flaw in the system? • Formal verification conducts an exhaustive exploration of all possible behaviors • Goal is completeness in exploration • Overarching goals are Safety, Predictability and Reliability of system software SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 9. The Concept of Classical Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 10. The Goal of Classic Model Checking Program void addSpaceParameters(Object 1) { buffer[wing1] = x; System OK buffer [wing 2] = y; resolution = x + y; } Object SW4920() { … Model } Checker ERROR Trace Requirements Requirement 1 …. Requirement 2 … Requirement 3 … …. Requirement n SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 11. The Implementation of Classic Model Checking Finite State Model System OK Model Checker ERROR Trace Temporal Logic Formula Error 1… Φ ( −> ◊ Ω) Error 2… Error 3… … Error n SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 12. Applying Model Checking to a Design In general, applying model checking to a design is comprised of three critical steps: 1. Modeling 2. Specification 3. Verification SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 13. Applying Model Checking to a Design Modeling • Conversion of design into a Formalism accepted by Model Checker • In some cases, this is a simple compilation task • For time and memory limited systems, abstraction is required • Elimination of Irrelevant details • Elimination of Unimportant/Trivial details SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 14. Applying Model Checking to a Design Specification • Statement of the properties the design must satisfy • Presented in a Logical Formalism • Use of temporal logic to assert how system behavior will evolve over Time • Critical Issue  Completeness • Impossible in complex systems to cover entire state space • Goal is as much completeness as possible in the specification SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 15. Applying Model Checking to a Design Verification • In an ideal situation, it is completely automatic, although most results need to be manually verified • Negative Result Case: • Error Trace is Provided • Used as a counterexample for the checked property • Assists designed in tracing error • Once error is traced and rectified, model checking needs to be repeated SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 16. Classic Model Checking in the Waterfall Model Classic Model Checking Requirements Design Code Test Maintenance “Modern” Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 17. The Issues in Classical Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 18. Benefits of Classic Model Checking • Automatic Verification • Invariants & Safety Properties • Absence of Dead-lock and Live-lock • Complex Event Sequencing Properties • In contract to testing: Gives Complete Coverage through Exhaustive Exploration of all System Paths • A solid compliment to other software quality assurance techniques • Used successfully for years in the Hardware and Protocol realms SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 19. Challenges of Classic Model Checking Model Construction SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 20. Challenges of Classic Model Checking Model Construction Program Finite State Model void addSpaceParameters(Object 1) { buffer[wing1] = x; Model buffer [wing 2] = y; resolution = x + y; GAP Checker } Object SW4920() { … } Semantic Gap: Programming Languages - Methods, Inheritance, Exceptions, etc……………. Model Description Languages - Automata SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 21. Challenges of Classic Model Checking Property Specification SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 22. Challenges of Classic Model Checking Property Specification It’s Difficult to Formalize a Requirement in Temporal Logic “Between the key being inserted and the key being removed, the ignition can be activated at most twice.” []((keyIn / <>keyRem) -> ((!activate / !keyRem) U (keyRem / ((activate / !keyRem) U (keyRem / ((!activate / !keyRem) U (keyRem / ((activate / !keyRem) U (keyRem / (!activate U keyRem)))))))))) SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 23. Challenges of Classic Model Checking State Explosion SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 24. Challenges of Classic Model Checking State Explosion • Costly in Terms of Time and Memory • A single 32 bit integer variable induces effectively 2^32 states • Explosive growth limits software scalability • Large or complex systems are impossible to verify • Completeness is not possible SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 25. Challenges of Classic Model Checking Output Interpretation SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 26. Challenges of Classic Model Checking Output Interpretation • Raw Error Traces may be 1000’s of Lines Long ERROR • Mapping of Error Traces to Code Can be Difficult Trace • Mapping made Difficult by: Error 1… • Semantic Gap Error 2… Error 3… … • Encoding of Complex Features Error n • Multiple Optimizations • Multiple Transformations SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 27. Classic Model Checking Programs SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 28. Classic Model Checkers Most popular developed in academia Classic Model Checkers available in the public domain: SPIN SMV SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 29. SMV Classic Model Checker • Symbolic Model Verifier • Developed in early 1990’s by Kenneth McMillan • Can verify specifications up to 10^1300 reachable states • Based on CTL • Input: • State Machine Model • Temporal Logic Formulas • SMV checks to see that the formulas are consistent with the model • Reports an Error Trace and in some cases a Counterexample • Open Source with many Variations/Extensions SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 30. SPIN Classic Model Checker • Automata Based Model Checking Tool • Developed in 1995 with significant popularity since • Promela (Process Meta Language) • LTL based  Formulae Converted to Buchi automata • SPIN can also act as a simulator following one possible execution path through the system and providing an execution trace • Supports modeling of asynchronous distributed algorithms and non-deterministic automata • Options: • Partial Order Reduction • State Compression • Weak Fairness Enforcement SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 31. Model Checking Example in ADA There are seven steps in model checking properties of an Ada program: 1. Conversion of the original Ada program to a safe finite-state variant 2. Translation to SEDL (SmallEiffel Dynamic Linking) compiler 3. Definition of program features to be reasoned about 4. Translation to model checker input 5. Property specification using defined features 6. Execution of the model checker 7. Interpretation of counter-examples for false results SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 32. Model Checking Example in ADA LTL State/Event Predicate Definitions SPIN Promela True Program Abstraction, or ADA Configuration, ADA to SEDL Restriction & INCA Counter- Source SEDL Specification Ada Example TRANS SMV CTL An ADA Translation Toolset SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 33. Variants of Classic Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 34. Variants of Classic Model Checking Symbolic Trajectory Evaluation (STE) Generalized Symbolic Trajectory Evaluation (GSTE) Model Checking with Theorem Proving FORTE SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 35. Symbolic Trajectory Evaluation (STE) • Lattice Based Model Checking based on Symbolic Simulation • Less Sensitive to State Explosion • Easier to Use than Classic Model Checkers • Medium to Large Design Checking with High Automation • Technological Breakthroughs in Model Checking • Dynamic Model Pruning • Advanced Parametric Techniques • Case Splitting on Input Data Space • Limitation: Finite Model Space SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 36. Generalized Symbolic Trajectory Evaluation (GSTE) • Generalized Theory of STE • Extends STE Model Checking to include Verification of Ω-regular Properties • Maintains Time and Space Efficiency • Infinite Space • Still in Research & Development SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 37. Classic Model Checking with Theorem Proving • A Promising Approach to Verifying Large Systems with Complex Properties that do not Lend Themselves well to Either Approach Alone • Model Checking has Capacity Limits that Need to be Decomposed • Theorem Proving Composes and Decomposes Model Checking Results instead of Formalizing Arbitrary Mathematical Results • Model Checking and Theorem Proving are Tightly Integrated • Result: Model Checking Results with no Need for Translation or Reformulation • Increased Capacity Space • More Efficiency SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 38. FORTE Formal Tools Environment • Intel Custom Built Verification Environment • Classic Model Checking Engines • Binary Decision Diagrams • Theorem Proving • “FL” Functional Programming Language (Strongly Typed) • Symbolic Trajectory Evaluation • Next Generation Platform includes reFLect Programming Language • Redesign of FL Core • Enhanced Support for Reflection • A Platform Well Suited for Describing and Manipulating High Level Design Specifications SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 39. Conclusion on Classic Model Checking SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 40. Coverage Space of Classic Model Checking • Limited in Specification Coverage Specification Coverage • Specifications are Text Based • Difficult to Visualize • Difficult to Validate • Very Limited in Program Coverage • State Explosion Problem • Limited to Finite State Verification Coverage Program Coverage • Abstractions Required • High Verification Coverage The Coverage Cuboid • Automatic • 100% Coverage • No Special Drivers Required SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 41. Cost Space of Classic Model Checking • High in Specification Cost Specification Cost • Specifications are Text Based • Difficult to Visualize • Difficult to Validate • High in Program Cost • State Explosion Problem • Limited to Finite State Verification Cost • Abstractions Required • Low in Verification Cost The Cost Cuboid • Automatic Program Cost • 100% Coverage • No Special Drivers Required SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 42. Questions? SW 4920 Formal Verification & Validation of Reactive Software Systems
  • 43. References Clark, E.M., Grumberg, O., & Peled, D.A. (1999). Model Checking. MIT Press: Cambridge. Corbett, J.C. & Pasareneau, C. (2007). Translating Ada programs for Model Checking. University of Hawaii. Drusinski, D., Michael, J.B., & Shing, M. (2007). “Three Dimensions of Formal Validation and Verification of Reactive System Behaviors. US Naval Postgraduate School, NPS-CS-07-008. Dwyer, M., Hatcliff, J. & Avrunin, G. (2004). Software Model Checking for Embedded Systems. Kansas State University. Intel Corporation. (2007). “Classic Model Checking Introduction”. www.intel.com. SW 4920 Formal Verification & Validation of Reactive Software Systems