CN104331371B - A kind of distributed code detection method - Google Patents

A kind of distributed code detection method Download PDF

Info

Publication number
CN104331371B
CN104331371B CN201410696785.0A CN201410696785A CN104331371B CN 104331371 B CN104331371 B CN 104331371B CN 201410696785 A CN201410696785 A CN 201410696785A CN 104331371 B CN104331371 B CN 104331371B
Authority
CN
China
Prior art keywords
distributed
code
terminal
detection method
code detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410696785.0A
Other languages
Chinese (zh)
Other versions
CN104331371A (en
Inventor
郭骞
李尼格
范杰
高鹏
余勇
石聪聪
蒋诚智
俞庚申
曹宛恬
冯谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
Smart Grid Research Institute of SGCC
Original Assignee
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
Global Energy Interconnection Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, China Electric Power Research Institute Co Ltd CEPRI, Global Energy Interconnection Research Institute filed Critical State Grid Corp of China SGCC
Priority to CN201410696785.0A priority Critical patent/CN104331371B/en
Publication of CN104331371A publication Critical patent/CN104331371A/en
Application granted granted Critical
Publication of CN104331371B publication Critical patent/CN104331371B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Multi Processors (AREA)

Abstract

The present invention relates to a kind of distributed code detection method, methods described is detected by detecting system;It the described method comprises the following steps:Initiation parameter;Analytic function is quoted;Integral data stream;Decompose constraint set;Recall result.The detecting system includes control terminal and distributed terminal.Management of the control terminal to each distributed terminal E, while the overall pretreatment of test system code is provided and distributes to distributed terminal E and carries out association's processing;The distributed terminal is responsible for carrying out detection process to the code distributed.The method of the present invention carries out collaboration processing by the way that data flow is decomposed using different distributed terminals, reduces the detection loading problem of original single equipment processing, the capacity of lifting processing code.

Description

A kind of distributed code detection method
Technical field:
The present invention relates to a kind of code detection method, is more particularly to a kind of distributed code detection method.
Background technology:
Code detection is a kind of static test of white-box testing, is to find software defect in numerous method for testing software One of most efficient method.Code tester is divided into two kinds of analysis methods:
1st, static analysis
Static analysis mainly carries out morphological analysis, syntactic analysis to source code, extracts the static information of analyzed program, institute The static information of extraction is the basis of aacode defect detection.Staticaanalysis results mainly include three parts information:
Application definition information:Application definition information contains definition all in program and claim information, such as class definition, side Definition of local variable etc. in the definition of method and data member, method.
Program structure information:Refer mainly to the call relation between control stream information and the method in method.Static analyzer point Analyse the nest relation and method call between the sentence branch of program, branch, the control stream information and recalls information of recording method, structure Make syntax tree.
Variable operation in branch:To branch into elementary cell in method control flow, each language in each branch is recorded The operation and the sequence of operation that sentence applies to each variable.
2nd, data-flow analysis
Data-flow analysis is also a kind of static code inspection method.It is that the bar of tested program is not being run by computer Under part, using the advance information obtained after static analysis, detect to the assignment of variable with using in operation, if exist not Reasonable situation, that is, find out in tested program and be not assigned using preceding with the presence or absence of variable;Variable between assignment twice not by Use;Whether one variable the abnormal conditions such as is not used by after being assigned.
In terms of the current main application of data-flow analysis is confined to realization and the optimisation technique of compiler mostly, and in code Practical data stream analysis techniques are actually rare in inspection system, are concentrated mainly in certain several defects detection, as assignment is quoted Abnormality detection and detecting memory errors, occupation mode are mainly to define the symbol of data flow operations, use the notation structure Data flow expression (symbol string being made up of data manipulation symbol) is made, then analyzes the symbol string and is lacked to determine whether there is code Fall into.
Therefore need to propose a kind of distributed code detection method, to overcome drawbacks described above.
The content of the invention:
It is an object of the invention to provide a kind of distributed code detection method, methods described is directed to data-flow analysis, there is provided High performance analysis method.
To achieve the above object, the present invention uses following technical scheme:A kind of distributed code detection method, methods described Detected by detecting system;It the described method comprises the following steps:
(1) initiation parameter;
(2) analytic function is quoted;
(3) integral data stream;
(4) constraint set is decomposed;
(5) result is recalled.
A kind of distributed code detection method provided by the invention, it is characterised in that:The detecting system includes control terminal With distributed terminal E.
A kind of distributed code detection method provided by the invention, the initiation parameter in the step (1) are described Control terminal arranges to all code datas, integrates the code data in all scattered files.
Another preferable a kind of distributed code detection method provided by the invention, the code data are opened by principal function Beginning is pre-processed.
Another preferable a kind of described a kind of distributed code detection method provided by the invention, in the step (2) The process that analytic function is quoted retrieves the external function of all references for traversal, and quotes position to it and be marked.
Another preferable a kind of distributed code detection method provided by the invention, integral data stream in the step (3) Process to be integrated to all data flows since principal function, form constraint set, and start code detection.
Another preferable a kind of distributed code detection method provided by the invention, the step (4) is middle to decompose constraint set Process comprise the following steps:
When new parameter produces or runs into judgement sentence, then data flow residing for each parameter after being introduced according to new parameter and Judge that different data streams caused by sentence decomposite constraint subset, and be assigned to different distributed terminal E and enter line code inspection Survey;
There is new parameter to produce when constraining subset or run into judgement sentence, then residing for each parameter after being introduced according to new parameter Data flow and judge that different data streams caused by sentence decomposite new constraint subset and distribute to different distributed ends Hold E processing.
Another preferable a kind of distributed code detection method provided by the invention, when the constraint subset inspection that can not be decomposed again After survey terminates, then the constraint subset before result is recalled to decomposition according to the step (5) provides subsequent treatment, until tracing back to Former constraint set.
Another preferable a kind of distributed code detection method provided by the invention, the control terminal is to some distributions Formula terminal E is controlled.
Another preferable a kind of distributed code detection method provided by the invention, the control terminal is to each distributed terminal E management, while the overall pretreatment of test system code is provided and distributes to distributed terminal E and carries out association's processing;
The distributed terminal E is responsible for carrying out detection process to the code distributed.
With immediate prior art ratio, the present invention, which provides technical scheme, has following excellent effect
1st, the present invention carries out collaboration processing by the way that data flow is decomposed using different distributed terminal E;
2nd, the present invention reduces the detection loading problem of original single equipment processing, the capacity of lifting processing code;
3rd, the present invention is directed to data-flow analysis, there is provided high performance analysis method;
4th, the present invention reduces the generation of detection mistake;
5th, the present invention can accurately have found software defect.
Brief description of the drawings
Fig. 1 is the constraint set decomposing schematic representation of the inventive method;
Fig. 2 is the distributed code detection technique logic chart of the present invention;
Fig. 3 is the flow chart of the inventive method.
Embodiment
With reference to embodiment, the invention will be described in further detail.
Embodiment 1:
As Figure 1-3, a kind of distributed code detection method of the invention of this example, methods described are examined by detecting system Survey, as shown in Figure 2;
It is described including control terminal C and distributed terminal E;The control terminal C and distributed terminal E enter line code between each other The operation of detection.
Control terminal C:The main management being responsible for each distributed terminal E, while provide the overall pretreatment of system code simultaneously Distribute to distributed terminal E and carry out association's processing.
Distributed terminal E:Can be the equipment that a reality can be run, specify processing line that can also be in equipment Journey.It is responsible for carrying out detection process to the code distributed.
For a kind of handling process of distributed code detection method referring to Fig. 3, it is:
1st, parameter initialization
All parameters are initialized, all code datas arranged in control terminal C first, are integrated all scattered Code data in file.Then pretreatment is proceeded by by principal function.
2nd, function reference is analyzed
The external function of traversal retrieval all references, and position is quoted to it and is marked, in order to cited part generation Code division dispensing can transmit the external function that is cited in time when specifying distributed terminal E.
3rd, integral data stream
All data flows since principal function are integrated, form constraint set v1, start code detection work.
4th, constraint set decomposes
Code is carried out in detection process one by one, judges sentence if new parameter produces or runs into if, switch etc., then Data flow residing for every parameter after being introduced according to new parameter, judge that different data streams caused by sentence decomposite constraint subset V1, v2 ... vk (only to be decomposed into the constraint subsets of v1, v2 two as example in Fig. 1), be assigned to different distributed terminal E1, Code detection is carried out in E2 ... Ek.
If constraint subset v1, v2 ... vk, which has new parameter to produce or run into if, switch etc., judges sentence, according to new Parameter introduce after every parameter residing for data flow, judge different data streams caused by sentence decomposite new constraint subset and divide The different distributed terminal E processing of dispensing.
This action is repeated, can not be decomposed again to from constraint subset.
5th, result is recalled
After the constraint subset detection that can not be decomposed again terminates, then after the constraint subset before result is recalled to decomposition provides Continuous processing, until tracing back to former constraint set v1.
Finally it should be noted that:The above embodiments are merely illustrative of the technical scheme of the present invention and are not intended to be limiting thereof, institute The those of ordinary skill in category field with reference to above-described embodiment although should be understood:Still can be to the embodiment of the present invention Modify or equivalent substitution, these are without departing from any modification of spirit and scope of the invention or equivalent substitution, in Shen Within claims of the invention that please be pending.

Claims (5)

1. a kind of distributed code detection method, methods described are detected by detecting system;It is characterized in that:Methods described includes Following steps:
(1) initiation parameter;
Initiation parameter in the step (1) integrates all scattered texts to be arranged in control terminal to all code datas Code data in part;
(2) analytic function is quoted;
The process that analytic function is quoted in the step (2) retrieves the external function of all references for traversal, and quotes position to it Put and be marked;
(3) integral data stream;
The process of integral data stream is formed about to be integrated to all data flows since principal function in the step (3) Constriction, and start code detection;
(4) constraint set is decomposed;
The process that constraint set is decomposed in the step (4) comprises the following steps:
When new parameter produces or runs into judgement sentence, then data flow residing for each parameter and judgement after being introduced according to new parameter Different data streams caused by sentence decomposite constraint subset, and are assigned to different distributed terminal E and carry out code detection;
There is new parameter to produce when constraining subset or run into judgement sentence, then the number residing for each parameter after being introduced according to new parameter According to stream and judge that different data streams caused by sentence decomposite new constraint subset and distribute to different distributed terminal E Row processing;
(5) result is recalled;
After the constraint subset detection that can not be decomposed again terminates, then the pact before result is recalled to decomposition according to the step (5) Beam subset provides subsequent treatment, until tracing back to former constraint set.
A kind of 2. distributed code detection method as claimed in claim 1, it is characterised in that:The detecting system includes control End and distributed terminal E.
A kind of 3. distributed code detection method as claimed in claim 2, it is characterised in that:The code data passes through main letter Number proceeds by pretreatment.
A kind of 4. distributed code detection method as claimed in claim 2, it is characterised in that:The control terminal is to some described Distributed terminal E is controlled.
A kind of 5. distributed code detection method as claimed in claim 4, it is characterised in that:The control terminal is to each distribution Terminal E management, while the overall pretreatment of test system code is provided and distributes to distributed terminal E and carries out association's processing;
The distributed terminal E is responsible for carrying out detection process to the code distributed.
CN201410696785.0A 2014-11-26 2014-11-26 A kind of distributed code detection method Active CN104331371B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410696785.0A CN104331371B (en) 2014-11-26 2014-11-26 A kind of distributed code detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410696785.0A CN104331371B (en) 2014-11-26 2014-11-26 A kind of distributed code detection method

Publications (2)

Publication Number Publication Date
CN104331371A CN104331371A (en) 2015-02-04
CN104331371B true CN104331371B (en) 2018-01-19

Family

ID=52406103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410696785.0A Active CN104331371B (en) 2014-11-26 2014-11-26 A kind of distributed code detection method

Country Status (1)

Country Link
CN (1) CN104331371B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559127A (en) * 2013-10-28 2014-02-05 北京邮电大学 Defect processing method and defect processor
CN103970650A (en) * 2014-04-09 2014-08-06 广州杰赛科技股份有限公司 Distributed testing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098290B2 (en) * 2008-01-30 2015-08-04 Intuit Inc. Method and apparatus for facilitating diagnostic logging for software components

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559127A (en) * 2013-10-28 2014-02-05 北京邮电大学 Defect processing method and defect processor
CN103970650A (en) * 2014-04-09 2014-08-06 广州杰赛科技股份有限公司 Distributed testing method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Parallel symbolic execution for;Staats M, Pasareanu C;《ISSTA’10. Trento》;20100731;全文 *
软件库调用规约挖掘;钟浩等;《软件学报》;20101231;第22卷(第03期);全文 *
面向软件脆弱性分析的并行符号执行技术研究;赵云山;《中国博士学位论文全文数据库》;20140115(第01期);参见第一章-第二章,第六章6.5节 *

Also Published As

Publication number Publication date
CN104331371A (en) 2015-02-04

Similar Documents

Publication Publication Date Title
CN105787367B (en) A kind of the patch safety detecting method and system of software upgrading
CN110543421B (en) Unit test automatic execution method based on test case automatic generation algorithm
CN110908640A (en) Method for realizing service function and script engine
CN106919612B (en) Processing method and device for online structured query language script
CN109857641A (en) The method and device of defects detection is carried out to program source file
CN107678973B (en) Automatic generation method and system of test script
CN110389896A (en) Code automated analysis and test method, device and computer readable storage medium
CN105068925A (en) Software security flaw discovering system
CN109492106B (en) Automatic classification method for defect reasons by combining text codes
CN105302719A (en) Mutation test method and apparatus
CN105094939B (en) A kind of software source file Static Analysis Method realized based on the automatic techniques of compiling of Makefile
CN103530209B (en) A kind of code keypad automated testing method
CN106445803A (en) Security-critical embedded software target code coverage analysis method
CN112579469A (en) Source code defect detection method and device
CN115269427A (en) Intermediate language representation method and system for WEB injection vulnerability
CN113780367A (en) Classification model training and data classification method and device, and electronic equipment
CN110020190B (en) Multi-instance learning-based suspicious threat index verification method and system
CN107577460A (en) A kind of method from unstructured data extraction structural data
CN104317711A (en) Path-based method and system for verifying software implementation and design uniformity
CN109783361A (en) The method and apparatus for determining code quality
CN104331371B (en) A kind of distributed code detection method
CN109388575A (en) Static analysis householder method
CN107247663B (en) Redundancy variant identification method
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN111459774B (en) Method, device, equipment and storage medium for acquiring flow of application program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160505

Address after: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant after: State Grid Corporation of China

Applicant after: China Electric Power Research Institute

Applicant after: State Grid Smart Grid Institute

Address before: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant before: State Grid Corporation of China

Applicant before: China Electric Power Research Institute

CB02 Change of applicant information

Address after: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant after: State Grid Corporation of China

Applicant after: China Electric Power Research Institute

Applicant after: GLOBAL ENERGY INTERCONNECTION RESEARCH INSTITUTE

Address before: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing

Applicant before: State Grid Corporation of China

Applicant before: China Electric Power Research Institute

Applicant before: State Grid Smart Grid Institute

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant