Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code static analysis-based data race detecting method and system thereof

A technology of data competition and static analysis, applied in the field of data competition detection based on code static analysis, it can solve problems such as limitations, inability to fully automatically determine, and the ability to find errors varies greatly, and achieves high reliability.

Inactive Publication Date: 2011-05-25
BEIJING UNIV OF POSTS & TELECOMM
View PDF1 Cites 45 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Both dynamic testing and static testing have their own advantages and disadvantages: the advantage of dynamic testing is that the software errors found are very intuitive, and the disadvantage is that the design requirements for test cases are high, and the ability to find errors in different test case sets varies greatly. The fact that the test method needs to actually run the program under test is also a limitation
The disadvantage of dynamic testing is precisely the advantage of static testing. Static testing does not need to actually run the program under test, does not need to design related test cases, and is easy to automate. The disadvantage of static testing is that the problems found are often not completely automatically determined as real errors. , requires manual confirmation, so static testing is also called static analysis
Once a data race occurs in a multi-threaded program, it will be difficult to detect
It only violates the invariant of the data structure, and will not cause the program to crash immediately, it will only cause some errors during the long-term running of the program, so it is difficult to trace the root of the data race

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code static analysis-based data race detecting method and system thereof
  • Code static analysis-based data race detecting method and system thereof
  • Code static analysis-based data race detecting method and system thereof

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0062] In order to facilitate a further understanding of the method and system of the present invention and the achieved effects, preferred embodiments are described in detail below in conjunction with the accompanying drawings.

[0063] The invention provides a data competition detection method based on code static analysis, and its basic idea is: read the software to be tested, perform lexical analysis, syntax analysis and semantic analysis on the source program of the software to be tested, and generate an abstract syntax tree of the software to be tested , control flow graph, global function call graph (CG); traverse the abstract syntax tree generated by each source file, find out the entry functions of all threads; traverse the control flow graph of each function, calculate the alias information inside each function, Exit alias information between functions, lock set information, access chain of escapeable variables inside the function, and thread creation relationship dia...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a code static analysis-based data race detecting method and a system of the detecting method. The method comprises the following steps of: reading software to be detected, statically analyzing a source program of the software to be detected, and generating an abstract syntax tree, a control flow graph and a global function call graph of the software to be detected; on thatbasis, computing alias information in each function, outlet alias information among functions, lock assembly information, an access link of an access escapable variable quantity in each function and a thread building relational graph; computing a plurality of initialized sentence pair sets of a plurality of access nodes in every two threads; and gradually eliminating the sets according to the alias information, the lock assembly information and a concurrency relation to obtain a sentence pair which can finally have the data race. The detecting method and the detecting system can effectively detect the data race of a multi-thread program compiled by C / C++, thereby having the characteristics of high test precision and high automaticity, and being applied to detecting the data race caused bytwo threads or multiple threads.

Description

technical field [0001] The invention relates to a software testing technology, in particular to a data competition detection method and system based on code static analysis. Background technique [0002] After software development, it needs to be tested before it is put into operation. The final review of software requirements analysis, design specifications and coding implementation is a key step in software quality assurance. Software testing is the process of executing programs in order to find errors. The fundamental purpose of analyzing or executing programs in a controlled software testing environment is to discover and correct potential faults and defects in the software with as little time and manpower as possible. , Improve the quality of the software. [0003] From the perspective of whether the software under test needs to be run during the test process, software testing methods can be divided into two categories: dynamic testing methods and static testing method...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
Inventor 黄俊飞宫云战杨朝红金大海姚欣洪王雅文肖庆白哥乐
Owner BEIJING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products