[go: up one dir, main page]

CN106020913B - A method and device for updating a defect detection tool - Google Patents

A method and device for updating a defect detection tool Download PDF

Info

Publication number
CN106020913B
CN106020913B CN201610390646.4A CN201610390646A CN106020913B CN 106020913 B CN106020913 B CN 106020913B CN 201610390646 A CN201610390646 A CN 201610390646A CN 106020913 B CN106020913 B CN 106020913B
Authority
CN
China
Prior art keywords
type
exception
lexical
caused
analyzer
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
CN201610390646.4A
Other languages
Chinese (zh)
Other versions
CN106020913A (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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN201610390646.4A priority Critical patent/CN106020913B/en
Publication of CN106020913A publication Critical patent/CN106020913A/en
Application granted granted Critical
Publication of CN106020913B publication Critical patent/CN106020913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the invention discloses a kind of defect detection tool update method and device, it is at least one Exception Type by dividing anomaly that method, which includes: according to the position and opportunity occurred extremely in engineering to be tested,;For the exception of each Exception Type, the corresponding abnormal solution of the Exception Type is determined;According to each abnormal solution, the speech analyser in the defect detection tool is updated, wherein the speech analyser includes at least lexical analyzer and syntax analyzer.Using the embodiment of the present invention, the exception that defect detection tool is generated by the influence of the unexpected grammer of diversity bring of the exploitation environment and compiler of engineering to be detected and/or morphology can be evaded so that subsequent analysis everything goes well with your work carry out.

Description

A kind of defect detection tool update method and device
Technical field
The present invention relates to software testing technology field, in particular to a kind of defect detection tool update method and device.
Background technique
It is well known that software test is a very important link in software development, it is mainly used to identify exploitation Software program correctness, integrality and quality, it is ensured that software systems be before being put into use do not have it is defective.Actually answer In, to save manpower, time or hardware resource, testing efficiency is improved, is introduced various scarce based on automatic test concept Detection instrument is fallen into, and is widely used.
And for C or C Plus Plus, under the compiler of different operating system or different platform, language standard can have More or less difference, cause existing defect detection tool may due to nonrecognition certain unexpected morphology and/or language Method and generate exception so that subsequent analysis work be difficult to go on smoothly.Currently, many defect detection tools are before test Will do it is some replacement come prevent due to User Exploitation platform with its be expected it is inconsistent caused by pre-process and can not normally be unfolded The case where, it, still can be because of the speech analyser nonrecognition keyword, customized of defect detection tool but during subsequent analysis Data type or logical construction and dish out some morphology perhaps grammer exception thus influence some or entire engineering point Analysis can only obtain seldom analysis as a result, the defect of entire engineering can not be fully described by, under serious situation, or even can obtain Less than any analysis result.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of defect detection tool update method and device, to evade described lack Detection instrument is fallen into because of the exploitation environment of engineering to be detected and the shadow of the unexpected grammer of diversity bring of compiler and/or morphology Ring and generate exception so that subsequent analysis everything goes well with your work carry out.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of defect detection tool update method, the method packets It includes:
It is at least one Exception Type by dividing anomaly according to the position and opportunity occurred extremely in engineering to be tested;
For the exception of each Exception Type, the corresponding abnormal solution of the Exception Type is determined;
According to each abnormal solution, the speech analyser in the defect detection tool is updated, wherein the language Say that analyzer includes at least lexical analyzer and syntax analyzer.
Specifically, the Exception Type includes:
Morphology caused by type keyword and unknown customization type is abnormal, morphology caused by non-type keyword is abnormal and Grammer caused by unknown logical construction is abnormal.
Specifically, the situation of morphology exception caused by being type keyword and unknown customization type in the Exception Type Under, for the exception of morphology caused by type keyword and unknown customization type, the abnormal solution determined are as follows:
For the exception of morphology caused by type keyword and unknown customization type, add in the derivation relationship of declarative statement Add the statement for the character string that cannot be identified for the lexical analyzer, wherein the typonym of the character string of statement with Type designations are identical.
Specifically, in the case where the morphology exception caused by the Exception Type is non-type keyword, for non-type Morphology caused by keyword is abnormal, the abnormal solution determined are as follows:
For the exception of morphology caused by non-type keyword, during morphological analysis, ignore the lexical analyzer not The morphological analysis for the character string that can be identified.
Specifically, it in the case where the grammer exception caused by the Exception Type is unknown logical construction, is patrolled for unknown Collect the abnormal solution that grammer caused by structure is abnormal, determines are as follows:
For each sentence that the syntax analyzer cannot identify, after first word for judging deletion current statement, Whether the syntax analyzer can identify current statement;
If not, whether the syntax analyzer can identify after continuing to execute first word that current statement is deleted in judgement The operating procedure of current statement.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of defect detection tool updating device, described device packets It includes:
Division module, for being at least one by dividing anomaly according to the position and opportunity occurred extremely in engineering to be tested Kind Exception Type;
Determining module determines the corresponding abnormal solution of the Exception Type for being directed to the exception of each Exception Type Scheme;
Update module, for updating the language analysis in the defect detection tool according to each abnormal solution Device, wherein the speech analyser includes at least lexical analyzer and syntax analyzer.
Specifically, the Exception Type includes:
Morphology caused by type keyword and unknown customization type is abnormal, morphology caused by non-type keyword is abnormal and Grammer caused by unknown logical construction is abnormal.
Specifically, the situation of morphology exception caused by being type keyword and unknown customization type in the Exception Type Under, the determining module is specifically used for:
The statement for the character string that cannot be identified for the lexical analyzer will be added in the derivation relationship of declarative statement, It is determined as abnormal solution extremely corresponding with morphology caused by type keyword and unknown customization type;Wherein, it states The character string typonym it is identical as type designations.
Specifically, in the case where the morphology exception caused by the Exception Type is non-type keyword, the determining mould Block is specifically used for:
The morphological analysis for the character string that the lexical analyzer cannot identify will be ignored during morphological analysis, determined For abnormal solution extremely corresponding with morphology caused by non-type keyword.
Specifically, in the case where the grammer exception caused by the Exception Type is unknown logical construction, the determining mould Block is specifically used for:
The each sentence that will cannot be identified for the syntax analyzer judges first word for deleting current statement Afterwards, whether the syntax analyzer can identify current statement;If not, continuing to execute first word that current statement is deleted in judgement Afterwards, whether the syntax analyzer can identify current statement, be determined as extremely corresponding with grammer caused by unknown logical construction Abnormal solution.
Using technical solution provided by the embodiment of the present invention, according to the position that occurs extremely in engineering to be tested and when Dividing anomaly is at least one Exception Type, is then directed to the exception of each Exception Type, determines the Exception Type by machine Corresponding exception solution updates the language analysis in the defect detection tool further according to each abnormal solution Device, wherein the speech analyser includes at least lexical analyzer and syntax analyzer.As can be seen that the embodiment of the present invention provides Scheme can evade defect detection tool when carrying out defects detection, because C and/or C Plus Plus are in different exploitation environment and volume Translate language standard's difference under device lead to analyzer nonrecognition keyword, user-defined dada type or logical construction and dish out one The exception of a little morphology or grammer obtains so that it is guaranteed that the generation of abstract syntax tree and its subsequent analysis work are smooth To the analysis result of the engineering to be tested.
Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach all the above excellent simultaneously Point.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of defect detection tool update method provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of defect detection tool updating device provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of defect detection tool update method and devices, carry out individually below specifically It is bright.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of defect detection tool update method provided in an embodiment of the present invention, It may include steps of:
Dividing anomaly is at least one exception class according to the position and opportunity occurred extremely in engineering to be tested by S101 Type.
Specifically, Exception Type may include: the exception of morphology caused by type keyword and unknown customization type, non-class Morphology caused by type keyword is abnormal abnormal with grammer caused by unknown logical construction.
In practical application, what usual defects detection was related to is source file, intermediate file and the engineering text of engineering to be tested Part is handled these files by speech analyser, sees if there is exception, can be according to abnormal appearance if there is exception Position and opportunity divide Exception Type.Specifically, will be during morphological analysis, the dividing anomaly in sentence statement part For the exception of morphology caused by type keyword and unknown customization type, the dividing anomaly in other parts is that non-type is crucial Morphology caused by word is abnormal;It is that the grammer as caused by unknown logical construction is different by the dividing anomaly occurred in parsing process Often.Wherein, type keyword is the keyword of programming language, and indicates a kind of data type;Unknown customization type refers to Custom data type can be the data types such as structural body or class.
S102 determines the corresponding abnormal solution of the Exception Type for the exception of each Exception Type.
Specifically, the situation of morphology exception caused by being type keyword and unknown customization type in the Exception Type Under, for the exception of morphology caused by type keyword and unknown customization type, the abnormal solution determined are as follows:
For the exception of morphology caused by type keyword and unknown customization type, add in the derivation relationship of declarative statement Add the statement for the character string that cannot be identified for the lexical analyzer, wherein the typonym of the character string of statement with Type designations are identical.
It will be described in detail for the morphology exception caused by the unknown customization type in C language below.
It is assumed that defect detection tool is when treating testing engineering and being tested, to sentence " foo_foo;" carry out morphology During analysis, exception is quoted since lexical analyzer nonrecognition is in the character string " foo " of declarator position, wherein " foo " is a unknown customization type, by S101 it is known that this exception should be divided into type keyword and unknown customized Morphology caused by type is abnormal, for this exception, can by a customized data type come identification string " foo ", That is, the statement for being directed to character string " foo " is added in the derivation relationship of declarative statement, and in practical application, the customized number It can be according to the title and type designations of type identical.
Such as: addition is claimed as " abc abc foo for character string " foo ";", wherein first abc is data The symbol of type, second abc are the title of data type.
Specifically, in the case where the morphology exception caused by the Exception Type is non-type keyword, for non-type Morphology caused by keyword is abnormal, the abnormal solution determined are as follows:
For the exception of morphology caused by non-type keyword, during morphological analysis, ignore the lexical analyzer not The morphological analysis for the character string that can be identified.
In practical application, for building abstract syntax tree, non-type keyword does not have in syntactic analysis later Especially important effect is not related to specific function under normal conditions and realizes, therefore, can be as a common word in sentence Symbol string, it might even be possible to ignore the morphological analysis to it.
It is assumed that defect detection tool is when treating testing engineering and being tested, to sentence " something inta=5;" During carrying out morphological analysis, exception is quoted due to lexical analyzer nonrecognition character string " something ", this field skill Art personnel state position it is understood that " something " is not at, and are learnt by S101, this exception should be divided into non-class Morphology caused by type keyword is abnormal, it is a qualifier, is not related to specific function and realizes, therefore, in morphological analysis In the process, can directly be ignored.
Specifically, it in the case where the grammer exception caused by the Exception Type is unknown logical construction, is patrolled for unknown Collect the abnormal solution that grammer caused by structure is abnormal, determines are as follows:
For each sentence that the syntax analyzer cannot identify, after first word for judging deletion current statement, Whether the syntax analyzer can identify current statement;
If not, whether the syntax analyzer can identify after continuing to execute first word that current statement is deleted in judgement The operating procedure of current statement.
It is assumed that defect detection tool is when treating testing engineering and being detected, since syntax analyzer cannot identify sentence " Socket&operator=(const Socket&)=delete;" logical construction and quote exception, learnt by S101, This exception is the exception of grammer caused by unknown logical construction, for this exception, deletes first word " Socket ", judgement first Current statement " &operator=(const Socket&)=delete;" can be identified by syntax analyzer, if it is not, First word " & " for deleting current statement, then judges sentence " operator=(const Socket&)=delete;" energy It is no to be identified by syntax analyzer, if still cannot, continue first word " operator " for deleting current statement, and judge Current statement "=(const Socket&)=delete;" can be identified by syntax analyzer, and so on, if deleted straight It cannot still be identified to a last word by syntax analyzer, i.e. sentence " delete;" cannot still be identified, then it deletes " delete ", will ";" it is identified as null statement.
S103 updates the speech analyser in the defect detection tool, wherein institute according to each abnormal solution Speech analyser is stated including at least lexical analyzer and syntax analyzer.
It, can be according to the exception solution party determined by S102 for the exception of each Exception Type in practical application Case updates the speech analyser in defect detection tool, more specifically, updating the lexical analyzer in defect detection tool respectively And syntax analyzer, that is, will abnormal solution party extremely corresponding with morphology caused by type keyword and unknown customization type Case, abnormal solution extremely corresponding with morphology caused by non-type keyword are added in lexical analyzer, will with it is unknown The extremely corresponding abnormal solution of grammer caused by logical construction is added in syntax analyzer, so that defect detection tool In speech analyser can evade the abnormal appearance, to ensure the generation and subsequent analysis process of abstract syntax tree It goes on smoothly.
It is drawn according to the position and opportunity occurred extremely in engineering to be tested by abnormal using embodiment illustrated in fig. 1 of the present invention It is divided at least one Exception Type, is then directed to the exception of each Exception Type, determines the corresponding exception of the Exception Type Solution updates the speech analyser in the defect detection tool further according to each abnormal solution, wherein described Speech analyser includes at least lexical analyzer and syntax analyzer.As can be seen that scheme provided in an embodiment of the present invention can Evade defect detection tool when carrying out defects detection, the language under different exploitation environment and compiler because of C and/or C Plus Plus Standard difference lead to analyzer nonrecognition keyword, user-defined dada type or logical construction and some morphology for dishing out or The exception of grammer obtains described to be tested to keep the generation of abstract syntax tree and its subsequent analysis work smooth The analysis result of engineering.
Corresponding with above-mentioned embodiment of the method, the embodiment of the present invention also provides a kind of defect detection tool updating device.
Referring to fig. 2, Fig. 2 is a kind of structural schematic diagram of defect detection tool updating device provided in an embodiment of the present invention, It is corresponding with process shown in FIG. 1, comprising:
Division module 201, for being at least by dividing anomaly according to the position and opportunity occurred extremely in engineering to be tested A kind of Exception Type.
Specifically, Exception Type may include: the exception of morphology caused by type keyword and unknown customization type, non-class Morphology caused by type keyword is abnormal abnormal with grammer caused by unknown logical construction.
Determining module 202 determines the corresponding abnormal solution of the Exception Type for being directed to the exception of each Exception Type Certainly scheme.
Specifically, the situation of morphology exception caused by being type keyword and unknown customization type in the Exception Type Under, the determining module is specifically used for:
The statement for the character string that cannot be identified for the lexical analyzer will be added in the derivation relationship of declarative statement, It is determined as abnormal solution extremely corresponding with morphology caused by type keyword and unknown customization type;Wherein, it states The character string typonym it is identical as type designations.
Specifically, in the case where the morphology exception caused by the Exception Type is non-type keyword, the determining mould Block is specifically used for:
The morphological analysis for the character string that the lexical analyzer cannot identify will be ignored during morphological analysis, determined For abnormal solution extremely corresponding with morphology caused by non-type keyword.
Specifically, in the case where the grammer exception caused by the Exception Type is unknown logical construction, the determining mould Block is specifically used for:
The each sentence that will cannot be identified for the syntax analyzer judges first word for deleting current statement Afterwards, whether the syntax analyzer can identify current statement;If not, continuing to execute first word that current statement is deleted in judgement Afterwards, whether the syntax analyzer can identify current statement, be determined as extremely corresponding with grammer caused by unknown logical construction Abnormal solution.
Update module 203, for updating the language point in the defect detection tool according to each abnormal solution Parser, wherein the speech analyser includes at least lexical analyzer and syntax analyzer.
It is drawn according to the position and opportunity occurred extremely in engineering to be tested by abnormal using embodiment illustrated in fig. 2 of the present invention It is divided at least one Exception Type, is then directed to the exception of each Exception Type, determines the corresponding exception of the Exception Type Solution updates the speech analyser in the defect detection tool further according to each abnormal solution, wherein described Speech analyser includes at least lexical analyzer and syntax analyzer.As can be seen that scheme provided in an embodiment of the present invention can Evade defect detection tool when carrying out defects detection, the language under different exploitation environment and compiler because of C and/or C Plus Plus Standard difference lead to analyzer nonrecognition keyword, user-defined dada type or logical construction and some morphology for dishing out or The exception of grammer obtains described to be tested to keep the generation of abstract syntax tree and its subsequent analysis work smooth The analysis result of engineering.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is can It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium, The storage medium designated herein obtained, such as: ROM/RAM, magnetic disk, CD.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (8)

1.一种缺陷检测工具更新方法,其特征在于,所述方法包括:1. a defect detection tool update method, is characterized in that, described method comprises: 根据待测试工程中异常出现的位置和时机,将异常划分为至少一种异常类型,其中所述异常类型包括:According to the location and timing of the abnormality in the project to be tested, the abnormality is divided into at least one abnormality type, wherein the abnormality type includes: 类型关键字和未知自定义类型引起的词法异常、非类型关键字引起的词法异常和未知逻辑结构引起的语法异常;Lexical exceptions caused by type keywords and unknown custom types, lexical exceptions caused by non-type keywords, and grammatical exceptions caused by unknown logical structures; 针对每一种异常类型的异常,确定所述异常类型对应的异常解决方案;For each exception type of exception, determine the exception solution corresponding to the exception type; 根据每一种异常解决方案,更新所述缺陷检测工具中的语言分析器,其中所述语言分析器至少包括词法分析器和语法分析器。According to each exception solution, the language analyzer in the defect detection tool is updated, wherein the language analyzer includes at least a lexical analyzer and a syntax analyzer. 2.根据权利要求1所述的方法,其特征在于,在所述异常类型为类型关键字和未知自定义类型引起的词法异常的情况下,针对类型关键字和未知自定义类型引起的词法异常,确定的异常解决方案为:2. The method according to claim 1, wherein, in the case that the exception type is a lexical exception caused by a type keyword and an unknown custom type, the lexical exception caused by the type keyword and the unknown custom type is , the determined exception solution is: 针对类型关键字和未知自定义类型引起的词法异常,在声明语句的推导关系中添加针对所述词法分析器不能识别的字符串的声明,其中,声明的所述字符串的类型名称与类型符号相同。For lexical exceptions caused by type keywords and unknown custom types, add a declaration for the string that is not recognized by the lexical analyzer in the deduction relationship of the declaration statement, where the type name and type symbol of the declared string are same. 3.根据权利要求1所述的方法,其特征在于,在所述异常类型为非类型关键字引起的词法异常的情况下,针对非类型关键字引起的词法异常,确定的异常解决方案为:3. The method according to claim 1, wherein, in the case that the abnormal type is a lexical abnormality caused by a non-type keyword, for the lexical abnormality caused by a non-type keyword, the determined abnormal solution is: 针对非类型关键字引起的词法异常,在词法分析过程中,忽略所述词法分析器不能识别的字符串的词法分析。For lexical exceptions caused by non-type keywords, in the lexical analysis process, the lexical analysis of character strings that cannot be recognized by the lexical analyzer is ignored. 4.根据权利要求1所述的方法,其特征在于,在所述异常类型为未知逻辑结构引起的语法异常的情况下,针对未知逻辑结构引起的语法异常,确定的异常解决方案为:4. method according to claim 1, is characterized in that, under the situation that described abnormal type is the grammatical abnormality that unknown logical structure causes, for the grammatical abnormality that unknown logical structure causes, the definite abnormal solution is: 针对所述语法分析器不能识别的每一条语句,判断删除当前语句的第一个词后,所述语法分析器是否能识别当前语句;For each statement that cannot be recognized by the grammatical analyzer, determine whether the grammatical analyzer can recognize the current statement after deleting the first word of the current statement; 如果否,继续执行判断删除当前语句的第一个词后,所述语法分析器是否能识别当前语句的操作步骤。If not, continue to execute the operation step of judging whether the syntax analyzer can recognize the current sentence after deleting the first word of the current sentence. 5.一种缺陷检测工具更新装置,其特征在于,所述装置包括:5. A defect detection tool update device, characterized in that the device comprises: 划分模块,用于根据待测试工程中异常出现的位置和时机,将异常划分为至少一种异常类型,其中,所述异常类型包括:The division module is used to divide the abnormality into at least one abnormality type according to the location and timing of the abnormality in the project to be tested, wherein the abnormality type includes: 类型关键字和未知自定义类型引起的词法异常、非类型关键字引起的词法异常和未知逻辑结构引起的语法异常;Lexical exceptions caused by type keywords and unknown custom types, lexical exceptions caused by non-type keywords, and grammatical exceptions caused by unknown logical structures; 确定模块,用于针对每一种异常类型的异常,确定所述异常类型对应的异常解决方案;A determination module, configured to determine the abnormal solution corresponding to the abnormal type for each abnormal type of abnormality; 更新模块,用于根据每一种异常解决方案,更新所述缺陷检测工具中的语言分析器,其中所述语言分析器至少包括词法分析器和语法分析器。The updating module is used for updating the language analyzer in the defect detection tool according to each abnormal solution, wherein the language analyzer includes at least a lexical analyzer and a syntax analyzer. 6.根据权利要求5所述的装置,其特征在于,在所述异常类型为类型关键字和未知自定义类型引起的词法异常的情况下,所述确定模块,具体用于:6. The device according to claim 5, wherein, in the case that the abnormal type is a lexical abnormality caused by a type keyword and an unknown self-defined type, the determining module is specifically used for: 将在声明语句的推导关系中添加针对所述词法分析器不能识别的字符串的声明,确定为与类型关键字和未知自定义类型引起的词法异常对应的异常解决方案;其中,声明的所述字符串的类型名称与类型符号相同。A declaration for a string that cannot be recognized by the lexical analyzer will be added to the derivation relationship of the declaration statement, and it is determined as an exception solution corresponding to the lexical exception caused by the type keyword and unknown custom type; wherein, the declared The type name of a string is the same as the type symbol. 7.根据权利要求5所述的装置,其特征在于,在所述异常类型为非类型关键字引起的词法异常的情况下,所述确定模块,具体用于:7. The apparatus according to claim 5, wherein, in the case that the exception type is a lexical exception caused by a non-type keyword, the determining module is specifically configured to: 将在词法分析过程中,忽略所述词法分析器不能识别的字符串的词法分析,确定为与非类型关键字引起的词法异常对应的异常解决方案。In the process of lexical analysis, ignoring the lexical analysis of the character string that cannot be recognized by the lexical analyzer is determined as the abnormal solution corresponding to the lexical abnormality caused by the non-type keyword. 8.根据权利要求5所述的装置,其特征在于,在所述异常类型为未知逻辑结构引起的语法异常的情况下,所述确定模块,具体用于:8. The device according to claim 5, wherein, in the case that the abnormal type is a grammatical abnormality caused by an unknown logical structure, the determining module is specifically used for: 将针对所述语法分析器不能识别的每一条语句,判断删除当前语句的第一个词后,所述语法分析器是否能识别当前语句;如果否,继续执行判断删除当前语句的第一个词后,所述语法分析器是否能识别当前语句,确定为与未知逻辑结构引起的语法异常对应的异常解决方案。For each statement that the syntax analyzer cannot recognize, after judging to delete the first word of the current statement, whether the syntax analyzer can identify the current statement; if not, continue to execute the judgment to delete the first word of the current statement Then, whether the syntax analyzer can identify the current sentence is determined as an exception solution corresponding to the syntax exception caused by the unknown logical structure.
CN201610390646.4A 2016-06-06 2016-06-06 A method and device for updating a defect detection tool Active CN106020913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610390646.4A CN106020913B (en) 2016-06-06 2016-06-06 A method and device for updating a defect detection tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610390646.4A CN106020913B (en) 2016-06-06 2016-06-06 A method and device for updating a defect detection tool

Publications (2)

Publication Number Publication Date
CN106020913A CN106020913A (en) 2016-10-12
CN106020913B true CN106020913B (en) 2019-06-14

Family

ID=57090751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610390646.4A Active CN106020913B (en) 2016-06-06 2016-06-06 A method and device for updating a defect detection tool

Country Status (1)

Country Link
CN (1) CN106020913B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304991A (en) * 2017-12-28 2018-07-20 研祥智能科技股份有限公司 Product defects management method, device, computer equipment and storage medium
CN109977022B (en) * 2019-04-03 2023-01-10 网易(杭州)网络有限公司 Game resource checking method, device, system and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7062760B2 (en) * 2000-06-23 2006-06-13 Nec Corporation System and method for measuring syntax coverage percentage
CN101399710A (en) * 2007-09-29 2009-04-01 北京启明星辰信息技术有限公司 Detection method and system for protocol format exception
CN102681932A (en) * 2012-01-19 2012-09-19 于秀山 Method for detecting processing correctness of software on abnormal input
CN103218299A (en) * 2013-05-17 2013-07-24 网宿科技股份有限公司 Automatic generating method and system of optimized ant colony algorithm test case
CN103227734A (en) * 2013-04-27 2013-07-31 华南理工大学 Method for detecting abnormity of OpenStack cloud platform
CN103559447A (en) * 2013-11-15 2014-02-05 北京奇虎科技有限公司 Detection method, detection device and detection system based on virus sample characteristics
CN104077371A (en) * 2014-06-24 2014-10-01 用友优普信息技术有限公司 Method and system for monitoring abnormal data of database

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823694A (en) * 2014-02-10 2014-05-28 深圳市同洲电子股份有限公司 Method and device for updating script file
CN104536883B (en) * 2014-12-05 2017-06-16 北京邮电大学 A kind of static defect detection method and its system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7062760B2 (en) * 2000-06-23 2006-06-13 Nec Corporation System and method for measuring syntax coverage percentage
CN101399710A (en) * 2007-09-29 2009-04-01 北京启明星辰信息技术有限公司 Detection method and system for protocol format exception
CN102681932A (en) * 2012-01-19 2012-09-19 于秀山 Method for detecting processing correctness of software on abnormal input
CN103227734A (en) * 2013-04-27 2013-07-31 华南理工大学 Method for detecting abnormity of OpenStack cloud platform
CN103218299A (en) * 2013-05-17 2013-07-24 网宿科技股份有限公司 Automatic generating method and system of optimized ant colony algorithm test case
CN103559447A (en) * 2013-11-15 2014-02-05 北京奇虎科技有限公司 Detection method, detection device and detection system based on virus sample characteristics
CN104077371A (en) * 2014-06-24 2014-10-01 用友优普信息技术有限公司 Method and system for monitoring abnormal data of database

Also Published As

Publication number Publication date
CN106020913A (en) 2016-10-12

Similar Documents

Publication Publication Date Title
AU2010350247B2 (en) Code inspection executing system for performing a code inspection of ABAP source codes
CN107273286B (en) Scene automatic test platform and method for task application
CN105094783B (en) method and device for testing stability of android application
US8683449B2 (en) Automated parallel software code impact analysis
CN109446078B (en) Code testing method and device, storage medium and electronic equipment
CN105867990A (en) Software development integration method and device thereof
CN105912458A (en) Method and system for dynamically detecting C/C++ memory leak
CN103019722B (en) A kind of method and device extracting Java network application AKU
CN108549538A (en) A kind of code detection method, device, storage medium and test terminal
CN107015841B (en) Preprocessing method for program compiling and program compiling device
CN107038380A (en) A kind of leak detection method and system based on performance of program tree
US9311077B2 (en) Identification of code changes using language syntax and changeset data
CN105389262A (en) Method and device for generating test suggestions in allusion to interface tests
CN114116471A (en) Automatic code scanning method, system, electronic equipment and storage medium
CN108809755B (en) Automatic testing method and system for home gateway compatible with command line and WEB interface
JP2021002326A (en) Refinement of repair patterns for static analysis violations in software programs
CN102819490A (en) Method and system for software testing based on given defect description information
CN113010431B (en) Java unit test case generation method and device
CN106020913B (en) A method and device for updating a defect detection tool
EP2107484A2 (en) A method and device for code audit
CN111090454B (en) Automatic processing method, device and equipment based on ODB
JP2010140408A (en) Source code converting device
CN108897678B (en) Static code detection method, static code detection system, storage device
CN118567699B (en) Component version upgrading method, device, equipment and medium
Oliveira et al. SNUTS. js: Sniffing Nasty Unit Test Smells in Javascript

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant