SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
Formal Verification
Formal Verificationā€¦
ā€œā€¦is the act of proving or disproving the correctness of
intended algorithms underlying a system in respect to a
certain formal specification or property, using formal
methods of mathematicsā€ ā€“ Wikipedia
ā˜ŗ
System S ā†’ Model M, where M āˆ‹ [finite state
machine, labeled transition system, timed automata, ā€Ø
Petri net,ā€¦)
!
(M āˆˆ āŠØ) āˆ§ ((S ā©° M) āˆˆ āŠØ) ā‡’ S āˆˆ āŠØ
Why
ā€¢ find more bugs in design
and implementation
ā€¢ prove correctness
ā€¢ cut down testing and
maintenance cost
ā€¢ Common Criteria (ISO
15408), FIPS-140-2 ā€Ø
Level 4,ā€¦
ā€¢ build high-assurance
systems
Formal Verification of Design
ā€¢ Make a formal design by using a specification
language etc.
ā€¢ Define and formalize desired properties
ā€¢ Verify that the chosen formal property holds for
the formal design
!
describe ā†’ design ā†’ formalise ā†’ verify
Formal Verification of Design
ā€¢ Making formal design is (mostly) not fun
ā€¢ May not be enough details for interesting
properties
ā€¢ Far away from actual implementation
Formal Verification of Program
ā€¢ Use code as formal design document
ā€¢ Easier to combine with debugging and testing
ā€¢ Closer to actual implementation
ā€¢ Can benefit from additional methods like static
program analysis etc.
Code to Model Example
#include <stdio.h>
#include <stdlib.h>
!
int main(int argc, const char* argv[])
{
FILE* f;
int c, n = 0, w = 0;
!
if (argc < 2)
{
printf("Filename?n");
return 1;
}
!
f = fopen(argv[1], "r");
if (f == NULL)
{
printf("open error:%sn", argv[1]);
return 1;
}
!
!
!
!
!
while ((c = fgetc(f)) != -1)
{
if (!isspace(c))
{
if (!w)
++n, w = 1;
else
w = 0;
}
}
printf("Word count: %dn", n);
!
fclose(f);
return 0;
}
Code to Model Example
#include <stdio.h>
#include <stdlib.h>
!
int main(int argc, const char* argv[])
{
FILE* f;
int c, n = 0, w = 0;
!
if (argc < 2)
{
printf("Filename?n");
return 1;
}
!
f = fopen(argv[1], "r");
if (f == NULL)
{
printf("open error:%sn", argv[1]);
return 1;
}
!
!
!
!
!
while ((c = fgetc(f)) != -1)
{
if (!isspace(c))
{
if (!w)
++n, w = 1;
else
w = 0;
}
}
printf("Word count: %dn", n);
!
fclose(f);
return 0;
}
Code to Model Example
#include <stdio.h>
#include <stdlib.h>
!
int main(int argc, const char* argv[])
{
FILE* f;
int c, n = 0, w = 0;
!
if (argc < 2)
{
printf("Filename?n");
return 1;
}
!
f = fopen(argv[1], "r");
if (f == NULL)
{
printf("open error:%sn", argv[1]);
return 1;
}
!
!
!
!
!
while ((c = fgetc(f)) != -1)
{
if (!isspace(c))
{
if (!w)
++n, w = 1;
else
w = 0;
}
}
printf("Word count: %dn", n);
!
fclose(f);
return 0;
}
Code to Model Example
#include <stdio.h>
#include <stdlib.h>
!
int main()
{
FILE* f;
int c, n = 0, w = 0;
enum {FALSE,TRUE} B1;
!
if (B1 = any())
{
return 1;
}
!
f = fopen(ā€œsampleā€, "r");
if (f == NULL)
{
return 1;
}
!
!
!
!
!
while ((c = fgetc(f)) != -1)
{
if (!isspace(c))
{
if (!w)
++n, w = 1;
else
w = 0;
}
}
fclose(f);
return 0;
}
Code to Model Example
#include <stdio.h>
#include <stdlib.h>
!
int main()
{
FILE* f;
int w = 0;
enum {FALSE,TRUE} B1, B2, B3;
!
if (B1 = any())
{
return 1;
}
!
f = fopen(ā€œsampleā€, "r");
if (f == NULL)
{
return 1;
}
!
!
!
!
!
while (B2 = any())
{
if (B3 = any())
{
if (!w)
w = 1;
else
w = 0;
}
}
fclose(f);
return 0;
}
Code to Model Example
int main()
{
enum {FALSE,TRUE} B1, B2, B3;
enum {FCLOSED, FOPEN, FERROR} fileState;
enum {V0, V1} W = V0;
fileState = FCLOSED;
!
if (B1 = any())
{
return 1;
}
if (any())
{
fileState = FOPEN;
}
else
{
fileState = FERROR;
}
if (fileState == FERROR)
{
return 1;
}
!
!
!
!
!
while (B2 = any())
{
if (B3 = any())
{
if (!w)
W = V1;
else
W = V0;
}
}
fileState = FCLOSED;
return 0;
}
Code to Model Example
int main()
{
enum {FCLOSED, FOPEN, FERROR} fileState;
!
fileState = FCLOSED;
!
if (any())
{
fileState = FERROR;
}
else if (any())
{
fileState = FOPEN;
while (any());
fileState = FCLOSED;
}
return 0;
}
!
entry
FCLOSED1
FERROR FOPEN
FCLOSED2
exit
Formal Verification Techniques
ā€¢ Theorem Proving
ā€¢ Model Checking
ā€¢ Ad hoc voodoo magic
!
!
!
!
!
Although these appear to be contradictory approaches, there has been considerable
effort to incorporate theorem proving and model checking
Theorem Proving
ā€¢ Logical deduction at the intersection of
mathematics and logics
ā€¢ Prove that implementation satisfies specification
by mathematical reasoning
ā€¢ implementation and specification as formulae in a some
formal logic
ā€¢ required relationship (equivalence/implication) as a
theorem to prove by using a set of axioms and inference
rules (simplification, induction, etc.)
Theorem Proving
by hand ā€“ classic approach
ā€¢ human errors (similar to programming)
ā€¢ unsuitable for verifying large software and
hardware systems
Theorem Proving
with some machine support ā€“ machine
checks the syntax, fixes layout, translates into
different (meta)languages
ā€¢ less errors, readable consistent statements
ā€¢ still unsuitable for verifying large software and
hardware systems
Theorem Proving
interactive ā€“ proofs are fully checked by machine
based on proof steps provided by user
ā€¢ guaranteed correctness (if the prover is correct)
ā€¢ can prove everything that is provable by hand
Theorem Proving
automated ā€“ theorem is shown by machine; user
must state it in a proper form so that the prover can
solve the problem within reasonable amount of
time
ā€¢ may be used by non-specialists
ā€¢ may be faster than interactive proving
ā€¢ many problems cannot be proved automatically
ā€¢ can often deal only with finite problems
Limitations of Theorem Proving
ā€¢ Large manpower investment to prove small
theorems, difficult to prove large or hard
theorems
ā€¢ Usable only by experts, requires deep
understanding of both the system design and
proving methodology
ā€¢ Automated for narrow class of system designs
Model Checking
Automated technique that, given a finite-state
model of a system and a formal property,
systematically checks whether this property holds
for (a given state in) that model.
!
Modelling ā†’ Running ā†’ Analysing
Modelling
ā€¢ Model the system under consideration using the
model description language of the model
checker at hand
ā€¢ As a first sanity check and quick assessment of
the model perform some simulations
ā€¢ Formalise the property to be checked using the
property specification language.
Running
ā€¢ Run the model checker to check the validity of
the property in the system model.
Analysis
ā€¢ Property satisfied?
ā€¢ Check next property (if any)
ā€¢ Property violated?
ā€¢ Analyse generated counterexample by simulation
ā€¢ Refine the model, design, or property
ā€¢ Repeat the entire procedure.
ā€¢ Out of memory?
ā€¢ Try to reduce the model and try again.
Temporal Logic Model Checking
ā€¢ Specifications are written in propositional
temporal logic to specify time related system
behaviour properties either in absolute time or
in terms of sequences of state transitions
ā€¢ Verification is an exhaustive search of the state
space of the design
Basic Temporal Operators
Let p be an atomic proposition, e.g. device_Enabled
ā€¢ Xp ā€“ p holds next time
ā€¢ Fp ā€“ p holds sometime in a future
ā€¢ Gp ā€“ p holds globally in a future (always)
ā€¢ pUq ā€“ p holds until another atomic proposition
q holds
!
Use with Ā¬āˆ§āˆØ etc. to form temporal logic formulae
Temporal Logic Formula Example
The microwave oven does not heat up until
the door is closed
!
Not heat_up holds until door_closed
!
(Ā¬heat_up) U door_closed
Temporal Logic Formula Example
The microwave oven does not heat up until
the door is closed
!
Not heat_up holds until door_closed
!
(Ā¬heat_up) U (door_closed āˆ§ powered_on)
Temporal Logic Model Checking Goals
Safety ā€“Ā something bad will never happen.ā€Ø
To satisfy, the system must not demonstrate
forbidden behaviour
!
Liveness ā€“ something good will happen in future.ā€Ø
To satisfy, the system must demonstrate desired
behaviour
Model Checking: Older Approaches
ā€¢ Construct a model of a system in terms of a
finite state machine
ā€¢ Choose a property, express it in some sort of
temporal logic and use a tool to explore the
state space and to check if the property holds
ā€¢ Explicit-state checker enumerates all possible states
[SPIN]
ā€¢ Symbolic checker uses binary decision diagram (BDD) to
encode the state transition function [NuSMV etc.]
Model Checking: Older Approaches
ā€¢ Good for liveness and safety properties
ā€¢ ā€œis a state with property p reachable?ā€
ā€¢ ā€œif I see x, will I eventually see y?ā€
ā€¢ ā€œis property p true for all states?ā€
ā€¢ Ill-suitable for functional properties
ā€¢ ā€œdoes this function compute AES-256?ā€
Model Checking: Newer Approaches
SAT-based model checkers
ā€¢ Bounded model-checking (BMC) ā€“ an otherwise
large or even infinite-state FSM can be analysed
by checking a finite number of state transitions
ā€¢ Property directed reachability (PDR) ā€“ combination
of induction, over-approximation and SAT
solving
Model Checking: Newer Approaches
Going into details of SAT and SMT solvers is
probably too much to handle for this session.
!
X(explain_sat āˆ§ explain_smt)
Model Checking Strengths
ā€¢ General verification approach that is applicable
to a wide range of systems
ā€¢ Supports partial verification (properties can be
checked individually, essential ones first)
ā€¢ Provides diagnostic information in case a
property is invalidated (useful for debugging)
Model Checking Strengths (cont.)
ā€¢ Requires neither a high degree of user
interaction nor a high degree of expertise
ā€¢ Can be easily integrated in existing
development cycles
ā€¢ Sound mathematical underpinning, based on
theory of graph algorithms, data structures,
logic etc.
Model Checking Weaknesses
ā€¢ Mainly for control-intensive systems, less
suitable for data-intensive ones
ā€¢ Verifies a model and not the actual system itself;
complimentary techniques are needed (testing
etc.)
ā€¢ Check only stated requirements, completeness is
not guaranteed
Model Checking Weaknesses (cont.)
ā€¢ Suffers from the state-space explosion problem
ā€¢ Requires some expertise in finding appropriate
abstractions to obtain smaller system models
and to state properties in the logical formalism
used
ā€¢ Does not allow checking generalisations
ā€¢ A model checker may contain software defects
Model Checking
Provided various approaches, it is an effective
technique to expose design errors
Formally Verified System
Design
Model
Implementation
theorem proving
model checking
logic/syntax checkers
testing
Thank you
This presentation is based on materials provided courtesy of and various publicly available Internet sources.
All grammar and syntax errors are, letā€™s say, for watermarking purposesā€Ø
2013

