SlideShare a Scribd company logo
1 of 14
Static Analysis Primer
What It Is
“A family of techniques of program analysis where
the program is not actually executed but is analyzed
by tools to produce useful information.
Techniques range from the most mundane
(statistics on the density of comments, for instance)
to the more complex, semantics-based techniques.
Qualities sought in static analysis techniques are
soundness and completeness.”
2
Source: Webster’s Dictionary
Why You Should Use It
1. It Saves Time and Money
Static Analysis: Why You Should Use It
The later software defects are addressed in the product
lifecycle, the more expensive they are to fix.
SoftwareDevelopmentStage
Post Release
Beta Testing
Integration and System Testing
Code and Unit Testing
Requirements and Design
30X
15X
10X
5X
1X
Graph data source: The Economic Impacts of Inadequate Infrastructure for Software Testing,
National Institute of Standards and Technology (NIST), 2002
Cost to Fix
Static analysis finds
problems here
It can cost 30x more
to find and fix defects
post-release vs. in the
Requirements & Design
phase of development.
Why You Should Use It
2. It works while you sleep
Resource Leaks
• Memory leaks
• Resource leak in object
• Incomplete delete
• Microsoft COM BSTR memory leak
Uninitialized variables
• Missing return statement
• Uninitialized pointer/scalar/array read/write
• Uninitialized data member in class or
structure
Concurrency Issues
• Deadlocks
• Race conditions
• Blocking call misuse
Integer handling issues
• Improper use of negative value
• Unintended sign extension
• Incompatible cast
Improper Use of APIs
• Insecure chroot
• Using invalid iterator
• printf() argument mismatch
Memory Corruptions
• Out-of-bounds access
• String length miscalculations
• Copying to destination buffers too small
• Overflowed pointer write
• Negative array index write
• Allocation size error
Memory-illegal access
• Incorrect delete operator
• Overflowed pointer read
• Out-of-bounds read
• Returning pointer to local variable
• Negative array index read
• Use/read pointer after free
Control flow issues
• Logically dead code
• Missing break in switch
• Structurally dead code
Error handling issues
• Unchecked return value
• Uncaught exception
• Invalid use of negative variables
What It Can Find
Program hangs
• Infinite loop
• Double lock or missing unlock
• Negative loop bound
• Thread deadlock
• sleep() while holding a lock
Null pointer differences
• Dereference after a null check
• Dereference a null return value
• Dereference before a null check
Code maintainability issues
• Multiple return statements
• Unused pointer value
Incorrect expressions
• Evaluation order violation
• Copy and paste error
Insecure data handling
• Integer overflow
• Loop bound by untrusted source
• Write/read array/pointer with
untrusted value
• Format string with untrusted source
Performance inefficiencies
• Big parameter passed by value
• Large stack use
Security best practices violations
• Possible buffer overflow
• Copy into a fixed size buffer
• Calling risky function
• Use of insecure temporary file
• Time of check different than time of use
• User pointer dereference
What It Can Find
How It Works
• Three steps…
AnalyzeBuild
Present &
Manage
• Captures information about how
your code is compiled.
• Creates a virtual build that wraps
around your standard build
process and captures how it
invokes your compiler(s).
• Captures all source files, incl.
parameters about how the
source is compiled
• Macro definitions, meaning of
command line options, etc.
• Provides a high-fidelity
recording of your code and how
it’s assembled.
How It Works
Build
• Analyzes every path through
your code via “checkers” which
look for actual defects vs. style
violations.
• Patterns of code execution that
cause crashes, memory
corruption, memory and handle
leaks, etc.
• Eliminates false positives.
• Industry accepted standard for a
“good” false positive rate is less
than 20%
How It Works
Analyze
• Clearly presents results
including actionable
information, enabling defects
to be quickly and efficiently
found AND fixed.
How It Works
Present &
Manage
How It Fits Into the SDLC
12
• Security Audits
• Product Release
Management
QA
Nightly/Continuous
Build
• Desktop Analysis
• Review defects
• Prioritize actions
• Make fixes
• Track progress
Code Check In
Static Analysis
Results
• Functional Testing
• Performance Testing
• Stress Testing
• Integration Testing
Development
Product
Release &
Management
Static Analysis
Results
For illustration only…other workflow integrations are possible.
13
Code
Build
Test
Nightly Build
Continuous
Integration
High-Fidelity
Code
Compilation
High-
Performance
Analysis
Low False
Positive Rate
Detecting
Critical
Defects
Easy Defect
Navigation and
Comprehension
Comprehensive
Triage and
Remediation
Management
Visibility and
Governance
Team
Collaboration
What To Look For…
Copyright 2013 Coverity, Inc.

