SlideShare una empresa de Scribd logo
1 de 52
Descargar para leer sin conexión
Institute for System Programming of the Russian Academy of Sciences
Industry practices of
advanced program
analysis
Alexey Khoroshilov
khoroshilov@ispras.ru
ExTENT-2016
London, 22 June 2016
The Goal of Verification
to make sure there is no any bugs in any
possible execution of the target software
●
with minimal cost
Verification
Fresh Software Verified Software
The Goal of Verification
to achieve maximal assurance that there is no
any bugs in any possible execution of the
target software
●
within reasonable cost
Verification
Fresh Software Verified Software
Testing
Test
Test Suite
1 kind
of bugs
all kinds
of bugs
in all executionsin 1 execution
Inductive Reasoning
●
Conclusions are supported by its premises
●
If premises are true, it would be unlikely
impossible for the conclusions to be false
●
Example:
●
Every time I’ve walked by that dog,
he hasn’t tried to bite me.
●
So, the next time I walk by that dog he won’t
try to bite me.
Inductive Reasoning
●
Conclusions are supported by its premises
●
If premises are true, it would be unlikely
impossible for the conclusions to be false
●
Example:
●
The component behaves correctly
on all test data.
●
So, the component always
behaves correctly.
Inductive Reasoning on Program
Correctness
●
The component behaves correctly on all
test data
●
Tests are quite representative
=>
●
The component always behaves correctly
Deductive Reasoning
●
Conclusions certainly follow
from its premises
●
If premises are true, it is impossible for the
conclusions to be false
●
Example:
●
All men are mortal.
●
Socrates is a man.
●
Therefore, Socrates is mortal.
Deductive Reasoning on
Program Correctness
Target
Component
Requirements
Review
Deductive Reasoning on
Program Correctness
Target
Component
Requirements
Deductive Reasoning on
Program Correctness
●
If assumptions are held
●
regarding compiler&linker
●
regarding environment behaviour
●
regarding input data
●
The component always behaves correctly
Deductive Reasoning on
Program Correctness
●
If assumptions are held
●
regarding compiler&linker
●
regarding environment behaviour
●
regarding input data
●
The component always behaves correctly
(i.e. terminates and its output satisfies to
postcondition)
Deductive Verification
Historical Perspective
1947
1970
●
Lecture of Alan Turing to London Mathematical Society
●
Methods of Floyd/Hoare
START:
( y1
, y2
)  ( 0, x1
)
y2
 x2
FT
( y1
, y2
)  ( y1
+1, y2
- x2
) HALT:
( z1
, z2
)  ( y1
, y2
)
A: Precondition
(x1
 0)  (x2
 0)
С: Postcondition
(x1
= z1
x2
+ z2
)  (0  z2
< x2
)
B: Invariant
(x1
= y1
x2
+ y2
) ∧ (y2
 0)