Weitere Ƥhnliche Inhalte

Was ist angesagt?

ASIC design verification
ASIC design verificationASIC design verification
ASIC design verificationGireesh Kallihal
Ā 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic SequencesArrow Devices
Ā 
verification and validation
verification and validationverification and validation
verification and validationDinesh Pasi
Ā 
01 Transition Fault Detection methods by Swetha
01 Transition Fault Detection methods by Swetha01 Transition Fault Detection methods by Swetha
01 Transition Fault Detection methods by Swethaswethamg18
Ā 
Verification Challenges and Methodologies
Verification Challenges and MethodologiesVerification Challenges and Methodologies
Verification Challenges and MethodologiesDr. Shivananda Koteshwar
Ā 
Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6Abdul Basit
Ā 
Unit testing
Unit testing Unit testing
Unit testing Mani Kanth
Ā 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4 Mohammad Faizan
Ā 
Software Testing
Software TestingSoftware Testing
Software TestingVishal Singh
Ā 
Risk-based Testing
Risk-based TestingRisk-based Testing
Risk-based TestingJohan Hoberg
Ā 
Control Flow Graphs
Control Flow GraphsControl Flow Graphs
Control Flow Graphsdaimk2020
Ā 
Software testing
Software testingSoftware testing
Software testingOmar Al-Bokari
Ā 
Principles of Software testing
Principles of Software testingPrinciples of Software testing
Principles of Software testingMd Mamunur Rashid
Ā 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and typesConfiz
Ā 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesRamdas Mozhikunnath
Ā 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts pptRathna Priya
Ā 
Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Daniyal Mughal
Ā 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life CycleSlideshare
Ā 

