当前位置:网站首页>A comprehensive understanding of static code analysis
A comprehensive understanding of static code analysis
2022-04-23 03:13:00 【Longzhi Devops solution】
Security in development 、 Reliability and compliance of software , Comprehensive static code analysis is an effective method . ad locum , We will talk about static analysis , Discuss the differences between comprehensive static code analysis , Explain the importance of comprehensive static code analysis , And how to conduct a comprehensive static code analysis .
What is comprehensive static code analysis
Comprehensive static code analysis , Or just a comprehensive analysis , It refers to the integrity of the analysis results or “ sanity ”. Static code analysis tools are said to provide reliable analysis results , This means that if there are specific defects or vulnerabilities in a software , The analysis tool will report the above problems .
If not, is there a problem , Provide some form of warning , So it won't be “ Missing ” Any question .
( notes : These questions are Helix QAC Tools are classified as possible problems , If not necessary , Then a comprehensive analysis can not be carried out .)
Comprehensive static code analysis is different from other forms of static analysis , Other forms of static analysis results may be based on what may happen within a certain time or resource range .
Given the runtime behavior of the program, modeling requires some approximation ( for example , Lack of understanding of program input or operating system status ), Comprehensive static code analysis requires Over-approximations( Over approximate ).
Over-approximations( Over approximate ) To ensure that there is no missing report ( For a given vulnerability type ), and under-approximations( Lower approximation ) The first thing to ensure is that there are no false positives, but there may be false positives .
Other forms of static analysis do not show this strictness , May include both Over-approximations( Over approximate ) Contain, under-approximations( Lower approximation ).
Comprehensive static code analysis tools and non comprehensive static code analysis tools may provide a health report for specific parts of the program , The comprehensive static code analysis tool engine provides additional assurance , That is, while providing this health certificate , All possibilities and all paths have been verified .
How a comprehensive static code analysis tool works
When it comes to comprehensive analysis , We usually consider more complex forms of interprocess and intraprocess control and data flow analysis , It works the same as today's most advanced static analysis tools .
Compared with simpler code syntax and semantic analysis , The difference is that static analysis of control and data flow is usually related to detecting more complex problems , Include :
- Null pointer error reference
- Array or buffer underflow and overflow
- Use uninitialized objects
- Exception allocating memory and freeing memory
- Number overflow 、 Underflow and surround
- Divide by zero
- Dead code
- Data competition 、 Deadlocks and other concurrency conflicts
Control and data flow analysis is a high computational load task , Because all possible inputs to the system and all possible control flow paths through the system must be considered . in fact , Due to the brute force of control flow and data flow analysis, the exhaustive algorithm will lead to the sharp rise of analysis time index , Therefore, this scheme is rarely used . Symbolic execution and abstract interpretation algorithms will be a better choice .
according to Roberto Amadini、Graeme Gange、Peter Schachte、Harald Søndergaard and Peter J. Stuckey Of 《 Abstract interpretation 、 Symbolic execution and constraints 》,“ Abstract interpretation is a static code analysis framework , It is applicable to all possible running states of the program .”
and “ Symbolic execution is the framework of reachability analysis , It tries to explore all possible execution paths of the program .” Both abstract interpretation and symbolic execution maintain constraints in the form of invariants or path conditions during execution , These path constraints determine what possible paths can be executed and what values can be saved in various data sources .
But one thing to note is , Although the abstract explanation is more comprehensive , But symbolic execution is not fully implemented .
Why comprehensive static code analysis is important ?
Comprehensiveness is an important factor in safety critical software systems , In particular, it can ensure that the software does not have any coding defects being checked . in other words , Comprehensive analysis can be used to ensure that there are no errors in the software .
Based on this , In the automotive system ISO 26262 Functional safety (FuSa) In the standard , Abstract interpretation analysis is explicitly cited as a software unit verification method ( surface 7, Method 1i).
How to use Helix QAC Tools perform comprehensive static code analysis
Because it can provide in-depth and highly accurate analysis results ,30 Over the years ,Helix QAC Has always been a trusted static code analysis tool .Helix QAC Be able to conduct comprehensive static analysis , It has always been the preferred tool for strict regulatory compliance and safety critical industries .
But in order to be able to Helix QAC Enable comprehensive analysis in the tool , The following steps are required :
The data flow needs to be deep (Dataflow Settings) Set to maximum (5), This will add multiple -prodoption, As shown in the screenshot above .( see also QAC or QAC++ In the component manual " Analysis timeout " section , Understand why this class " Overtime " Settings are necessary for a comprehensive analysis .)
Besides ,“df::inter=5” and “inter-TU Analysis” Although not necessary for a comprehensive analysis , But it can be enabled at an additional computational cost , To reduce the number of issues that may need to be reported . These settings can be used to enable inter program and intra program analysis .
Why use Helix QAC Tool for comprehensive static analysis
Experience for yourself Helix QAC The impact of comprehensive static analysis of tools on code quality and comprehensiveness .
Contact now Long Zhi Experience , Open your Helix QAC Free trial tour .
Author's brief introduction :
Steve · Howard (Steve Howard)
Static code scanning tool (SAST)Perforce System product advocate , Steve has more than in the field of software verification and validation 15 Years of experience , Especially in static code analysis .
Steve has a first-class degree in computer science from the University of Wales and a number of graduate degrees in software testing and security certification .
版权声明
本文为[Longzhi Devops solution]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230310422491.html
边栏推荐
- MYSQL04_ Exercises corresponding to arithmetic, logic, bit, operator and operator
- The most detailed in the whole network, software testing measurement, how to optimize software testing cost and improve efficiency --- hot
- 【VS Code】解决jupyter文件在vs code中显示异常的问题
- Experiment 6 input / output stream
- Establishing and traversing binary tree
- Xutils3 corrected a bug I reported. Happy
- Laravel8- use JWT
- Load view Caton
- [untitled]
- Charles uses three ways to modify requests and responses
猜你喜欢
Ningde's position in the times is not guaranteed?
Eight elder brothers chronicle [4]
LoadRunner - performance testing tool
Xutils3 corrected a bug I reported. Happy
Student achievement management
荐读 | 分享交易员的书单,向名家请教交易之道,交易精彩无比
Top ten project management software similar to JIRA
研讨会回放视频:如何提升Jenkins能力,使其成为真正的DevOps平台
LNMP MySQL allows remote access
2022山东省安全员C证上岗证题库及在线模拟考试
随机推荐
Experiment 6 input / output stream
Top ten project management software similar to JIRA
Impact of AOT and single file release on program performance
C WPF UI framework mahapps switching theme
[MySQL] left function | right function
Top 9 task management system in 2022
First in the binary tree
Use of ADB command [1]
为什么BI对企业这么重要?
Using stack to solve the problem of "mini parser"
使用split来解决“最常见的单词”问题
C read / write binary file
由于3²+4²=5²,所以称‘3,4,5‘为勾股数,求n(包括n)以内所有勾股数数组。
Mysql database
Source generator actual combat
C# 读写二进制文件
Due to 3 ²+ four ²= five ², Therefore, we call '3,4,5' as the number of Pythagorean shares, and find the array of all Pythagorean shares within n (including n).
Use of metagroup object tuple in C
Vs code setting line feed
7-11 rearrange the linked list (25 points)