More Related Content

What's hot

East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...Gerke Max Preussner
 
Yazılım Test Yaşam Döngüsü ve Proje Başarısına Etkisi
Yazılım Test Yaşam Döngüsü ve Proje Başarısına EtkisiYazılım Test Yaşam Döngüsü ve Proje Başarısına Etkisi
Yazılım Test Yaşam Döngüsü ve Proje Başarısına EtkisiAynur Özkan
 
Unreal Engine 4 Introduction
Unreal Engine 4 IntroductionUnreal Engine 4 Introduction
Unreal Engine 4 IntroductionSperasoft
 
Windows Privilege Escalation
Windows Privilege EscalationWindows Privilege Escalation
Windows Privilege EscalationRiyaz Walikar
 
EMBA - Firmware analysis - Black Hat Arsenal USA 2022
EMBA - Firmware analysis - Black Hat Arsenal USA 2022EMBA - Firmware analysis - Black Hat Arsenal USA 2022
EMBA - Firmware analysis - Black Hat Arsenal USA 2022MichaelM85042
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionMichael Jesse
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesSam Bowne
 
Continuous deployment-at-flipkart
Continuous deployment-at-flipkartContinuous deployment-at-flipkart
Continuous deployment-at-flipkartPankaj Kaushal
 
Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Sam Bowne
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingDimitri Ponomareff
 
DevOps & Security: Here & Now
DevOps & Security: Here & NowDevOps & Security: Here & Now
DevOps & Security: Here & NowCheckmarx
 
Continuous Testing Landscape.pptx
Continuous Testing Landscape.pptxContinuous Testing Landscape.pptx
Continuous Testing Landscape.pptxMarc Hornbeek
 
Unreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIUnreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIEpic Games China
 
Hair animation by vertex shader
Hair animation by vertex shaderHair animation by vertex shader
Hair animation by vertex shader동석 김
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentBlack Duck by Synopsys
 
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイドUnite2017Tokyo
 
Static Analysis with Sonarlint
Static Analysis with SonarlintStatic Analysis with Sonarlint
Static Analysis with SonarlintUT, San Antonio
 

What's hot (20)

Code review
Code reviewCode review
Code review
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
 
Yazılım Test Yaşam Döngüsü ve Proje Başarısına Etkisi
Yazılım Test Yaşam Döngüsü ve Proje Başarısına EtkisiYazılım Test Yaşam Döngüsü ve Proje Başarısına Etkisi
Yazılım Test Yaşam Döngüsü ve Proje Başarısına Etkisi
 
Unreal Engine 4 Introduction
Unreal Engine 4 IntroductionUnreal Engine 4 Introduction
Unreal Engine 4 Introduction
 
Windows Privilege Escalation
Windows Privilege EscalationWindows Privilege Escalation
Windows Privilege Escalation
 
EMBA - Firmware analysis - Black Hat Arsenal USA 2022
EMBA - Firmware analysis - Black Hat Arsenal USA 2022EMBA - Firmware analysis - Black Hat Arsenal USA 2022
EMBA - Firmware analysis - Black Hat Arsenal USA 2022
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code Inspection
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
 
SonarQube
SonarQubeSonarQube
SonarQube
 
Continuous deployment-at-flipkart
Continuous deployment-at-flipkartContinuous deployment-at-flipkart
Continuous deployment-at-flipkart
 
Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
SSRF workshop
SSRF workshop SSRF workshop
SSRF workshop
 
DevOps & Security: Here & Now
DevOps & Security: Here & NowDevOps & Security: Here & Now
DevOps & Security: Here & Now
 
Continuous Testing Landscape.pptx
Continuous Testing Landscape.pptxContinuous Testing Landscape.pptx
Continuous Testing Landscape.pptx
 
Unreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIUnreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UI
 
Hair animation by vertex shader
Hair animation by vertex shaderHair animation by vertex shader
Hair animation by vertex shader
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps Environment
 
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
 