Deductive Verification
Prove program correctness by induction:
Let precondition to be held in A we pass A->B => Invariant is held in B
Let invariant to be held in B we pass B-T->B => Invariant is held in B
Let invariant to be held in B we pass B-F->C => Postcondition is held in С
Let precondition to be held in A we pass A->C => Postcondition is held in С
=>
Deductive Verification
Historical Perspective
1947
1970
2000
●
Lecture of Alan Turing to London Mathematical Society
●
Methods of Floyd/Hoare
●
Deductive verifcation tools for Ada, C, Java, С#
●
SunRise, ESC/Java, Frama-C, LOOP, Boogie/VCC
Deductive Verification
Historical Perspective
1947
1970
2000
2010
●
Lecture of Alan Turing to London Mathematical Society
●
Methods of Floyd/Hoare
●
Deductive verifcation tools for Ada, C, Java, С#
●
SunRise, ESC/Java, Frama-C, LOOP, Boogie/VCC
●
Application in real-life projects for small-size components
●
Nuclear power (UK, France)
●
Avionics (Airbus, NASA, UK Air Traffic Control)
●
Components of operating systems
(seL4, Verisoft, Verisoft-XT)
Industry Applications
●
UK Air Traffic Management System
●
250 KLOC of logical lines of code (in Ada)
●
proof type safety, few functional correctness
code
●
153K VCs, of which 98.76% are proven
automatically
(*) Angela Wallenburg “Safe and Secure Programming Using Spark”
Years Tools Target code Scope Size
Verisoft 2004-2008 Isabelle
designed for
verification
hw/kernel/
compiler/
libraries/apps
10 kLOC
(kernel)
L4.verified
seL4
2004-2009 Isabelle
designed for
verification,
performance
oriented
microkernel
security model
(no MMU)
7.5 kLOC
(without
asm and
boot)
Verisoft-XT
small-hv
2007-2013 VCC
designed for
verification
separation
property only
2.5 kLOC
Verisoft-XT
Hyper-V
2007-2013 VCC industrial
separation
property only
100 kLOC
Verisoft-XT
PikeOS
2007-2013 VCC
industrial,
simplicity for
performance
some system
calls
10 KLOC
OS Deductive Verification
Linux Verification Center
founded in 2005
●
OLVER Program
●
Linux Standard Base Infrastructure Program
●
Linux Driver Verification Program
●
Linux File System Verification Program
●
Linux Deductive Verification Program
Toolset for Event-B models verification
Model of security
requirements
Formalized security
model
Formalized
low-level security
model
Manual
Automated
verification
Security
requirements
Security model
AstraVer Toolchain (*)
for deductive verification of C programs
(based on Frama-C – Jessie – Why3)
Pre-/post-conditions
of LSM operations
Security
arcitecture
LSM
source code
Model of security
requirements
Mathematical
notation
LSM
Implementation
implements
Specificatiion of
library functions
Linux
kernel
AstraVer Project
AstraLinux(*) The research on deductive verification tools development was carried out with funding from
the Ministry of Education and Science of Russia (the project unique identifier is RFMEFI60414X0051
Deductive Verification Status
●
Reasonable Tool Support
●
Ada, C, C#, Java
●
Functional specification as comments,
even natively supported in Ada-2012
●
Dedicated languages: Boogie, Why3
●
Manual efforts still significant
●
up to 10x of development efforts
●
highly skilled team required
Testing and Deductive Verification
1 kind
bugs
all kinds
of bugs
in all executions
Deductive
1. Proof of complete correctness
under some assumptions
2. Very labour intensive and
time consuming
in 1 execution
Test
Test Suite
Testing
Deductive
Verification
Kind of bugs almost all almost all
Executions
under analysis
small almost all
Development
cost
linear huge
Execution
cost
hw small
(target hw)
hw small
Result analysis
cost
small big
Maintenance
cost
small to big huge
Testing and Deductive Verification
Deductive Verification Status (2)
●
reasonable to apply only for really important
code
Static Analysis
●
is a commodity
●
mature market of static analysis tools
SVACE by ISPRAS
●
Static analysis of C/C++/Java code,
Linux/Windows
●
150+ kinds of defects
●
Buffer overflows, NULL-pointer dereferences
●
Memory management, tainted input
●
Concurrency issues
●
Lightweight analysis of semantic patterns
●
Eclipse plugin or WebUI
Testing
Static
Analysis
Deductive
Verification
Kind of bugs almost all
safety
only
almost all
Executions
under analysis
small almost all almost all
Development
cost
linear 0 to small huge
Execution
cost
hw small
(target hw)
hw small hw small
Result analysis
cost
small
medium
(false alarms)
big
Maintenance
cost
small to big small huge
Testing and Program Analysis
Testing
Static
Analysis
Deductive
Verification
Kind of bugs almost all
safety
only
almost all
Executions
under analysis
small
big
almost all
almost all
Development
cost
linear 0 to small huge
Execution
cost
hw small
(target hw)
hw small hw small
Result analysis
cost
small
medium
(false alarms)
big
Maintenance
cost
small to big small huge
Testing and Program Analysis
Testing and Program Analysis
1 kind
bugs
all kinds
of bugs
in all executions
Deductive
in 1 execution
Test
Test Suite
SVACE
1. Static analysis
2. Quickly finds potential bugs
3. No any guarantee
R
...
Model Checking
R2
R1
R0
[Clarke/Emerson, Sifakis 1981]
●
Iterative fixpoint post computation
Software Model Checking
entry point
error location
●
Reachability problem
Error Location?
int f(int y)
{
struct urb *x;
x = usb_alloc_urb(0,GFP_KERNEL);
...
usb_free_urb(x);
return y;
}
Error Location?
int f(int y)
{
struct urb *x;
x = usb_alloc_urb(0,GFP_KERNEL); // allocate new URB
...
usb_free_urb(x); // deallocate URB: assert(x is NULL or previously allocated URB)
return y;
}
…
// after module exit: assert( all allocated URBs are deallocated)
Instrumentation
int f(int y)
{
struct urb *x;
x = usb_alloc_urb(0,GFP_KERNEL);
...
usb_free_urb(x);
return y;
}
set URBS = empty;
int f(int y)
{
struct urb *x;
x = usb_alloc_urb();
add(URBS, urb);
...
assert(contains(URBS, x));
usb_free_urb(x);
remove(URBS, urb);
return y;
}
…
// after module exit
assert(is_empty(URBS));
Software Model Checking
entry point
error location
●
Reachability problem
Bounded Model Checking
●
finite unfolding of transition relation
b1
a2
a2
b2 b2 b2 b2
b1
a2
a2
b2 b2 b2 b2
r
Counter-Example Guided
Abstraction Refinement
●
Detailed model of a program is huge
●
Detailed model of a program is not needed to
check a particular property
●
Detailed model of a concrete path in a program
is suitable for analysis
=>
●
Build a model that is just enough to check the
particular property
SV-COMP-2013 Competition Results
DriversDrivers
BitBit
operationsoperations
PointersPointers
CEGARCEGAR BMCBMC
Shape-Shape-
analysisanalysis
SVCOMP'14 Results
SVCOMP'15 Results
BLAST
CPAchecker
15 tools in 2014
22 tools in 2015
35 tools in 2016
Industry Applications
Linux Verification Center
founded in 2005
●
OLVER Program
●
Linux Standard Base Infrastructure Program
●
Linux Driver Verification Program
●
Linux File System Verification Program
●
Linux Deductive Verification Program
Linux Driver Verification
http://linuxtesting.org/ldv
Bugs Found
http://linuxtesting.org/results/ldv
>230 patches already applied
SVACE vs. LDV
SVACE LDV-CPAchecker
Time of analysis 2 hrs
111 hrs
(4.5 days)
Warnings 35 328
True bugs 8 103
True positive rate 23% 31%
●
Target code:
●
Linux kernel 3.17-rc1, allmodconfig, x86-64
●
3 223 modules, 33 373 source files
●
Target bugs:
●
double free, memory leaks
There is no a single common bugs!
Testing and Program Analysis
1 kind
bugs
all kinds
of bugs
in all executions
Deductive
in 1 execution
Test
Test Suite
SVACE LDV
1. Investigates all possible paths
2. Is able to prove absence of bugs
of particular kind
3. Domain-specific (framework) adaptation
(environment model, library model)
4. Applicability limited to medium-sized
components (up to 50 KLoC)
5. Requires nonzero hardware resources
- time: 15 minutes per rule per module
- memory: 15 Gb
Testing
Static
Analysis
Software Model
Checking
Deductive
Verification
Kind of bugs almost all
safety
only
safety
only
almost all
Executions
under analysis
small big almost all almost all
Development
cost
linear 0 to small medium huge
Execution
cost
hw small
(target hw)
hw small hw big hw small
Result analysis
cost
small
medium
(false alarms)
medium
(false alarms)
big
Maintenance
cost
small to big small small huge
Testing and Program Analysis
Conclusions
●
There is no silver bullet
●
The key is in a competent combination of
available techniques
Conclusions (2)
●
Two advanced program analysis techniques:
●
Deductive verification
●
+ proof of complete correctness under some
assumptions
●
– significant manual efforts
●
– highly skilled team required
●
=> only for really important code
●
Software model checking
●
+ investigates almost all possible paths
●
+ complimentary to static analysis
●
– per framework/domian adaptation required
●
– limited to medium-sized components (up to 50 KLoC)
Institute for System Programming of the Russian Academy of Sciences
Thank you!
Alexey Khoroshilov
khoroshilov@ispras.ru
http://linuxtesting.org/
Morris Kline. “Mathematics: The Loss of Certainty” Oxford Press, 1980

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Operating System - Monitors (Presentation)
Operating System - Monitors (Presentation)Operating System - Monitors (Presentation)
Operating System - Monitors (Presentation)
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Mca ii os u-2 process management & communication
Mca  ii  os u-2 process management & communicationMca  ii  os u-2 process management & communication
Mca ii os u-2 process management & communication
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
 
Control statements
Control statementsControl statements
Control statements
 
Exception handling
Exception handlingException handling
Exception handling
 
6 Synchronisation
6 Synchronisation6 Synchronisation
6 Synchronisation
 
Cs problem [repaired]
Cs problem [repaired]Cs problem [repaired]
Cs problem [repaired]
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Современные технологии и инструменты анализа вредоносного ПО_PHDays_2017_Pisk...
Современные технологии и инструменты анализа вредоносного ПО_PHDays_2017_Pisk...Современные технологии и инструменты анализа вредоносного ПО_PHDays_2017_Pisk...
Современные технологии и инструменты анализа вредоносного ПО_PHDays_2017_Pisk...
 
Appsec obfuscator reloaded
Appsec obfuscator reloadedAppsec obfuscator reloaded
Appsec obfuscator reloaded
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
VHDL Behavioral Description
VHDL Behavioral DescriptionVHDL Behavioral Description
VHDL Behavioral Description
 
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
 
Operating system 26 monitors
Operating system 26 monitorsOperating system 26 monitors
Operating system 26 monitors
 
Ch6
Ch6Ch6
Ch6
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
Os module 2 c
Os module 2 cOs module 2 c
Os module 2 c
 
Operating System-Ch6 process synchronization
Operating System-Ch6 process synchronizationOperating System-Ch6 process synchronization
Operating System-Ch6 process synchronization
 

Destacado

Destacado (20)

EXTENT-2016: Testing the Architecture
EXTENT-2016: Testing the ArchitectureEXTENT-2016: Testing the Architecture
EXTENT-2016: Testing the Architecture
 
EXTENT-2015: Millennium Surveillance™ – Achieving Excellence
EXTENT-2015: Millennium Surveillance™ –  Achieving ExcellenceEXTENT-2015: Millennium Surveillance™ –  Achieving Excellence
EXTENT-2015: Millennium Surveillance™ – Achieving Excellence
 
EXTENT-2015: Big Button 2.0
EXTENT-2015: Big Button 2.0EXTENT-2015: Big Button 2.0
EXTENT-2015: Big Button 2.0
 
EXTENT-2015: Hyper-Fast Trading
EXTENT-2015: Hyper-Fast TradingEXTENT-2015: Hyper-Fast Trading
EXTENT-2015: Hyper-Fast Trading
 
EXTENT-2015: LSEG Technology Overview
EXTENT-2015: LSEG Technology Overview EXTENT-2015: LSEG Technology Overview
EXTENT-2015: LSEG Technology Overview
 
EXTENT-2015: Blockchain New Frontiers
EXTENT-2015: Blockchain New FrontiersEXTENT-2015: Blockchain New Frontiers
EXTENT-2015: Blockchain New Frontiers
 
EXTENT-2015: Reconciliation Testing Aspects
EXTENT-2015: Reconciliation Testing AspectsEXTENT-2015: Reconciliation Testing Aspects
EXTENT-2015: Reconciliation Testing Aspects
 
EXTENT-2015 Tradecope Presentation
EXTENT-2015 Tradecope PresentationEXTENT-2015 Tradecope Presentation
EXTENT-2015 Tradecope Presentation
 
EXTENT-2015: UnaVista Technology 
EXTENT-2015: UnaVista Technology EXTENT-2015: UnaVista Technology 
EXTENT-2015: UnaVista Technology 
 
EXTENT-2016: Trading Technology Trends and Innovation
EXTENT-2016: Trading Technology Trends and InnovationEXTENT-2016: Trading Technology Trends and Innovation
EXTENT-2016: Trading Technology Trends and Innovation
 
EXTENT-2015: A Test Harness for Algo Trading Systems
EXTENT-2015: A Test Harness for Algo Trading Systems EXTENT-2015: A Test Harness for Algo Trading Systems
EXTENT-2015: A Test Harness for Algo Trading Systems
 
EXTENT-2016: Test Automation and Agile Testing
EXTENT-2016: Test Automation and Agile TestingEXTENT-2016: Test Automation and Agile Testing
EXTENT-2016: Test Automation and Agile Testing
 
EXTENT-2016: Opening Keynote
EXTENT-2016: Opening Keynote  EXTENT-2016: Opening Keynote
EXTENT-2016: Opening Keynote
 
EXTENT-2016: Technology Trends in Capital Markets
EXTENT-2016: Technology Trends in Capital MarketsEXTENT-2016: Technology Trends in Capital Markets
EXTENT-2016: Technology Trends in Capital Markets
 
EXTENT-2015: The Four Essential Elements of LSEG QA Solutions
EXTENT-2015: The Four Essential Elements of  LSEG QA SolutionsEXTENT-2015: The Four Essential Elements of  LSEG QA Solutions
EXTENT-2015: The Four Essential Elements of LSEG QA Solutions
 
EXTENT-2016: Key Challenges and Lessons Learned from Testing a New Trading Sy...
EXTENT-2016: Key Challenges and Lessons Learned from Testing a New Trading Sy...EXTENT-2016: Key Challenges and Lessons Learned from Testing a New Trading Sy...
EXTENT-2016: Key Challenges and Lessons Learned from Testing a New Trading Sy...
 
EXTENT-2016: MOEX Risk Management Real-Time Technology
EXTENT-2016: MOEX Risk Management Real-Time TechnologyEXTENT-2016: MOEX Risk Management Real-Time Technology
EXTENT-2016: MOEX Risk Management Real-Time Technology
 
EXTENT-2015: Prognoz Market Surveillance
EXTENT-2015: Prognoz  Market SurveillanceEXTENT-2015: Prognoz  Market Surveillance
EXTENT-2015: Prognoz Market Surveillance
 
EXTENT-2015: Quality Assurance in Russian NSD
EXTENT-2015: Quality Assurance in Russian NSDEXTENT-2015: Quality Assurance in Russian NSD
EXTENT-2015: Quality Assurance in Russian NSD
 
EXTENT-2016: Realisation of a Collaborative Approach to Test Automation
EXTENT-2016: Realisation of a Collaborative Approach to Test AutomationEXTENT-2016: Realisation of a Collaborative Approach to Test Automation
EXTENT-2016: Realisation of a Collaborative Approach to Test Automation
 

Similar a EXTENT-2016: Industry Practices of Advanced Program Analysis

기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
NAVER Engineering
 
"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
 

Similar a EXTENT-2016: Industry Practices of Advanced Program Analysis (20)

Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)
 
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
 