Was ist angesagt? (20)

ASIC design verification
ASIC design verificationASIC design verification
ASIC design verification
Ā 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
Ā 
verification and validation
verification and validationverification and validation
verification and validation
Ā 
01 Transition Fault Detection methods by Swetha
01 Transition Fault Detection methods by Swetha01 Transition Fault Detection methods by Swetha
01 Transition Fault Detection methods by Swetha
Ā 
Verification Challenges and Methodologies
Verification Challenges and MethodologiesVerification Challenges and Methodologies
Verification Challenges and Methodologies
Ā 
Black box and white box testing
Black box and white box testingBlack box and white box testing
Black box and white box testing
Ā 
Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6Planning for software quality assurance lecture 6
Planning for software quality assurance lecture 6
Ā 
Unit testing
Unit testing Unit testing
Unit testing
Ā 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4
Ā 
Software Testing
Software TestingSoftware Testing
Software Testing
Ā 
Risk-based Testing
Risk-based TestingRisk-based Testing
Risk-based Testing
Ā 
Control Flow Graphs
Control Flow GraphsControl Flow Graphs
Control Flow Graphs
Ā 
Software Testing
Software TestingSoftware Testing
Software Testing
Ā 
Software testing
Software testingSoftware testing
Software testing
Ā 
Principles of Software testing
Principles of Software testingPrinciples of Software testing
Principles of Software testing
Ā 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
Ā 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
Ā 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
Ā 
Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6
Ā 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
Ā 