Static Analysis with Sonarlint
Static Analysis with SonarlintStatic Analysis with Sonarlint
Static Analysis with Sonarlint
 

Viewers also liked

Concurrency Errors in Java
Concurrency Errors in JavaConcurrency Errors in Java
Concurrency Errors in JavaCoverity
 
Finding Defects in C#: Coverity vs. FxCop
Finding Defects in C#: Coverity vs. FxCopFinding Defects in C#: Coverity vs. FxCop
Finding Defects in C#: Coverity vs. FxCopCoverity
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwuiRouyun Pan
 
Android图形系统简介
Android图形系统简介Android图形系统简介
Android图形系统简介zhucai1234
 
Soa test methodology
Soa test methodologySoa test methodology
Soa test methodologyInfosys
 
Static Analysis of Your OSS Project with Coverity
Static Analysis of Your OSS Project with CoverityStatic Analysis of Your OSS Project with Coverity
Static Analysis of Your OSS Project with CoveritySamsung Open Source Group
 
Static Analysis of Computer programs
Static Analysis of Computer programs Static Analysis of Computer programs
Static Analysis of Computer programs Arvind Devaraj
 
Static program analysis tools
Static program analysis toolsStatic program analysis tools
Static program analysis toolsKamil Jezek
 
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris Recht
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris RechtThe Landbank's Role in Driving Redevelopment, UC DAAP by Chris Recht
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris RechtThe Port
 
SAP_Business_Object_Professional
SAP_Business_Object_ProfessionalSAP_Business_Object_Professional
SAP_Business_Object_ProfessionalKapil Verma
 
PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012Arun Gupta
 
Global leader in real-time clearing
Global leader in real-time clearingGlobal leader in real-time clearing
Global leader in real-time clearingCinnober
 
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programmingTOPS Technologies
 
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...CODE BLUE
 
Developing With JAAS
Developing With JAASDeveloping With JAAS
Developing With JAASrahmed_sct
 
Survey and Analysis of ICS Vulnerabilities (Japanese)
Survey and Analysis of ICS Vulnerabilities (Japanese)Survey and Analysis of ICS Vulnerabilities (Japanese)
Survey and Analysis of ICS Vulnerabilities (Japanese)Digital Bond
 
03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays03 stacks and_queues_using_arrays
03 stacks and_queues_using_arraystameemyousaf
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReportsGuo Albert
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 

Viewers also liked (20)

Concurrency Errors in Java
Concurrency Errors in JavaConcurrency Errors in Java
Concurrency Errors in Java
 
Finding Defects in C#: Coverity vs. FxCop
Finding Defects in C#: Coverity vs. FxCopFinding Defects in C#: Coverity vs. FxCop
Finding Defects in C#: Coverity vs. FxCop
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwui
 
Android图形系统简介
Android图形系统简介Android图形系统简介
Android图形系统简介
 
Soa test methodology
Soa test methodologySoa test methodology
Soa test methodology
 
Static Analysis of Your OSS Project with Coverity
Static Analysis of Your OSS Project with CoverityStatic Analysis of Your OSS Project with Coverity
Static Analysis of Your OSS Project with Coverity
 
Static Analysis of Computer programs
Static Analysis of Computer programs Static Analysis of Computer programs
Static Analysis of Computer programs
 
Static program analysis tools
Static program analysis toolsStatic program analysis tools
Static program analysis tools
 
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris Recht
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris RechtThe Landbank's Role in Driving Redevelopment, UC DAAP by Chris Recht
The Landbank's Role in Driving Redevelopment, UC DAAP by Chris Recht
 
SAP_Business_Object_Professional
SAP_Business_Object_ProfessionalSAP_Business_Object_Professional
SAP_Business_Object_Professional
 
Core & advanced java classes in mumbai
Core & advanced java classes in mumbaiCore & advanced java classes in mumbai
Core & advanced java classes in mumbai
 
PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012
 
Global leader in real-time clearing
Global leader in real-time clearingGlobal leader in real-time clearing
Global leader in real-time clearing
 
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programming
 
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
 
Developing With JAAS
Developing With JAASDeveloping With JAAS
Developing With JAAS
 