om ppt java.pptx
om ppt java.pptxom ppt java.pptx
om ppt java.pptx
 
"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,...
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)
 
Protocol T50: Five months later... So what?
Protocol T50: Five months later... So what?Protocol T50: Five months later... So what?
Protocol T50: Five months later... So what?
 
Fuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation TestingFuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation Testing
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and Classes
 
Software Testing:
 A Research Travelogue 
(2000–2014)
Software Testing:
 A Research Travelogue 
(2000–2014)Software Testing:
 A Research Travelogue 
(2000–2014)
Software Testing:
 A Research Travelogue 
(2000–2014)
 
Correctness attraction __kth_2017
Correctness attraction __kth_2017Correctness attraction __kth_2017
Correctness attraction __kth_2017
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709
 
Static Analysis and Verification of C Programs
Static Analysis and Verification of C ProgramsStatic Analysis and Verification of C Programs
Static Analysis and Verification of C Programs
 
Unit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaUnit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran Janardhana
 
TestowanieIoT2016
TestowanieIoT2016TestowanieIoT2016
TestowanieIoT2016
 
ICSRS_R038.pptx
ICSRS_R038.pptxICSRS_R038.pptx
ICSRS_R038.pptx
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 
Ase02.ppt
Ase02.pptAse02.ppt
Ase02.ppt
 