Andere mochten auch

Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesNirav Desai
Ā 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...Vladimir Ivanov
Ā 
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine "Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine Vladimir Ivanov
Ā 
#1 formal methods ā€“ introduction for software engineering
#1 formal methods ā€“ introduction for software engineering#1 formal methods ā€“ introduction for software engineering
#1 formal methods ā€“ introduction for software engineeringSharif Omar Salem
Ā 
Ch8-Software Engineering 9
Ch8-Software Engineering 9Ch8-Software Engineering 9
Ch8-Software Engineering 9Ian Sommerville
Ā 
DCS PRESENTATION
DCS PRESENTATIONDCS PRESENTATION
DCS PRESENTATIONbvent2005
Ā 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software designPiyush Gogia
Ā 

Andere mochten auch (9)

Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
Ā 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
Ā 
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine "Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
Ā 
#1 formal methods ā€“ introduction for software engineering
#1 formal methods ā€“ introduction for software engineering#1 formal methods ā€“ introduction for software engineering
#1 formal methods ā€“ introduction for software engineering
Ā 
Ch8-Software Engineering 9
Ch8-Software Engineering 9Ch8-Software Engineering 9
Ch8-Software Engineering 9
Ā 
Ch8.testing
Ch8.testingCh8.testing
Ch8.testing
Ā 
DCS PRESENTATION
DCS PRESENTATIONDCS PRESENTATION
DCS PRESENTATION
Ā 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software design
Ā 
Lec1
Lec1Lec1
Lec1
Ā 