Survey and Analysis of ICS Vulnerabilities (Japanese)
Survey and Analysis of ICS Vulnerabilities (Japanese)Survey and Analysis of ICS Vulnerabilities (Japanese)
Survey and Analysis of ICS Vulnerabilities (Japanese)
 
03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 

Similar to Static Analysis Primer

Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Denim Group
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapFelipe Prado
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDaveEdwards12
 
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_finalŠumadin Šumić
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Maven Logix
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsTaswar Bhatti
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham.NET Conf UY
 
black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...KrishnaVeni451953
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineeringYuffie Valen
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018Taswar Bhatti
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsAdaCore
 
Quality metrics and angular js applications
Quality metrics and angular js applicationsQuality metrics and angular js applications
Quality metrics and angular js applicationsnadeembtech
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile WorldDavid Lindner
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applicationsAmit Kejriwal
 

Similar to Static Analysis Primer (20)

Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
 
Salesforce static code analysis
Salesforce static code analysisSalesforce static code analysis
Salesforce static code analysis
 
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final
685163main 2 4-a-swat_extendingbenefitsofstaticcodeanalysistools_final
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong Codeaholics
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
Code Reviews
Code ReviewsCode Reviews
Code Reviews
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
 
Quality metrics and angular js applications
Quality metrics and angular js applicationsQuality metrics and angular js applications
Quality metrics and angular js applications
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
 

More from Coverity

Adopting Agile
Adopting AgileAdopting Agile
Adopting AgileCoverity
 
DevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityDevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityCoverity
 
OSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingOSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingCoverity
 
The State of Software Quality
The State of Software QualityThe State of Software Quality
The State of Software QualityCoverity
 
The Impact of a Medical Device Recall
The Impact of a Medical Device RecallThe Impact of a Medical Device Recall
The Impact of a Medical Device RecallCoverity
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# AnalysisCoverity
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in JavaCoverity
 

More from Coverity (7)

Adopting Agile
Adopting AgileAdopting Agile
Adopting Agile
 
DevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityDevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first Security
 
OSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingOSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be Missing
 
The State of Software Quality
The State of Software QualityThe State of Software Quality
The State of Software Quality
 