Metamorphic Security Testing for Web Systems
Metamorphic Security Testing for Web SystemsMetamorphic Security Testing for Web Systems
Metamorphic Security Testing for Web Systems
 
PVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications developmentPVS-Studio, a solution for resource intensive applications development
PVS-Studio, a solution for resource intensive applications development
 
Ruslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testingRuslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testing
 

Más de Iosif Itkin

Más de Iosif Itkin (20)

Foundations of Software Testing Lecture 4
Foundations of Software Testing Lecture 4Foundations of Software Testing Lecture 4
Foundations of Software Testing Lecture 4
 
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
 
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test OraclesExactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test Oracles
 
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
Exactpro FinTech Webinar - Global Exchanges FIX ProtocolExactpro FinTech Webinar - Global Exchanges FIX Protocol
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
 
Operational Resilience in Financial Market Infrastructures
Operational Resilience in Financial Market InfrastructuresOperational Resilience in Financial Market Infrastructures
Operational Resilience in Financial Market Infrastructures
 
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
 
Testing the Intelligence of your AI
Testing the Intelligence of your AITesting the Intelligence of your AI
Testing the Intelligence of your AI
 
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
EXTENT 2019: Exactpro Quality Assurance for Financial Market InfrastructuresEXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
 
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
 
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan ShamraiEXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
 
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference OpenEXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
 
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
 
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
 