Ƅhnlich wie Formal Verification

The Evolution of Development Testing
The Evolution of Development TestingThe Evolution of Development Testing
The Evolution of Development TestingCathal King
Ā 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticLB Denker
Ā 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfNayanChandak1
Ā 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingRam Awadh Prasad, PMP
Ā 
Parallel run selenium tests in a good way
Parallel run selenium tests in a good  wayParallel run selenium tests in a good  way
Parallel run selenium tests in a good wayCOMAQA.BY
Ā 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019Olivera Milenkovic
Ā 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachIvo Neskovic
Ā 
Software testing
Software testingSoftware testing
Software testingEnamul Haque
Ā 
Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Mark Niebergall
Ā 
Sva.pdf
Sva.pdfSva.pdf
Sva.pdfSamHoney6
Ā 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsOrtus Solutions, Corp
Ā 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
Ā 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtestingasifusman1998
Ā 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
Ā 
Measuring Your Code
Measuring Your CodeMeasuring Your Code
Measuring Your CodeNate Abele
Ā 
Measuring Your Code 2.0
Measuring Your Code 2.0Measuring Your Code 2.0
Measuring Your Code 2.0Nate Abele
Ā 
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²COMAQA.BY
Ā 
A la dƩcouverte des google/test (aka gtest)
A la dƩcouverte des google/test (aka gtest)A la dƩcouverte des google/test (aka gtest)
A la dƩcouverte des google/test (aka gtest)Thierry Gayet
Ā 

Ƅhnlich wie Formal Verification (20)

The Evolution of Development Testing
The Evolution of Development TestingThe Evolution of Development Testing
The Evolution of Development Testing
Ā 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
Ā 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
Ā 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step Training
Ā 
Parallel run selenium tests in a good way
Parallel run selenium tests in a good  wayParallel run selenium tests in a good  way
Parallel run selenium tests in a good way
Ā 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
Ā 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Ā 
Software testing
Software testingSoftware testing
Software testing
Ā 
Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022
Ā 
Sva.pdf
Sva.pdfSva.pdf
Sva.pdf
Ā 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
Ā 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
Ā 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
Ā 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
Ā 
Lec1.ppt
Lec1.pptLec1.ppt
Lec1.ppt
Ā 
Measuring Your Code
Measuring Your CodeMeasuring Your Code
Measuring Your Code
Ā 
Measuring Your Code 2.0
Measuring Your Code 2.0Measuring Your Code 2.0
Measuring Your Code 2.0
Ā 
Cs 331 Data Structures
Cs 331 Data StructuresCs 331 Data Structures
Cs 331 Data Structures
Ā 
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²
Š”ŠøстŠµŠ¼Š½Ń‹Š¹ Š²Š·Š³Š»ŃŠ“ Š½Š° ŠæŠ°Ń€Š°Š»Š»ŠµŠ»ŃŒŠ½Ń‹Š¹ Š·Š°ŠæусŠŗ Selenium тŠµŃŃ‚Š¾Š²
Ā 
A la dƩcouverte des google/test (aka gtest)
A la dƩcouverte des google/test (aka gtest)A la dƩcouverte des google/test (aka gtest)
A la dƩcouverte des google/test (aka gtest)
Ā 

KĆ¼rzlich hochgeladen

Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
Ā 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
Ā 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
Ā 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
Ā 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
Ā 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto GonzƔlez Trastoy
Ā 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
Ā 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
Ā 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
Ā 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
Ā 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
Ā 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
Ā 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
Ā 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
Ā 