The Impact of a Medical Device Recall
The Impact of a Medical Device RecallThe Impact of a Medical Device Recall
The Impact of a Medical Device Recall
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# Analysis
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in Java
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Static Analysis Primer

  • 2. What It Is “A family of techniques of program analysis where the program is not actually executed but is analyzed by tools to produce useful information. Techniques range from the most mundane (statistics on the density of comments, for instance) to the more complex, semantics-based techniques. Qualities sought in static analysis techniques are soundness and completeness.” 2 Source: Webster’s Dictionary
  • 3. Why You Should Use It 1. It Saves Time and Money
  • 4. Static Analysis: Why You Should Use It The later software defects are addressed in the product lifecycle, the more expensive they are to fix. SoftwareDevelopmentStage Post Release Beta Testing Integration and System Testing Code and Unit Testing Requirements and Design 30X 15X 10X 5X 1X Graph data source: The Economic Impacts of Inadequate Infrastructure for Software Testing, National Institute of Standards and Technology (NIST), 2002 Cost to Fix Static analysis finds problems here It can cost 30x more to find and fix defects post-release vs. in the Requirements & Design phase of development.
  • 5. Why You Should Use It 2. It works while you sleep
  • 6. Resource Leaks • Memory leaks • Resource leak in object • Incomplete delete • Microsoft COM BSTR memory leak Uninitialized variables • Missing return statement • Uninitialized pointer/scalar/array read/write • Uninitialized data member in class or structure Concurrency Issues • Deadlocks • Race conditions • Blocking call misuse Integer handling issues • Improper use of negative value • Unintended sign extension • Incompatible cast Improper Use of APIs • Insecure chroot • Using invalid iterator • printf() argument mismatch Memory Corruptions • Out-of-bounds access • String length miscalculations • Copying to destination buffers too small • Overflowed pointer write • Negative array index write • Allocation size error Memory-illegal access • Incorrect delete operator • Overflowed pointer read • Out-of-bounds read • Returning pointer to local variable • Negative array index read • Use/read pointer after free Control flow issues • Logically dead code • Missing break in switch • Structurally dead code Error handling issues • Unchecked return value • Uncaught exception • Invalid use of negative variables What It Can Find
  • 7. Program hangs • Infinite loop • Double lock or missing unlock • Negative loop bound • Thread deadlock • sleep() while holding a lock Null pointer differences • Dereference after a null check • Dereference a null return value • Dereference before a null check Code maintainability issues • Multiple return statements • Unused pointer value Incorrect expressions • Evaluation order violation • Copy and paste error Insecure data handling • Integer overflow • Loop bound by untrusted source • Write/read array/pointer with untrusted value • Format string with untrusted source Performance inefficiencies • Big parameter passed by value • Large stack use Security best practices violations • Possible buffer overflow • Copy into a fixed size buffer • Calling risky function • Use of insecure temporary file • Time of check different than time of use • User pointer dereference What It Can Find
  • 8. How It Works • Three steps… AnalyzeBuild Present & Manage
  • 9. • Captures information about how your code is compiled. • Creates a virtual build that wraps around your standard build process and captures how it invokes your compiler(s). • Captures all source files, incl. parameters about how the source is compiled • Macro definitions, meaning of command line options, etc. • Provides a high-fidelity recording of your code and how it’s assembled. How It Works Build
  • 10. • Analyzes every path through your code via “checkers” which look for actual defects vs. style violations. • Patterns of code execution that cause crashes, memory corruption, memory and handle leaks, etc. • Eliminates false positives. • Industry accepted standard for a “good” false positive rate is less than 20% How It Works Analyze
  • 11. • Clearly presents results including actionable information, enabling defects to be quickly and efficiently found AND fixed. How It Works Present & Manage
  • 12. How It Fits Into the SDLC 12 • Security Audits • Product Release Management QA Nightly/Continuous Build • Desktop Analysis • Review defects • Prioritize actions • Make fixes • Track progress Code Check In Static Analysis Results • Functional Testing • Performance Testing • Stress Testing • Integration Testing Development Product Release & Management Static Analysis Results For illustration only…other workflow integrations are possible.
  • 13. 13 Code Build Test Nightly Build Continuous Integration High-Fidelity Code Compilation High- Performance Analysis Low False Positive Rate Detecting Critical Defects Easy Defect Navigation and Comprehension Comprehensive Triage and Remediation Management Visibility and Governance Team Collaboration What To Look For…

Editor's Notes

  1. Given the diversity of approaches and goals for static analysis tools, I wanted to better understand how static analysis tools differ.
  2. There are three parts:the Build step captures information about how your code is compiled. We create a virtual build that wraps around your standard build process and transparently captures how it invokes your compiler(s). From this we capture all of the source files as well as the parameters describing how the source is compiled, including things like macro definitions and the meaning of command line options. This results in a high fidelity recording of your code and the way it’s assembled.The analysis is where we analyze every path through your code with a battery of tests, organized by what we call “checkers”. These checkers look for actual defects, not just coding style violations. These are patterns of code execution that can cause crashes, memory corruption, memory and handle leaks, and other kinds problems that are hard errors, not just stylistic rules. Throughout our analysis we have taken great care to try to eliminate false positives, which are error reports that are not true defects. Our false positive rate is the lowest in the industry, typically less than 20% out of the box. This is important because developers will not adopt tools that are mostly a waste of their time.Finally it’s important to present the results clearly because it’s not only about finding defects, it’s about fixing them. The results are stored in a database and presented to give actionable information so developers can fix them efficiently.We’ll focus this talk on the Analysis and Presentation. For more about the Build, click on the Build icon, otherwise we will skip this.
  3. The analysis is where we analyze every path through your code with a battery of tests, organized by what we call “checkers”. These checkers look for actual defects, not just coding style violations. These are patterns of code execution that can cause crashes, memory corruption, memory and handle leaks, and other kinds problems that are hard errors, not just stylistic rules. Throughout our analysis we have taken great care to try to eliminate false positives, which are error reports that are not true defects. Our false positive rate is the lowest in the industry, typically less than 20% out of the box. This is important because developers will not adopt tools that are mostly a waste of their time.Finally it’s important to present the results clearly because it’s not only about finding defects, it’s about fixing them. The results are stored in a database and presented to give actionable information so developers can fix them efficiently.We’ll focus this talk on the Analysis and Presentation. For more about the Build, click on the Build icon, otherwise we will skip this.