QA Community Saratov: Past, Present, Future (2019-02-08)
QA Community Saratov: Past, Present, Future (2019-02-08)QA Community Saratov: Past, Present, Future (2019-02-08)
QA Community Saratov: Past, Present, Future (2019-02-08)
 
Machine Learning and RoboCop Testing
Machine Learning and RoboCop TestingMachine Learning and RoboCop Testing
Machine Learning and RoboCop Testing
 
Behaviour Driven Development: Oltre i limiti del possibile
Behaviour Driven Development: Oltre i limiti del possibileBehaviour Driven Development: Oltre i limiti del possibile
Behaviour Driven Development: Oltre i limiti del possibile
 
2018 - Exactpro Year in Review
2018 - Exactpro Year in Review2018 - Exactpro Year in Review
2018 - Exactpro Year in Review
 
Exactpro Discussion about Joy and Strategy
Exactpro Discussion about Joy and StrategyExactpro Discussion about Joy and Strategy
Exactpro Discussion about Joy and Strategy
 
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
FIX EMEA Conference 2018 - Post Trade Software Testing ChallengesFIX EMEA Conference 2018 - Post Trade Software Testing Challenges
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
 
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

EXTENT-2016: Industry Practices of Advanced Program Analysis

  • 1. Institute for System Programming of the Russian Academy of Sciences Industry practices of advanced program analysis Alexey Khoroshilov khoroshilov@ispras.ru ExTENT-2016 London, 22 June 2016
  • 2. The Goal of Verification to make sure there is no any bugs in any possible execution of the target software ● with minimal cost Verification Fresh Software Verified Software
  • 3. The Goal of Verification to achieve maximal assurance that there is no any bugs in any possible execution of the target software ● within reasonable cost Verification Fresh Software Verified Software
  • 4. Testing Test Test Suite 1 kind of bugs all kinds of bugs in all executionsin 1 execution
  • 5. Inductive Reasoning ● Conclusions are supported by its premises ● If premises are true, it would be unlikely impossible for the conclusions to be false ● Example: ● Every time I’ve walked by that dog, he hasn’t tried to bite me. ● So, the next time I walk by that dog he won’t try to bite me.
  • 6. Inductive Reasoning ● Conclusions are supported by its premises ● If premises are true, it would be unlikely impossible for the conclusions to be false ● Example: ● The component behaves correctly on all test data. ● So, the component always behaves correctly.
  • 7. Inductive Reasoning on Program Correctness ● The component behaves correctly on all test data ● Tests are quite representative => ● The component always behaves correctly
  • 8. Deductive Reasoning ● Conclusions certainly follow from its premises ● If premises are true, it is impossible for the conclusions to be false ● Example: ● All men are mortal. ● Socrates is a man. ● Therefore, Socrates is mortal.
  • 9. Deductive Reasoning on Program Correctness Target Component Requirements Review
  • 10. Deductive Reasoning on Program Correctness Target Component Requirements
  • 11. Deductive Reasoning on Program Correctness ● If assumptions are held ● regarding compiler&linker ● regarding environment behaviour ● regarding input data ● The component always behaves correctly
  • 12. Deductive Reasoning on Program Correctness ● If assumptions are held ● regarding compiler&linker ● regarding environment behaviour ● regarding input data ● The component always behaves correctly (i.e. terminates and its output satisfies to postcondition)
  • 13. Deductive Verification Historical Perspective 1947 1970 ● Lecture of Alan Turing to London Mathematical Society ● Methods of Floyd/Hoare
  • 14. START: ( y1 , y2 )  ( 0, x1 ) y2  x2 FT ( y1 , y2 )  ( y1 +1, y2 - x2 ) HALT: ( z1 , z2 )  ( y1 , y2 ) A: Precondition (x1  0)  (x2  0) С: Postcondition (x1 = z1 x2 + z2 )  (0  z2 < x2 ) B: Invariant (x1 = y1 x2 + y2 ) ∧ (y2  0) Deductive Verification Prove program correctness by induction: Let precondition to be held in A we pass A->B => Invariant is held in B Let invariant to be held in B we pass B-T->B => Invariant is held in B Let invariant to be held in B we pass B-F->C => Postcondition is held in С Let precondition to be held in A we pass A->C => Postcondition is held in С =>
  • 15. Deductive Verification Historical Perspective 1947 1970 2000 ● Lecture of Alan Turing to London Mathematical Society ● Methods of Floyd/Hoare ● Deductive verifcation tools for Ada, C, Java, С# ● SunRise, ESC/Java, Frama-C, LOOP, Boogie/VCC
  • 16.
  • 17.
  • 18. Deductive Verification Historical Perspective 1947 1970 2000 2010 ● Lecture of Alan Turing to London Mathematical Society ● Methods of Floyd/Hoare ● Deductive verifcation tools for Ada, C, Java, С# ● SunRise, ESC/Java, Frama-C, LOOP, Boogie/VCC ● Application in real-life projects for small-size components ● Nuclear power (UK, France) ● Avionics (Airbus, NASA, UK Air Traffic Control) ● Components of operating systems (seL4, Verisoft, Verisoft-XT)
  • 19. Industry Applications ● UK Air Traffic Management System ● 250 KLOC of logical lines of code (in Ada) ● proof type safety, few functional correctness code ● 153K VCs, of which 98.76% are proven automatically (*) Angela Wallenburg “Safe and Secure Programming Using Spark”
  • 20. Years Tools Target code Scope Size Verisoft 2004-2008 Isabelle designed for verification hw/kernel/ compiler/ libraries/apps 10 kLOC (kernel) L4.verified seL4 2004-2009 Isabelle designed for verification, performance oriented microkernel security model (no MMU) 7.5 kLOC (without asm and boot) Verisoft-XT small-hv 2007-2013 VCC designed for verification separation property only 2.5 kLOC Verisoft-XT Hyper-V 2007-2013 VCC industrial separation property only 100 kLOC Verisoft-XT PikeOS 2007-2013 VCC industrial, simplicity for performance some system calls 10 KLOC OS Deductive Verification
  • 21. Linux Verification Center founded in 2005 ● OLVER Program ● Linux Standard Base Infrastructure Program ● Linux Driver Verification Program ● Linux File System Verification Program ● Linux Deductive Verification Program
  • 22. Toolset for Event-B models verification Model of security requirements Formalized security model Formalized low-level security model Manual Automated verification Security requirements Security model AstraVer Toolchain (*) for deductive verification of C programs (based on Frama-C – Jessie – Why3) Pre-/post-conditions of LSM operations Security arcitecture LSM source code Model of security requirements Mathematical notation LSM Implementation implements Specificatiion of library functions Linux kernel AstraVer Project AstraLinux(*) The research on deductive verification tools development was carried out with funding from the Ministry of Education and Science of Russia (the project unique identifier is RFMEFI60414X0051
  • 23. Deductive Verification Status ● Reasonable Tool Support ● Ada, C, C#, Java ● Functional specification as comments, even natively supported in Ada-2012 ● Dedicated languages: Boogie, Why3 ● Manual efforts still significant ● up to 10x of development efforts ● highly skilled team required
  • 24. Testing and Deductive Verification 1 kind bugs all kinds of bugs in all executions Deductive 1. Proof of complete correctness under some assumptions 2. Very labour intensive and time consuming in 1 execution Test Test Suite
  • 25. Testing Deductive Verification Kind of bugs almost all almost all Executions under analysis small almost all Development cost linear huge Execution cost hw small (target hw) hw small Result analysis cost small big Maintenance cost small to big huge Testing and Deductive Verification
  • 26. Deductive Verification Status (2) ● reasonable to apply only for really important code
  • 27. Static Analysis ● is a commodity ● mature market of static analysis tools
  • 28. SVACE by ISPRAS ● Static analysis of C/C++/Java code, Linux/Windows ● 150+ kinds of defects ● Buffer overflows, NULL-pointer dereferences ● Memory management, tainted input ● Concurrency issues ● Lightweight analysis of semantic patterns ● Eclipse plugin or WebUI
  • 29. Testing Static Analysis Deductive Verification Kind of bugs almost all safety only almost all Executions under analysis small almost all almost all Development cost linear 0 to small huge Execution cost hw small (target hw) hw small hw small Result analysis cost small medium (false alarms) big Maintenance cost small to big small huge Testing and Program Analysis
  • 30. Testing Static Analysis Deductive Verification Kind of bugs almost all safety only almost all Executions under analysis small big almost all almost all Development cost linear 0 to small huge Execution cost hw small (target hw) hw small hw small Result analysis cost small medium (false alarms) big Maintenance cost small to big small huge Testing and Program Analysis
  • 31. Testing and Program Analysis 1 kind bugs all kinds of bugs in all executions Deductive in 1 execution Test Test Suite SVACE 1. Static analysis 2. Quickly finds potential bugs 3. No any guarantee
  • 32. R ... Model Checking R2 R1 R0 [Clarke/Emerson, Sifakis 1981] ● Iterative fixpoint post computation
  • 33. Software Model Checking entry point error location ● Reachability problem
  • 34. Error Location? int f(int y) { struct urb *x; x = usb_alloc_urb(0,GFP_KERNEL); ... usb_free_urb(x); return y; }
  • 35. Error Location? int f(int y) { struct urb *x; x = usb_alloc_urb(0,GFP_KERNEL); // allocate new URB ... usb_free_urb(x); // deallocate URB: assert(x is NULL or previously allocated URB) return y; } … // after module exit: assert( all allocated URBs are deallocated)
  • 36. Instrumentation int f(int y) { struct urb *x; x = usb_alloc_urb(0,GFP_KERNEL); ... usb_free_urb(x); return y; } set URBS = empty; int f(int y) { struct urb *x; x = usb_alloc_urb(); add(URBS, urb); ... assert(contains(URBS, x)); usb_free_urb(x); remove(URBS, urb); return y; } … // after module exit assert(is_empty(URBS));
  • 37. Software Model Checking entry point error location ● Reachability problem
  • 38. Bounded Model Checking ● finite unfolding of transition relation b1 a2 a2 b2 b2 b2 b2 b1 a2 a2 b2 b2 b2 b2 r
  • 39. Counter-Example Guided Abstraction Refinement ● Detailed model of a program is huge ● Detailed model of a program is not needed to check a particular property ● Detailed model of a concrete path in a program is suitable for analysis => ● Build a model that is just enough to check the particular property
  • 42. SVCOMP'15 Results BLAST CPAchecker 15 tools in 2014 22 tools in 2015 35 tools in 2016
  • 44. Linux Verification Center founded in 2005 ● OLVER Program ● Linux Standard Base Infrastructure Program ● Linux Driver Verification Program ● Linux File System Verification Program ● Linux Deductive Verification Program
  • 47. SVACE vs. LDV SVACE LDV-CPAchecker Time of analysis 2 hrs 111 hrs (4.5 days) Warnings 35 328 True bugs 8 103 True positive rate 23% 31% ● Target code: ● Linux kernel 3.17-rc1, allmodconfig, x86-64 ● 3 223 modules, 33 373 source files ● Target bugs: ● double free, memory leaks There is no a single common bugs!
  • 48. Testing and Program Analysis 1 kind bugs all kinds of bugs in all executions Deductive in 1 execution Test Test Suite SVACE LDV 1. Investigates all possible paths 2. Is able to prove absence of bugs of particular kind 3. Domain-specific (framework) adaptation (environment model, library model) 4. Applicability limited to medium-sized components (up to 50 KLoC) 5. Requires nonzero hardware resources - time: 15 minutes per rule per module - memory: 15 Gb
  • 49. Testing Static Analysis Software Model Checking Deductive Verification Kind of bugs almost all safety only safety only almost all Executions under analysis small big almost all almost all Development cost linear 0 to small medium huge Execution cost hw small (target hw) hw small hw big hw small Result analysis cost small medium (false alarms) medium (false alarms) big Maintenance cost small to big small small huge Testing and Program Analysis
  • 50. Conclusions ● There is no silver bullet ● The key is in a competent combination of available techniques
  • 51. Conclusions (2) ● Two advanced program analysis techniques: ● Deductive verification ● + proof of complete correctness under some assumptions ● – significant manual efforts ● – highly skilled team required ● => only for really important code ● Software model checking ● + investigates almost all possible paths ● + complimentary to static analysis ● – per framework/domian adaptation required ● – limited to medium-sized components (up to 50 KLoC)
  • 52. Institute for System Programming of the Russian Academy of Sciences Thank you! Alexey Khoroshilov khoroshilov@ispras.ru http://linuxtesting.org/ Morris Kline. “Mathematics: The Loss of Certainty” Oxford Press, 1980