KĆ¼rzlich hochgeladen (20)

Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
Ā 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
Ā 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Ā 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Ā 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
Ā 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Ā 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Ā 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Ā 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
Ā 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ā 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
Ā 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
Ā 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
Ā 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Ā 

Formal Verification

  • 2. Formal Verificationā€¦ ā€œā€¦is the act of proving or disproving the correctness of intended algorithms underlying a system in respect to a certain formal specification or property, using formal methods of mathematicsā€ ā€“ Wikipedia
  • 3. ā˜ŗ System S ā†’ Model M, where M āˆ‹ [finite state machine, labeled transition system, timed automata, ā€Ø Petri net,ā€¦) ! (M āˆˆ āŠØ) āˆ§ ((S ā©° M) āˆˆ āŠØ) ā‡’ S āˆˆ āŠØ
  • 4. Why ā€¢ find more bugs in design and implementation ā€¢ prove correctness ā€¢ cut down testing and maintenance cost ā€¢ Common Criteria (ISO 15408), FIPS-140-2 ā€Ø Level 4,ā€¦ ā€¢ build high-assurance systems
  • 5. Formal Verification of Design ā€¢ Make a formal design by using a specification language etc. ā€¢ Define and formalize desired properties ā€¢ Verify that the chosen formal property holds for the formal design ! describe ā†’ design ā†’ formalise ā†’ verify
  • 6. Formal Verification of Design ā€¢ Making formal design is (mostly) not fun ā€¢ May not be enough details for interesting properties ā€¢ Far away from actual implementation
  • 7. Formal Verification of Program ā€¢ Use code as formal design document ā€¢ Easier to combine with debugging and testing ā€¢ Closer to actual implementation ā€¢ Can benefit from additional methods like static program analysis etc.
  • 8. Code to Model Example #include <stdio.h> #include <stdlib.h> ! int main(int argc, const char* argv[]) { FILE* f; int c, n = 0, w = 0; ! if (argc < 2) { printf("Filename?n"); return 1; } ! f = fopen(argv[1], "r"); if (f == NULL) { printf("open error:%sn", argv[1]); return 1; } ! ! ! ! ! while ((c = fgetc(f)) != -1) { if (!isspace(c)) { if (!w) ++n, w = 1; else w = 0; } } printf("Word count: %dn", n); ! fclose(f); return 0; }
  • 9. Code to Model Example #include <stdio.h> #include <stdlib.h> ! int main(int argc, const char* argv[]) { FILE* f; int c, n = 0, w = 0; ! if (argc < 2) { printf("Filename?n"); return 1; } ! f = fopen(argv[1], "r"); if (f == NULL) { printf("open error:%sn", argv[1]); return 1; } ! ! ! ! ! while ((c = fgetc(f)) != -1) { if (!isspace(c)) { if (!w) ++n, w = 1; else w = 0; } } printf("Word count: %dn", n); ! fclose(f); return 0; }
  • 10. Code to Model Example #include <stdio.h> #include <stdlib.h> ! int main(int argc, const char* argv[]) { FILE* f; int c, n = 0, w = 0; ! if (argc < 2) { printf("Filename?n"); return 1; } ! f = fopen(argv[1], "r"); if (f == NULL) { printf("open error:%sn", argv[1]); return 1; } ! ! ! ! ! while ((c = fgetc(f)) != -1) { if (!isspace(c)) { if (!w) ++n, w = 1; else w = 0; } } printf("Word count: %dn", n); ! fclose(f); return 0; }
  • 11. Code to Model Example #include <stdio.h> #include <stdlib.h> ! int main() { FILE* f; int c, n = 0, w = 0; enum {FALSE,TRUE} B1; ! if (B1 = any()) { return 1; } ! f = fopen(ā€œsampleā€, "r"); if (f == NULL) { return 1; } ! ! ! ! ! while ((c = fgetc(f)) != -1) { if (!isspace(c)) { if (!w) ++n, w = 1; else w = 0; } } fclose(f); return 0; }
  • 12. Code to Model Example #include <stdio.h> #include <stdlib.h> ! int main() { FILE* f; int w = 0; enum {FALSE,TRUE} B1, B2, B3; ! if (B1 = any()) { return 1; } ! f = fopen(ā€œsampleā€, "r"); if (f == NULL) { return 1; } ! ! ! ! ! while (B2 = any()) { if (B3 = any()) { if (!w) w = 1; else w = 0; } } fclose(f); return 0; }
  • 13. Code to Model Example int main() { enum {FALSE,TRUE} B1, B2, B3; enum {FCLOSED, FOPEN, FERROR} fileState; enum {V0, V1} W = V0; fileState = FCLOSED; ! if (B1 = any()) { return 1; } if (any()) { fileState = FOPEN; } else { fileState = FERROR; } if (fileState == FERROR) { return 1; } ! ! ! ! ! while (B2 = any()) { if (B3 = any()) { if (!w) W = V1; else W = V0; } } fileState = FCLOSED; return 0; }
  • 14. Code to Model Example int main() { enum {FCLOSED, FOPEN, FERROR} fileState; ! fileState = FCLOSED; ! if (any()) { fileState = FERROR; } else if (any()) { fileState = FOPEN; while (any()); fileState = FCLOSED; } return 0; } ! entry FCLOSED1 FERROR FOPEN FCLOSED2 exit
  • 15. Formal Verification Techniques ā€¢ Theorem Proving ā€¢ Model Checking ā€¢ Ad hoc voodoo magic ! ! ! ! ! Although these appear to be contradictory approaches, there has been considerable effort to incorporate theorem proving and model checking
  • 16. Theorem Proving ā€¢ Logical deduction at the intersection of mathematics and logics ā€¢ Prove that implementation satisfies specification by mathematical reasoning ā€¢ implementation and specification as formulae in a some formal logic ā€¢ required relationship (equivalence/implication) as a theorem to prove by using a set of axioms and inference rules (simplification, induction, etc.)
  • 17. Theorem Proving by hand ā€“ classic approach ā€¢ human errors (similar to programming) ā€¢ unsuitable for verifying large software and hardware systems
  • 18. Theorem Proving with some machine support ā€“ machine checks the syntax, fixes layout, translates into different (meta)languages ā€¢ less errors, readable consistent statements ā€¢ still unsuitable for verifying large software and hardware systems
  • 19. Theorem Proving interactive ā€“ proofs are fully checked by machine based on proof steps provided by user ā€¢ guaranteed correctness (if the prover is correct) ā€¢ can prove everything that is provable by hand
  • 20. Theorem Proving automated ā€“ theorem is shown by machine; user must state it in a proper form so that the prover can solve the problem within reasonable amount of time ā€¢ may be used by non-specialists ā€¢ may be faster than interactive proving ā€¢ many problems cannot be proved automatically ā€¢ can often deal only with finite problems
  • 21. Limitations of Theorem Proving ā€¢ Large manpower investment to prove small theorems, difficult to prove large or hard theorems ā€¢ Usable only by experts, requires deep understanding of both the system design and proving methodology ā€¢ Automated for narrow class of system designs
  • 22. Model Checking Automated technique that, given a finite-state model of a system and a formal property, systematically checks whether this property holds for (a given state in) that model. ! Modelling ā†’ Running ā†’ Analysing
  • 23. Modelling ā€¢ Model the system under consideration using the model description language of the model checker at hand ā€¢ As a first sanity check and quick assessment of the model perform some simulations ā€¢ Formalise the property to be checked using the property specification language.
  • 24. Running ā€¢ Run the model checker to check the validity of the property in the system model.
  • 25. Analysis ā€¢ Property satisfied? ā€¢ Check next property (if any) ā€¢ Property violated? ā€¢ Analyse generated counterexample by simulation ā€¢ Refine the model, design, or property ā€¢ Repeat the entire procedure. ā€¢ Out of memory? ā€¢ Try to reduce the model and try again.
  • 26. Temporal Logic Model Checking ā€¢ Specifications are written in propositional temporal logic to specify time related system behaviour properties either in absolute time or in terms of sequences of state transitions ā€¢ Verification is an exhaustive search of the state space of the design
  • 27. Basic Temporal Operators Let p be an atomic proposition, e.g. device_Enabled ā€¢ Xp ā€“ p holds next time ā€¢ Fp ā€“ p holds sometime in a future ā€¢ Gp ā€“ p holds globally in a future (always) ā€¢ pUq ā€“ p holds until another atomic proposition q holds ! Use with Ā¬āˆ§āˆØ etc. to form temporal logic formulae
  • 28. Temporal Logic Formula Example The microwave oven does not heat up until the door is closed ! Not heat_up holds until door_closed ! (Ā¬heat_up) U door_closed
  • 29. Temporal Logic Formula Example The microwave oven does not heat up until the door is closed ! Not heat_up holds until door_closed ! (Ā¬heat_up) U (door_closed āˆ§ powered_on)
  • 30. Temporal Logic Model Checking Goals Safety ā€“Ā something bad will never happen.ā€Ø To satisfy, the system must not demonstrate forbidden behaviour ! Liveness ā€“ something good will happen in future.ā€Ø To satisfy, the system must demonstrate desired behaviour
  • 31. Model Checking: Older Approaches ā€¢ Construct a model of a system in terms of a finite state machine ā€¢ Choose a property, express it in some sort of temporal logic and use a tool to explore the state space and to check if the property holds ā€¢ Explicit-state checker enumerates all possible states [SPIN] ā€¢ Symbolic checker uses binary decision diagram (BDD) to encode the state transition function [NuSMV etc.]
  • 32. Model Checking: Older Approaches ā€¢ Good for liveness and safety properties ā€¢ ā€œis a state with property p reachable?ā€ ā€¢ ā€œif I see x, will I eventually see y?ā€ ā€¢ ā€œis property p true for all states?ā€ ā€¢ Ill-suitable for functional properties ā€¢ ā€œdoes this function compute AES-256?ā€
  • 33. Model Checking: Newer Approaches SAT-based model checkers ā€¢ Bounded model-checking (BMC) ā€“ an otherwise large or even infinite-state FSM can be analysed by checking a finite number of state transitions ā€¢ Property directed reachability (PDR) ā€“ combination of induction, over-approximation and SAT solving
  • 34. Model Checking: Newer Approaches Going into details of SAT and SMT solvers is probably too much to handle for this session. ! X(explain_sat āˆ§ explain_smt)
  • 35. Model Checking Strengths ā€¢ General verification approach that is applicable to a wide range of systems ā€¢ Supports partial verification (properties can be checked individually, essential ones first) ā€¢ Provides diagnostic information in case a property is invalidated (useful for debugging)
  • 36. Model Checking Strengths (cont.) ā€¢ Requires neither a high degree of user interaction nor a high degree of expertise ā€¢ Can be easily integrated in existing development cycles ā€¢ Sound mathematical underpinning, based on theory of graph algorithms, data structures, logic etc.
  • 37. Model Checking Weaknesses ā€¢ Mainly for control-intensive systems, less suitable for data-intensive ones ā€¢ Verifies a model and not the actual system itself; complimentary techniques are needed (testing etc.) ā€¢ Check only stated requirements, completeness is not guaranteed
  • 38. Model Checking Weaknesses (cont.) ā€¢ Suffers from the state-space explosion problem ā€¢ Requires some expertise in finding appropriate abstractions to obtain smaller system models and to state properties in the logical formalism used ā€¢ Does not allow checking generalisations ā€¢ A model checker may contain software defects
  • 39. Model Checking Provided various approaches, it is an effective technique to expose design errors
  • 40. Formally Verified System Design Model Implementation theorem proving model checking logic/syntax checkers testing
  • 41. Thank you This presentation is based on materials provided courtesy of and various publicly available Internet sources. All grammar and syntax errors are, letā€™s say, for watermarking purposesā€Ø 2013