WO2016085272A1 - Method for reducing false alarms in detecting source code error, computer program therefor, recording medium thereof - Google Patents

Method for reducing false alarms in detecting source code error, computer program therefor, recording medium thereof Download PDF

Info

Publication number
WO2016085272A1
WO2016085272A1 PCT/KR2015/012791 KR2015012791W WO2016085272A1 WO 2016085272 A1 WO2016085272 A1 WO 2016085272A1 KR 2015012791 W KR2015012791 W KR 2015012791W WO 2016085272 A1 WO2016085272 A1 WO 2016085272A1
Authority
WO
WIPO (PCT)
Prior art keywords
alarm
error detection
source code
information
equation
Prior art date
Application number
PCT/KR2015/012791
Other languages
French (fr)
Korean (ko)
Inventor
윤종원
진민식
Original Assignee
주식회사 파수닷컴
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
Priority claimed from KR1020150011094A external-priority patent/KR101694778B1/en
Application filed by 주식회사 파수닷컴 filed Critical 주식회사 파수닷컴
Publication of WO2016085272A1 publication Critical patent/WO2016085272A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention relates to a method for reducing false alarms in error detection of a source code, a computer program for the same, and a recording medium thereof, despite the fact that there is no error in the analysis target source code in error detection of the source code using a static analyzer.
  • a method for reducing the false alarm, a computer program therefor, and a recording medium thereof It is about.
  • Static analyzers are widely used to detect potential bugs or vulnerabilities in source code.
  • the static analyzer detects a predefined error for each checker by executing checkers for each function, and generates an alarm message for determining that the error is detected.
  • the present invention has been made in view of the above-described conventional problems, and in the error detection of the source code using a static analyzer, even though there is no error in the source code to be analyzed, the false alarm (wrongly determined to exist)
  • a computer program, and a recording medium thereof for detecting errors in the source code that can reduce false alarms and prevent waste of resources for reviewing and processing false alarms. do.
  • a method for reducing the false alarm of the error detection alarm that is executed in the static alarm analysis device interlocked with the static analyzer, 1) generated error detection Receiving alarm type information, alarm path information, and source code information targeted for an alarm, wherein the alarm type information is set to any one of preset alarm types.
  • the alarm path information is information about an execution path associated with the generated error detection alarm among execution paths of source code; 2) converting the source code into an abstract syntax tree (AST); 3) removing an unnecessary subtree not associated with the error detection alert from the abstract syntax tree; 4) obtaining a feature vector for the abstract syntax tree from which unnecessary subtrees have been removed based on a set of feature patterns preset for the alert type of the error detection alert; And 5) classifying false alarms by inputting the obtained feature vector into a classifier in which false alarm classification information has been learned in advance.
  • AST abstract syntax tree
  • the present invention is characterized in that it further comprises the step 6) deleting the error detection alarm classified as a false alarm in step 5) from the error detection alarm target of the static analyzer in the corresponding alarm type. .
  • the removal of the unnecessary subtree comprises a first policy for removing general syntax other than the syntax executed on the execution path associated with the error detection alert, and associated with the error detection alert.
  • the feature pattern set is configured in the form of a set of n feature patterns preset for a specific alert type of the error detection alert, wherein the feature pattern includes: conditional statement generation, loop statement generation, Occurrence of return statement, occurrence of break or continue statement, occurrence of exit or assert method invocation, occurrence of null expression, comparison with null value (comparisons with a null value, null assignments, or statements that return a null value.
  • step 4 the process of obtaining the feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed may be performed.
  • j) defining a feature pattern set P composed of a set form of n feature patterns p, as shown in Equation 1 below;
  • i th feature pattern (p i ) can be a single node or a subtree
  • V (P, d 1 ) ... V (P, d m ) is a feature vector obtained through Equation 4 for the child nodes d 1 , ..., d m ,
  • v (P, D) is an n-dimensional pattern satisfaction vector for any node D)
  • Equation 5 obtaining a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed.
  • R is a root node of the abstract syntax tree from which the unnecessary subtree is removed and corresponds to node D of Equation 4,
  • the classifier of step 5) is a support vector machine (SVM), characterized in that it is generated for each alarm type for the error detection alert.
  • SVM support vector machine
  • a computer program stored in a medium to be combined with hardware to execute a method for reducing false alarms in error detection of the source code is disclosed.
  • a computer-readable recording medium having a computer program recorded therein for executing a method for reducing false alarms in a computer in detecting an error of the source code is disclosed.
  • the present invention in the error detection of the source code using the static analyzer, even if there is no error in the analysis target source code, it is possible to reduce the false alarm (false alarm) which is wrongly determined that the error exists, Accordingly, there is an advantage that it is possible to prevent the waste of resources required for the review and processing of false alarms.
  • the present invention has the advantage of classifying false alarms using structural features of a source code in which an error alarm is generated, thereby improving accuracy of false alarm classification.
  • FIG. 1 is a conceptual diagram illustrating a method for reducing false alarm in error detection of source code according to an exemplary embodiment of the present invention.
  • first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another.
  • the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component.
  • FIG. 1 is a conceptual diagram illustrating a method for reducing false alarm in error detection of source code according to an exemplary embodiment of the present invention.
  • the invention of the present embodiment is executed in a false alarm reduction device interoperating with a static analyzer, and is a method for reducing false alarms among error detection alarms generated in the static analyzer.
  • the false alarm reducing apparatus may be understood as a computing means or a functional module for executing the false alarm reducing method, and may be implemented in the form of an interlocking module or an internal module in the static analyzer.
  • the false alarm reduction apparatus of this embodiment is interlocked with various known static analyzers.
  • the static analyzer has been known a variety of commercial products of the grammar-based (Syntactic) analysis or semantic analysis method, the detailed description thereof will be omitted.
  • the false alarm reducing device receives alarm type information, alarm path information, and source code information targeted for an alarm regarding an error detection alarm that has occurred.
  • the input may be based on an input request of a false alarm reducing device or a setting of a static analyzer, and a static analyzer linked to the false alarm reducing device may provide the respective information to the false alarm reducing device, or in another example,
  • the recorded file can be made by the user inputting the false alarm reduction device to be readable.
  • the alarm type information is information on which type of an error detection alarm has occurred which corresponds to a preset alarm type
  • the alarm path information is information on an execution path related to the error detection alarm which has occurred in an execution path of source code.
  • the static analyzer detects whether an analysis target source code is error based on a predetermined criterion for each checker by executing checkers for each function, and generates a specific alarm for determining that an error is detected.
  • the alarm is made by outputting a specific alarm message preset to the checker with respect to the detected error.
  • Each alert message is basically dependent on a specific checker, and generally does not reflect the nature or form of the source code, or features on the execution path.
  • One 'alarm type' has the same alarm message. For example, one checker generates one alert message and can be understood to define one 'alarm type'.
  • the 'alarm type' may include 'general null dereference', 'dereferencing of an unchecked null value', and 'dereferencing of a returned null value', and the like, and various alarm types may be set.
  • a feature pattern set to be described below is defined for each alarm type.
  • the false alarm reduction apparatus converts the source code into an abstract syntax tree (AST).
  • AST abstract syntax tree
  • An abstract syntax tree is a tree of abstract syntax structures in source code written in a programming language, where each node represents a structure generated from the source code. Detailed concepts of the abstract syntax tree may be understood through a number of known materials, and thus detailed descriptions thereof will be omitted.
  • step S3 the false alarm reduction apparatus removes an unnecessary subtree not associated with the error detection alert from the abstract syntax tree.
  • Elimination of unnecessary subtrees can be accomplished by conventional rule-based techniques.
  • the removal of the unnecessary subtree may include a first policy for removing general syntax other than the syntax executed on the execution path associated with the error detection alert, and a branch executed on the execution path associated with the error detection alert.
  • step S4 the false alarm reducing apparatus obtains a feature vector for the abstract syntax tree from which an unnecessary subtree is removed, based on a set of feature patterns preset for the alarm type of the error detection alert.
  • the abstract syntax tree (AST) obtained from the source code is too large and complex to use as input data for classification of false alarms through a classifier.
  • AST abstract syntax tree
  • the feature pattern set is configured in the form of a set of n feature patterns preset for a specific alert type of the error detection alert, and the feature pattern includes: condition statement generation, loop statement generation, return statement generation, and break ( break or continue statement occurrences, exit or assert method invocations, null expressions, comparisons with a null value, Null assignments can occur, or statements that return null values can occur. This is summarized as follows.
  • step S4 a process of obtaining a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed is performed as follows.
  • the false alarm reducing apparatus defines a feature pattern set P configured in the form of a set of n feature patterns p, as shown in Equation 1 below, for the alert type j of the error detection alert. .
  • the false alarm reducing apparatus defines an n-dimensional pattern satisfaction vector v (P, d) for any node d on the abstract syntax tree, as shown in Equation 2 below.
  • i th feature pattern (p i ) can be a single node or a subtree
  • the false alarm reduction apparatus defines a feature vector V (P, D) for any node D on the abstract syntax tree, as shown in Equation 4 below.
  • V (P, d 1 ) ... V (P, d m ) is a feature vector obtained through Equation 4 for the child nodes d 1 , ..., d m ,
  • v (P, D) is an n-dimensional pattern satisfaction vector for any node D)
  • the apparatus for reducing false alarms obtains a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed using Equation 5 below.
  • R is a root node of the abstract syntax tree from which the unnecessary subtree is removed and corresponds to node D of Equation 4,
  • Equation 5 may be understood as an arbitrary node D of Equation 4 obtained by inputting a root node R of the abstract syntax tree from which an unnecessary subtree is removed.
  • step S5 the false alarm reducing device classifies the false alarm by inputting the obtained feature vector into a classifier in which false alarm classification information has been learned in advance.
  • step S5 the feature vector (V j (R)) obtained in the step S404 is input to the classifier that false alarm classification information has been learned in advance to classify the false alarm.
  • Learning of the classifier corresponds to, for example, a specific alarm type for which a classifier is to be generated, and inputs a feature vector of a plurality of learning error detection alerts in advance to the classifier that knows whether there is a false alarm / normal alert, and the learning error detection alert
  • the classifier may be trained based on a known machine learning technique based on information on whether a false alarm / normal alarm is detected and information on a feature pattern thereof.
  • a classifier learning is performed for each alarm type. For example, inputting the feature vector to the classifier in advance may be performed by inputting a source code that knows whether there is a false alarm / normal alarm and an alarm type for the source code.
  • the classifier is a support vector machine (SVM) classifier, and the SVM classifier is generated for each alarm type related to an error detection alert.
  • SVM support vector machine
  • a mapping transformation process using a kernel function may be included to classify the nonlinear feature vectors.
  • the SVM (Support Vector Machine) classifier may be configured as follows. Corresponding to k alarm types, k classifier models M 1 , M 2 ,..., M k can be generated.
  • the SVM classifier maps the i-th type of input data V i (R i1 ), ..., V i (R in ) from the input space X into the high-dimensional feature space F, and the maximum margin ( margin) Returns the hyperplane.
  • y j is a label of the j th training data V i (R ij ) and has a value of either '1' (true) or '-1' (false),
  • K is a kernel function to simplify nonlinear mapping
  • Equation 7 shows an optimal hyperplane corresponding to the model M i of the i-th type.
  • This classifier configuration allows the model M j to be used when a new alarm of type j is entered.
  • the training of the model for classifying alerts may be applied to known techniques including LIBSVM.
  • LIBSVM The configuration of LIBSVM is described in "LIBSVM: A Library for Support Vector Machines," (ACM Transactions on Intelligent Systems and Technology, vol. 2, no. 3, pp. 1-39, 2011., C. Chang and C. Lin), etc. Can be referenced through.
  • the classification result by the classifier is, for example, a classification result of the SVM classifier, a label having a value of '1' when classified as a normal alarm instead of a false alarm, and a value having a value of '-1' when classified as a false alarm. This can be done by printing
  • a known machine learning classifier implemented in a manner other than the SVM classifier may be used.
  • step S6 the false alarm reducing device deletes the error detection alarm classified as false alarm in step S5 from the error detection alarm object of the static analyzer of the corresponding alarm type.
  • deletion processing may be automatically performed based on a preset criterion in the false alarm reduction apparatus.
  • a user may check an error detection alarm classified as a false alarm and receive a deletion command.
  • an error detection alarm classified as a false alarm may be prevented from occurring during a source code analysis process of the static analyzer after the deletion, and as a result, a false alarm may be reduced.
  • the final deletion process may be configured to further provide a probability information value for the result value together with the classification result value, and a threshold ⁇ may be set in the probability information value. In this way, more validity can be given to the final deletion classification result.
  • a specific error detection alarm when classified as a false alarm, it may be configured to be determined as a real false alarm only when the probability information value provided with the classification result value is higher than a preset threshold.
  • Increasing the threshold increases the accuracy of false alarm classifications, but may increase the chance of false alarms not being classified as false alarms, and lowering the threshold increases the probability of a normal alarm being classified as a false alarm. It is desirable to set the threshold appropriately in consideration of various situations such as the number of alarms and the trade-off of accuracy.
  • Probability information values are provided in "Probability Estimates for Multi-class Classification by Pairwise Coupling," The Journal of Machine Learning Research, vol. 5, pp. 975-1005, 2004., T. Wu et al. It can be achieved through known techniques, including.
  • the false alarm reduction method according to the present embodiment was tested for the alarm generated from the commercial static analyzer (SPARROW) proposed by the applicant.
  • Test subject alerts were provided from 10 Java open source code. Each source code consists of 213 to 3,398 files and 15,037 to 292,967 lines. A total of 265 alerts were obtained from these source codes.
  • the feature pattern As the feature pattern, the feature patterns illustrated in Table 1 above were used.
  • Embodiments of the present invention include a program for performing various computer-implemented operations and a computer readable medium recording the same.
  • the computer readable medium may include program instructions, data files, data structures, etc. alone or in combination.
  • the media may be those specially designed and constructed for the purposes of the present invention, or they may be of the kind well-known and available to those having skill in the computer software arts.
  • Examples of computer readable recording media include magnetic media such as hard disks, floppy disks and magnetic tape, optical recording media such as CD-ROM, DVD, USB drives, magnetic-optical media such as floppy disks, and ROM, RAM, Hardware devices specifically configured to store and execute program instructions, such as flash memory, are included.
  • the medium may be a transmission medium such as an optical or metal wire, a waveguide, or the like including a carrier wave for transmitting a signal specifying a program command, a data structure, or the like.
  • program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a method for reducing false alarms in detecting a source code error, a computer program therefor, and a recording medium thereof. The method for reducing false alarms, according to one aspect of the present invention, is executed on a false alarm reduction device connected to a static analyzer and is for reducing false alarms among error detection alarms occurring on the static analyzer, and disclosed is a method for reducing false alarms in detecting a source code error, the method comprising the steps of: 1) receiving input on information on error detection alarms that occurred, the information being information on alarm type, information on alarm path, and information on the source code which is the subject of the alarm, wherein the information on alarm type is information on what type, among pre-set alarm types, the error detection alarms that occurred correspond to, and the information on alarm path is information on the execution path, among execution paths of the source code, related to the error detection alarms that occurred; 2) converting the source code into an abstract syntax tree (AST); 3) removing, from the AST, unnecessary subtrees that are not related to the error detection alarms; 4) on the basis of a feature pattern set that is pre-set with respect to the alarm type of the error detection alarms, obtaining a feature vector on the AST having unnecessary subtrees removed therefrom; and 5) classifying false alarms by inputting the obtained feature vector in a classifier that has learned false alarm classification information beforehand.

Description

소스 코드의 오류 검출에 있어서 오경보 저감 방법, 이를 위한 컴퓨터 프로그램, 그 기록매체False alarm reduction method in error detection of source code, computer program therefor, recording medium thereof
본 발명은 소스 코드의 오류 검출에 있어서 오경보 저감 방법, 이를 위한 컴퓨터 프로그램, 그 기록매체에 관한 것으로서, 정적분석기를 이용한 소스 코드의 오류 검출에 있어서 분석 대상 소스 코드에 오류가 존재하지 않음에도 불구하고 오류가 존재하는 것으로 잘못 판단하는 오경보를 저감시켜, 오경보의 검토 및 처리에 소요되는 리소스의 낭비를 방지할 수 있도록 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법, 이를 위한 컴퓨터 프로그램, 그 기록매체에 관한 것이다. The present invention relates to a method for reducing false alarms in error detection of a source code, a computer program for the same, and a recording medium thereof, despite the fact that there is no error in the analysis target source code in error detection of the source code using a static analyzer. In the error detection method of the source code to reduce the false alarm which misjudges that an error exists and to prevent the waste of resources for review and processing of the false alarm, a method for reducing the false alarm, a computer program therefor, and a recording medium thereof It is about.
소스 코드에 존재하는 잠재적인 오류(bug)나 취약점을 발견하기 위해 정적분석기가 널리 사용된다. 정적분석기는 각 기능별 체커의 실행에 의해 각 체커별로 미리 정의된 오류를 검출하고, 오류가 검출된 것으로 판단하면 이에 대한 경보(alarm) 메시지를 발생한다. Static analyzers are widely used to detect potential bugs or vulnerabilities in source code. The static analyzer detects a predefined error for each checker by executing checkers for each function, and generates an alarm message for determining that the error is detected.
그러나, 이러한 정적분석기의 분석 과정에서 오류 여부의 판단이 항상 정확하게 이뤄지지 못하는 것이 현실이며, 이로 인해 분석 대상 소스 코드에 오류가 존재하지 않음에도 불구하고 오류가 존재하는 것으로 잘못 판단하여 오경보(false alarm)를 발생하는 문제가 존재하였다. However, in the analysis process of the static analyzer, it is a fact that the determination of an error is not always made correctly. As a result, an error is falsely determined as an error exists even though an error does not exist in the target source code. There was a problem occurring.
일반적으로 소스 코드의 오류 검출 경보가 발생되면, 오류를 검토 및 처리하기 위해 다양한 리소스가 투입되어야 하므로, 이러한 오경보는 프로그램 개발 및 검수 과정에서 다양한 리소스의 낭비 요인이 되었다. In general, when an error detection alarm of a source code is generated, various resources have to be invested in reviewing and dealing with errors. Thus, such a false alarm has been a waste of various resources during program development and inspection.
본 발명은 상기와 같은 종래의 문제점을 감안하여 안출한 것으로서, 정적분석기를 이용한 소스 코드의 오류 검출에 있어서 분석 대상 소스 코드에 오류가 존재하지 않음에도 불구하고 오류가 존재하는 것으로 잘못 판단하는 오경보(false alarm)를 저감시켜, 오경보의 검토 및 처리에 소요되는 리소스의 낭비를 방지할 수 있도록 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법, 이를 위한 컴퓨터 프로그램, 그 기록매체를 제공하는 것을 그 목적으로 한다. The present invention has been made in view of the above-described conventional problems, and in the error detection of the source code using a static analyzer, even though there is no error in the source code to be analyzed, the false alarm (wrongly determined to exist) To provide a false alarm reduction method, a computer program, and a recording medium thereof for detecting errors in the source code that can reduce false alarms and prevent waste of resources for reviewing and processing false alarms. do.
상기와 같은 목적을 달성하기 위한 본 발명의 일측면에 따르면, 정적분석기와 연동하는 오경보 저감 장치에서 실행되며, 정적분석기에서 발생하는 오류 검출 경보 중 오경보를 저감시키기 위한 방법으로서, 1) 발생한 오류 검출 경보에 관한 경보 타입(alarm types) 정보, 경보 경로(alarm path) 정보 및 경보의 대상이 된 소스 코드 정보를 입력받는 단계- 상기 경보 타입 정보는 발생한 오류 검출 경보가 미리 설정된 경보 타입 중에서 어느 타입에 해당하는지에 관한 정보이며, 상기 경보 경로 정보는 소스 코드의 실행 경로 중에서 상기 발생한 오류 검출 경보와 관련된 실행 경로에 관한 정보임-; 2) 상기 소스 코드를 추상 구문 트리(abstract syntax tree, AST)로 변환하는 단계; 3) 상기 추상 구문 트리에서 상기 오류 검출 경보와 관련되지 않은 불요 서브트리(unnecessary subtree)를 제거하는 단계; 4) 상기 오류 검출 경보의 경보 타입에 대하여 미리 설정된 피쳐 패턴 세트에 근거하여, 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터를 수득하는 단계; 및 5) 수득된 상기 피쳐 벡터를 오경보 분류 정보가 미리 학습된 분류기에 입력하여 오경보를 분류하는 단계;를 포함하여 구성된 소스 코드의 오류 검출에 있어서 오경보 저감 방법이 개시된다. According to an aspect of the present invention for achieving the above object, a method for reducing the false alarm of the error detection alarm that is executed in the static alarm analysis device interlocked with the static analyzer, 1) generated error detection Receiving alarm type information, alarm path information, and source code information targeted for an alarm, wherein the alarm type information is set to any one of preset alarm types. Information corresponding to the corresponding information, wherein the alarm path information is information about an execution path associated with the generated error detection alarm among execution paths of source code; 2) converting the source code into an abstract syntax tree (AST); 3) removing an unnecessary subtree not associated with the error detection alert from the abstract syntax tree; 4) obtaining a feature vector for the abstract syntax tree from which unnecessary subtrees have been removed based on a set of feature patterns preset for the alert type of the error detection alert; And 5) classifying false alarms by inputting the obtained feature vector into a classifier in which false alarm classification information has been learned in advance.
바람직하게, 본 발명은, 6) 상기 5) 단계에서 오경보로 분류된 오류 검출 경보를, 해당 경보 타입에 있어서의 정적분석기의 오류 검출 경보 대상에서 삭제하는 단계;를 더욱 포함하여 구성된 것을 특징으로 한다. Preferably, the present invention is characterized in that it further comprises the step 6) deleting the error detection alarm classified as a false alarm in step 5) from the error detection alarm target of the static analyzer in the corresponding alarm type. .
바람직하게, 상기 3) 단계에서, 상기 불요 서브트리(unnecessary subtree)의 제거는, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 구문을 제외한 다른 일반 구문을 제거하는 제1 정책과, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 분기문이 아닌 다른 분기문을 제거하는 제2 정책과- 단, 오류 검출 경보와 관련된 실행 경로는 분기문의 조건 판별 결과를 포함함-, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 반복문이 아닌 다른 반복문을 제거하는 제3 정책과, 오류 검출 경보와 관련된 실행 경로 상에서 호출된 함수 및 상기 함수의 실행 경로를 상기 함수를 호출하는 노드의 서브트리로 포함하는 제4 정책과, 오류 검출 경보와 관련된 실행 경로와 관계 없는 선언문을 제거하는 제5 정책 중의 적어도 어느 하나의 정책에 근거하여 이뤄지는 것을 특징으로 한다. Preferably, in step 3), the removal of the unnecessary subtree comprises a first policy for removing general syntax other than the syntax executed on the execution path associated with the error detection alert, and associated with the error detection alert. A second policy for removing branch statements other than those executed on the execution path, provided that the execution path associated with the error detection alert includes the result of condition determination of the branch statement; A third policy for removing loops other than loops, a fourth policy including a function called on an execution path associated with an error detection alert, and an execution path of the function as a subtree of a node invoking the function, and error detection Is based on at least one of the fifth policies for removing declarations that are not relevant to the path of execution associated with the alert. It features.
바람직하게, 상기 4) 단계에서, 상기 피쳐 패턴 세트는, 상기 오류 검출 경보의 특정 경보 타입에 대하여 미리 설정된 n 개의 피쳐 패턴의 세트 형태로 구성되며, 상기 피처 패턴은, 조건문 발생, 루프문 발생, 리턴문 발생, 브레이크(break) 또는 컨티뉴(continue)문 발생, 엑시트(exit) 또는 어서트(assert) 메소드 호출(method invocation) 발생, 널 표현(null expression) 발생, 널 값과의 비교(comparisons with a null value) 발생, 널 할당(null assignments) 발생, 널 값을 리턴하는 문(statements)의 발생 중의 어느 하나인 것을 특징으로 한다. Preferably, in the step 4), the feature pattern set is configured in the form of a set of n feature patterns preset for a specific alert type of the error detection alert, wherein the feature pattern includes: conditional statement generation, loop statement generation, Occurrence of return statement, occurrence of break or continue statement, occurrence of exit or assert method invocation, occurrence of null expression, comparison with null value (comparisons with a null value, null assignments, or statements that return a null value.
바람직하게, 상기 4) 단계에서, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))의 수득 과정은, 401) 상기 오류 검출 경보의 경보 타입(j)에 대하여, 하기 수학식1과 같이, n 개의 피쳐 패턴(p)의 세트 형태로 구성된 피쳐 패턴 세트(P)를 정의하는 단계; Preferably, in step 4), the process of obtaining the feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed may be performed. j) defining a feature pattern set P composed of a set form of n feature patterns p, as shown in Equation 1 below;
[수학식1][Equation 1]
P = {p1, p2, ..., pn}P = {p 1 , p 2 , ..., p n }
402) 하기 수학식2와 같이, 추상 구문 트리 상의 임의의 노드 d에 대한 n 차원의 패턴 만족 벡터(v(P,d))를 정의하는 단계; 402) defining an n-dimensional pattern satisfaction vector v (P, d) for any node d on the abstract syntax tree as shown in Equation 2 below;
[수학식2][Equation 2]
Figure PCTKR2015012791-appb-I000001
Figure PCTKR2015012791-appb-I000001
(단, S(d,pi)는 임의의 노드 d 또는 노드 d를 루트로 하는 서브트리가 i 번째 피쳐 패턴(pi)에 매칭되는지 여부를 나타내는 인자로서, 하기 수학식3과 같이 정의되며, i 번째 피쳐 패턴(pi)은 단일 노드 또는 서브트리일 수 있음(Where S (d, p i ) is a factor indicating whether an arbitrary node d or a subtree rooted at node d matches the i th feature pattern p i , and is defined as in Equation 3 below. , i th feature pattern (p i ) can be a single node or a subtree
[수학식3][Equation 3]
Figure PCTKR2015012791-appb-I000002
)
Figure PCTKR2015012791-appb-I000002
)
403) 하기 수학식4와 같이, 추상 구문 트리 상의 임의의 노드 D에 대한 피쳐 벡터(V(P,D))를 정의하는 단계; 및 403) defining a feature vector V (P, D) for any node D on the abstract syntax tree, as shown in Equation 4 below; And
[수학식4][Equation 4]
Figure PCTKR2015012791-appb-I000003
Figure PCTKR2015012791-appb-I000003
(단, d1,...,dm은 임의의 노드 D의 자식 노드들이며, (Where d 1 , ..., d m are children of any node D,
V(P,d1)...V(P,dm) 는 자식 노드 d1,...,dm에 대하여 상기 수학식4를 통해 구한 피쳐 벡터이며, V (P, d 1 ) ... V (P, d m ) is a feature vector obtained through Equation 4 for the child nodes d 1 , ..., d m ,
v(P,D)는 임의의 노드 D에 대한 n 차원의 패턴 만족 벡터임)v (P, D) is an n-dimensional pattern satisfaction vector for any node D)
404) 하기 수학식5를 이용하여, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))를 수득하는 단계;를 포함하여 구성된 것을 특징으로 한다. 404) using Equation 5 below, obtaining a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed.
[수학식5] [Equation 5]
Figure PCTKR2015012791-appb-I000004
Figure PCTKR2015012791-appb-I000004
(단, R은 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리의 루트 노드로서 상기 수학식4의 노드 D에 대응하며, R is a root node of the abstract syntax tree from which the unnecessary subtree is removed and corresponds to node D of Equation 4,
j는 발생한 오류 검출 경보에 관한 경보 타입을 나타내는 인자임)j is a factor indicating an alarm type for an error detection alarm that has occurred)
바람직하게, 상기 5) 단계의 분류기는 SVM(Support Vector Machine)이며, 오류 검출 경보에 관한 경보 타입 별로 생성되는 것을 특징으로 한다. Preferably, the classifier of step 5) is a support vector machine (SVM), characterized in that it is generated for each alarm type for the error detection alert.
본 발명의 또 다른 일측면에 따르면, 하드웨어와 결합되어 상기 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 실행시키기 위하여 매체에 저장된 컴퓨터 프로그램이 개시된다. According to yet another aspect of the present invention, a computer program stored in a medium to be combined with hardware to execute a method for reducing false alarms in error detection of the source code is disclosed.
본 발명의 또 다른 일측면에 따르면, 상기 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 컴퓨터에서 실행하기 위한 컴퓨터 프로그램이 기록된, 컴퓨터로 판독 가능한 기록 매체가 개시된다.According to yet another aspect of the present invention, a computer-readable recording medium having a computer program recorded therein for executing a method for reducing false alarms in a computer in detecting an error of the source code is disclosed.
이와 같은 본 발명에 따르면, 정적분석기를 이용한 소스 코드의 오류 검출에 있어서 분석 대상 소스 코드에 오류가 존재하지 않음에도 불구하고 오류가 존재하는 것으로 잘못 판단하는 오경보(false alarm)를 저감시킬 수 있으며, 이에 따라 오경보의 검토 및 처리에 소요되는 리소스의 낭비를 방지할 수 있다는 장점이 있다. According to the present invention, in the error detection of the source code using the static analyzer, even if there is no error in the analysis target source code, it is possible to reduce the false alarm (false alarm) which is wrongly determined that the error exists, Accordingly, there is an advantage that it is possible to prevent the waste of resources required for the review and processing of false alarms.
특히, 본 발명은, 오류 경보가 발생된 소스 코드의 구조적 특징을 이용하여 오경보 여부를 분류하므로, 오경보 분류의 정확도를 향상시킬 수 있다는 장점이 있다. In particular, the present invention has the advantage of classifying false alarms using structural features of a source code in which an error alarm is generated, thereby improving accuracy of false alarm classification.
도 1은 본 발명의 일실시예에 따른 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 설명하기 위한 개념도이다. 1 is a conceptual diagram illustrating a method for reducing false alarm in error detection of source code according to an exemplary embodiment of the present invention.
본 발명은 그 기술적 사상 또는 주요한 특징으로부터 벗어남이 없이 다른 여러가지 형태로 실시될 수 있다. 따라서, 본 발명의 실시예들은 모든 점에서 단순한 예시에 지나지 않으며 한정적으로 해석되어서는 안 된다.The present invention can be embodied in many other forms without departing from the spirit or main features thereof. Therefore, the embodiments of the present invention are merely examples in all respects and should not be interpreted limitedly.
제1, 제2 등의 용어는 다양한 구성요소들을 설명하는 데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes a combination of a plurality of related items or any item of a plurality of related items.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.
본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "구비하다", "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "comprise", "comprise", "have", and the like are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification. Or other features or numbers, steps, operations, components, parts or combinations thereof in any way should not be excluded in advance.
다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art, and are not construed in ideal or excessively formal meanings unless expressly defined in this application. Do not.
이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 대응하는 구성 요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings, and the same or corresponding components will be denoted by the same reference numerals regardless of the reference numerals and redundant description thereof will be omitted. In the following description of the present invention, if it is determined that the detailed description of the related known technology may obscure the gist of the present invention, the detailed description thereof will be omitted.
도 1은 본 발명의 일실시예에 따른 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 설명하기 위한 개념도이다. 1 is a conceptual diagram illustrating a method for reducing false alarm in error detection of source code according to an exemplary embodiment of the present invention.
본 실시예의 발명은, 정적분석기와 연동하는 오경보 저감 장치에서 실행되며, 정적분석기에서 발생하는 오류 검출 경보 중 오경보를 저감시키기 위한 방법이다. The invention of the present embodiment is executed in a false alarm reduction device interoperating with a static analyzer, and is a method for reducing false alarms among error detection alarms generated in the static analyzer.
일예로, 상기 오경보 저감 장치는 오경보 저감 방법을 실행하는 컴퓨팅 수단 또는 그 기능 모듈로 이해될 수 있으며, 정적분석기에 연동 모듈 형태로 구현되거나, 내부 모듈 형태로 구현될 수 있다. For example, the false alarm reducing apparatus may be understood as a computing means or a functional module for executing the false alarm reducing method, and may be implemented in the form of an interlocking module or an internal module in the static analyzer.
본 실시예의 오경보 저감 장치는 공지의 다양한 정적분석기와 연동한다. 일예로, 정적분석기는 문법기반(Syntactic) 분석 또는 의미기반(Semantic) 분석 방식의 다양한 상용 제품들이 공지된 바 있으며, 그 상세한 설명은 생략한다. The false alarm reduction apparatus of this embodiment is interlocked with various known static analyzers. For example, the static analyzer has been known a variety of commercial products of the grammar-based (Syntactic) analysis or semantic analysis method, the detailed description thereof will be omitted.
S1 단계에서, 오경보 저감 장치는, 발생한 오류 검출 경보에 관한 경보 타입(alarm type) 정보, 경보 경로(alarm path) 정보 및 경보의 대상이 된 소스 코드 정보를 입력받는다. 일예로, 상기 입력은 오경보 저감 장치의 입력 요청 또는 정적분석기의 설정에 근거하여, 오경보 저감 장치와 연동하는 정적분석기가 오경보 저감 장치로 상기 각 정보를 입력 제공하거나, 다른예로, 상기 각 정보가 기록된 파일을 사용자가 오경보 저감 장치가 독출 가능하도록 입력하는 방식으로 이뤄질 수 있다. In step S1, the false alarm reducing device receives alarm type information, alarm path information, and source code information targeted for an alarm regarding an error detection alarm that has occurred. For example, the input may be based on an input request of a false alarm reducing device or a setting of a static analyzer, and a static analyzer linked to the false alarm reducing device may provide the respective information to the false alarm reducing device, or in another example, The recorded file can be made by the user inputting the false alarm reduction device to be readable.
상기 경보 타입 정보는 발생한 오류 검출 경보가 미리 설정된 경보 타입 중에서 어느 타입에 해당하는지에 관한 정보이며, 상기 경보 경로 정보는 소스 코드의 실행 경로 중에서 상기 발생한 오류 검출 경보와 관련된 실행 경로에 관한 정보이다. The alarm type information is information on which type of an error detection alarm has occurred which corresponds to a preset alarm type, and the alarm path information is information on an execution path related to the error detection alarm which has occurred in an execution path of source code.
정적분석기는 각 기능별 체커의 실행에 의해 각 체커별로 미리 정의된 기준에 근거하여 분석 대상 소스 코드의 오류 여부를 검출하고, 오류가 검출된 것으로 판단하면 이에 대한 특정한 경보(alarm)를 발생한다. The static analyzer detects whether an analysis target source code is error based on a predetermined criterion for each checker by executing checkers for each function, and generates a specific alarm for determining that an error is detected.
이때, 상기 경보는 검출된 오류에 대하여 체커에 미리 설정된 특정 경보 메시지를 출력하는 방식으로 이뤄진다. 각 경보 메시지는 기본적으로 특정 체커에 종속되어 있으며, 일반적으로 소스 코드의 특징이나 형태, 혹은 실행 경로 상의 특징을 반영하고 있지는 않다. At this time, the alarm is made by outputting a specific alarm message preset to the checker with respect to the detected error. Each alert message is basically dependent on a specific checker, and generally does not reflect the nature or form of the source code, or features on the execution path.
하나의 '경보 타입'은 동일한 경보 메시지를 가진다. 일예로, 하나의 체커는 하나의 경보 메시지를 발생시키며, 하나의 '경보 타입'을 정의하는 것으로 이해될 수 있다. One 'alarm type' has the same alarm message. For example, one checker generates one alert message and can be understood to define one 'alarm type'.
일예로, 상기 '경보 타입'은 'general null dereference', 'dereferencing of an unchecked null value' 및 'dereferencing of a returned null value' 등을 그 예로 들 수 있으며, 이외에도 다양한 경보 타입이 설정될 수 있다.For example, the 'alarm type' may include 'general null dereference', 'dereferencing of an unchecked null value', and 'dereferencing of a returned null value', and the like, and various alarm types may be set.
일예로, 상기 경보 타입(alarm types) 별로 후술하는 피쳐 패턴 세트가 정의된다. For example, a feature pattern set to be described below is defined for each alarm type.
S2 단계에서, 오경보 저감 장치는, 상기 소스 코드를 추상 구문 트리(abstract syntax tree, AST)로 변환한다. In operation S2, the false alarm reduction apparatus converts the source code into an abstract syntax tree (AST).
추상 구문 트리(abstract syntax tree, AST)는 프로그래밍 언어로 작성된 소스 코드의 추상 구문 구조의 트리로서, 이 트리의 각 노드는 소스 코드에서 발생되는 구조체를 나타낸다. 추상 구문 트리의 상세한 개념은 다수의 공지 자료를 통해 이해될 수 있으므로 상세 설명은 생략한다. An abstract syntax tree (AST) is a tree of abstract syntax structures in source code written in a programming language, where each node represents a structure generated from the source code. Detailed concepts of the abstract syntax tree may be understood through a number of known materials, and thus detailed descriptions thereof will be omitted.
S3 단계에서, 오경보 저감 장치는, 상기 추상 구문 트리에서 상기 오류 검출 경보와 관련되지 않은 불요 서브트리(unnecessary subtree)를 제거한다. In step S3, the false alarm reduction apparatus removes an unnecessary subtree not associated with the error detection alert from the abstract syntax tree.
불요 서브트리(unnecessary subtree)의 제거는 통상의 규칙 기반 기법에 의해 이뤄질 수 있다. Elimination of unnecessary subtrees can be accomplished by conventional rule-based techniques.
일예로, 상기 불요 서브트리(unnecessary subtree)의 제거는, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 구문을 제외한 다른 일반 구문을 제거하는 제1 정책과, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 분기문이 아닌 다른 분기문을 제거하는 제2 정책과- 단, 오류 검출 경보와 관련된 실행 경로는 분기문의 조건 판별 결과를 포함함-, 오류 검출 경보와 관련된 실행 경로 상에서 실행된 반복문이 아닌 다른 반복문을 제거하는 제3 정책과, 오류 검출 경보와 관련된 실행 경로 상에서 호출된 함수 및 상기 함수의 실행 경로를 상기 함수를 호출하는 노드의 서브트리로 포함하는 제4 정책과, 오류 검출 경보와 관련된 실행 경로와 관계 없는 선언문을 제거하는 제5 정책 중의 적어도 어느 하나의 정책에 근거하여 이뤄진다. For example, the removal of the unnecessary subtree may include a first policy for removing general syntax other than the syntax executed on the execution path associated with the error detection alert, and a branch executed on the execution path associated with the error detection alert. A second policy for removing branch statements other than the statement, provided that the execution path associated with the error detection alert includes the result of condition determination of the branch statement; A third policy to remove, a fourth policy including a function called on an execution path associated with an error detection alert and an execution path of the function as a subtree of a node invoking the function, an execution path associated with an error detection alert, and It is based on at least one of the fifth policies for removing extraneous statements.
S4 단계에서, 오경보 저감 장치는, 상기 오류 검출 경보의 경보 타입에 대하여 미리 설정된 피쳐 패턴 세트에 근거하여, 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터를 수득한다. In step S4, the false alarm reducing apparatus obtains a feature vector for the abstract syntax tree from which an unnecessary subtree is removed, based on a set of feature patterns preset for the alarm type of the error detection alert.
소스 코드로부터 구해진 추상 구문 트리(abstract syntax tree, AST)는 분류기를 통한 오경보 분류를 위해 그대로 입력 데이터로 활용 하기에는 너무 크고 복잡한 구조를 갖는다. 본 실시예와 같이 소스 코드로부터 구해진 추상 구문 트리에 대하여 피쳐 벡터를 수득하고 이를 이용하여 분류기 학습을 하게 되면, 학습 시간을 줄이고 성능을 향상시키는 장점을 얻게 된다. The abstract syntax tree (AST) obtained from the source code is too large and complex to use as input data for classification of false alarms through a classifier. When the feature vector is obtained and the classifier learning using the abstract syntax tree obtained from the source code as in the present embodiment, it is possible to reduce the learning time and improve the performance.
바람직하게, 상기 피쳐 패턴 세트는, 상기 오류 검출 경보의 특정 경보 타입에 대하여 미리 설정된 n 개의 피쳐 패턴의 세트 형태로 구성되며, 상기 피처 패턴은, 조건문 발생, 루프문 발생, 리턴문 발생, 브레이크(break) 또는 컨티뉴(continue)문 발생, 엑시트(exit) 또는 어서트(assert) 메소드 호출(method invocation) 발생, 널 표현(null expression) 발생, 널 값과의 비교(comparisons with a null value) 발생, 널 할당(null assignments) 발생, 널 값을 리턴하는 문(statements)의 발생 중의 어느 하나일 수 있다. 이를 표로 정리하면 다음과 같다. Preferably, the feature pattern set is configured in the form of a set of n feature patterns preset for a specific alert type of the error detection alert, and the feature pattern includes: condition statement generation, loop statement generation, return statement generation, and break ( break or continue statement occurrences, exit or assert method invocations, null expressions, comparisons with a null value, Null assignments can occur, or statements that return null values can occur. This is summarized as follows.
구분division 피처 패턴Feature pattern
1One 조건문 발생 Conditional statement occurrence
22 루프문 발생Loop statement occurrence
33 리턴문 발생Return statement occurs
44 브레이크(break) 또는 컨티뉴(continue)문 발생Break or continue statement occurs
55 엑시트(exit) 또는 어서트(assert) 메소드 호출(method invocation) 발생Exit or assert method invocation
66 널 표현(null expression) 발생Null expression occurs
77 널 값과의 비교(comparisons with a null value) 발생Encounters with a null value
88 널 할당(null assignments) 발생Null assignments occur
99 널 값을 리턴하는 문(statements)의 발생The occurrence of a statement that returns a null value
바람직하게, 상기 S4 단계에서, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))의 수득 과정은 다음과 같이 실행된다. Preferably, in step S4, a process of obtaining a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed is performed as follows.
S401 단계에서, 오경보 저감 장치는, 상기 오류 검출 경보의 경보 타입(j)에 대하여, 하기 수학식1과 같이, n 개의 피쳐 패턴(p)의 세트 형태로 구성된 피쳐 패턴 세트(P)를 정의한다. In operation S401, the false alarm reducing apparatus defines a feature pattern set P configured in the form of a set of n feature patterns p, as shown in Equation 1 below, for the alert type j of the error detection alert. .
[수학식1][Equation 1]
P = {p1, p2, ..., pn}P = {p 1 , p 2 , ..., p n }
S402 단계에서, 오경보 저감 장치는, 하기 수학식2와 같이, 추상 구문 트리 상의 임의의 노드 d에 대한 n 차원의 패턴 만족 벡터(v(P,d))를 정의한다. In operation S402, the false alarm reducing apparatus defines an n-dimensional pattern satisfaction vector v (P, d) for any node d on the abstract syntax tree, as shown in Equation 2 below.
[수학식2][Equation 2]
Figure PCTKR2015012791-appb-I000005
Figure PCTKR2015012791-appb-I000005
(단, S(d,pi)는 임의의 노드 d 또는 노드 d를 루트로 하는 서브트리가 i 번째 피쳐 패턴(pi)에 매칭되는지 여부를 나타내는 인자로서, 하기 수학식3과 같이 정의되며, i 번째 피쳐 패턴(pi)은 단일 노드 또는 서브트리일 수 있음(Where S (d, p i ) is a factor indicating whether an arbitrary node d or a subtree rooted at node d matches the i th feature pattern p i , and is defined as in Equation 3 below. , i th feature pattern (p i ) can be a single node or a subtree
[수학식3][Equation 3]
Figure PCTKR2015012791-appb-I000006
)
Figure PCTKR2015012791-appb-I000006
)
S403 단계에서, 오경보 저감 장치는, 하기 수학식4와 같이, 추상 구문 트리 상의 임의의 노드 D에 대한 피쳐 벡터(V(P,D))를 정의한다. In operation S403, the false alarm reduction apparatus defines a feature vector V (P, D) for any node D on the abstract syntax tree, as shown in Equation 4 below.
[수학식4][Equation 4]
Figure PCTKR2015012791-appb-I000007
Figure PCTKR2015012791-appb-I000007
(단, d1,...,dm은 임의의 노드 D의 자식 노드들이며, (Where d 1 , ..., d m are children of any node D,
V(P,d1)...V(P,dm) 는 자식 노드 d1,...,dm에 대하여 상기 수학식4를 통해 구한 피쳐 벡터이며, V (P, d 1 ) ... V (P, d m ) is a feature vector obtained through Equation 4 for the child nodes d 1 , ..., d m ,
v(P,D)는 임의의 노드 D에 대한 n 차원의 패턴 만족 벡터임)v (P, D) is an n-dimensional pattern satisfaction vector for any node D)
S404 단계에서, 오경보 저감 장치는, 하기 수학식5를 이용하여, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))를 수득한다. In operation S404, the apparatus for reducing false alarms obtains a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree is removed using Equation 5 below.
[수학식5] [Equation 5]
Figure PCTKR2015012791-appb-I000008
Figure PCTKR2015012791-appb-I000008
(단, R은 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리의 루트 노드로서 상기 수학식4의 노드 D에 대응하며, R is a root node of the abstract syntax tree from which the unnecessary subtree is removed and corresponds to node D of Equation 4,
j는 발생한 오류 검출 경보에 관한 경보 타입을 나타내는 인자임)j is a factor indicating an alarm type for an error detection alarm that has occurred)
상기 수학식5는, 상기 수학식4의 임의의 노드 D로서, 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리의 루트 노드 R을 입력하여 구해지는 식으로 이해될 수도 있다. Equation 5 may be understood as an arbitrary node D of Equation 4 obtained by inputting a root node R of the abstract syntax tree from which an unnecessary subtree is removed.
S5 단계에서, 오경보 저감 장치는, 수득된 상기 피쳐 벡터를 오경보 분류 정보가 미리 학습된 분류기에 입력하여 오경보를 분류한다. 이를 위해, S5 단계에서는, 상기 S404 단계에서 수득된 피쳐 벡터(Vj(R))를 오경보 분류 정보가 미리 학습된 분류기에 입력하여 오경보를 분류하게 된다. In step S5, the false alarm reducing device classifies the false alarm by inputting the obtained feature vector into a classifier in which false alarm classification information has been learned in advance. To this end, in step S5, the feature vector (V j (R)) obtained in the step S404 is input to the classifier that false alarm classification information has been learned in advance to classify the false alarm.
분류기의 학습은, 예를 들어, 분류기를 생성하고자 하는 특정한 경보 타입에 해당하면서, 오경보/정상 경보 여부를 알고 있는 다수의 학습용 오류 검출 경보의 피쳐 벡터를 분류기에 미리 입력하고, 상기 학습용 오류 검출 경보의 오경보/정상 경보 여부에 관한 정보와 그 피쳐 패턴에 관한 정보에 근거하여 분류기에 공지의 기계 학습 기법에 의한 학습을 하도록 하는 방식을 이뤄질 수 있다. 도 1의 S101 단계는 각 경보 타입 별로 분류기 학습이 이뤄지는 단계를 나타낸다. 일예로, 피쳐 벡터를 분류기에 미리 입력하는 것은, 오경보/정상 경보 여부를 알고 있는 소스 코드와 해당 소스 코드에 대한 경보 타입(alarm types)을 입력하는 과정을 통해 이뤄질 수 있다. Learning of the classifier corresponds to, for example, a specific alarm type for which a classifier is to be generated, and inputs a feature vector of a plurality of learning error detection alerts in advance to the classifier that knows whether there is a false alarm / normal alert, and the learning error detection alert The classifier may be trained based on a known machine learning technique based on information on whether a false alarm / normal alarm is detected and information on a feature pattern thereof. In step S101 of FIG. 1, a classifier learning is performed for each alarm type. For example, inputting the feature vector to the classifier in advance may be performed by inputting a source code that knows whether there is a false alarm / normal alarm and an alarm type for the source code.
바람직하게, 상기 분류기는 SVM(Support Vector Machine) 분류기이며, 오류 검출 경보에 관한 경보 타입 별로 SVM 분류기가 생성된다. 비선형적 피쳐 벡터를 분류하기 위해 커널 함수를 이용한 맵핑 변환 과정이 포함될 수도 있다. Preferably, the classifier is a support vector machine (SVM) classifier, and the SVM classifier is generated for each alarm type related to an error detection alert. A mapping transformation process using a kernel function may be included to classify the nonlinear feature vectors.
일예로, 본 실시예에 의한 SVM(Support Vector Machine) 분류기는 다음과 같이 구성될 수 있다. k 개의 경보 타입에 대응하여, k 개의 분류기 모델 M1, M2, ..., Mk 를 생성할 수 있다. For example, the SVM (Support Vector Machine) classifier according to the present embodiment may be configured as follows. Corresponding to k alarm types, k classifier models M 1 , M 2 ,..., M k can be generated.
SVM 분류기는 입력 공간 X로부터 제공되는 i번째 타입의 입력 데이터 Vi(Ri1), ...,Vi(Rin) 를 고차원 피쳐 공간 F로 맵핑하고, 다음과 같은 과정을 통해 최대 마진(margin) 초평면을 구한다. The SVM classifier maps the i-th type of input data V i (R i1 ), ..., V i (R in ) from the input space X into the high-dimensional feature space F, and the maximum margin ( margin) Returns the hyperplane.
[수학식6] [Equation 6]
Figure PCTKR2015012791-appb-I000009
Figure PCTKR2015012791-appb-I000009
[수학식7][Equation 7]
Figure PCTKR2015012791-appb-I000010
Figure PCTKR2015012791-appb-I000010
(단, b 및 ai 는 초평면을 결정하기 위한 파라메터이며, (Where b and a i are parameters for determining the hyperplane,
yj 는 j번째 학습 데이터 Vi(Rij)의 라벨이고 '1'(참) 또는 '-1'(거짓) 중의 어느 하나의 값을 가지며, y j is a label of the j th training data V i (R ij ) and has a value of either '1' (true) or '-1' (false),
K 는 비선형 맵핑을 단순화하기 위한 커널 함수이며, K is a kernel function to simplify nonlinear mapping,
Figure PCTKR2015012791-appb-I000011
는 맵핑 함수임)
Figure PCTKR2015012791-appb-I000011
Is a mapping function)
상기 수학식7은 i번째 타입의 모델 Mi에 대응하는 최적 초평면을 나타낸다. Equation 7 shows an optimal hyperplane corresponding to the model M i of the i-th type.
이러한 분류기 구성을 통해, 타입 j의 새로운 경보가 입력되는 경우, 모델 Mj 가 사용되게 된다.This classifier configuration allows the model M j to be used when a new alarm of type j is entered.
일예로, 경보를 분류하기 위한 모델의 학습은 LIBSVM를 포함하는 공지 기술이 적용될 수 있다. LIBSVM의 구성은 "LIBSVM: A Library for Support Vector Machines,"(ACM Transactions on Intelligent Systems and Technology, vol. 2, no. 3, pp. 1-39, 2011., C. Chang and C. Lin) 등을 통해 참조될 수 있다. In one example, the training of the model for classifying alerts may be applied to known techniques including LIBSVM. The configuration of LIBSVM is described in "LIBSVM: A Library for Support Vector Machines," (ACM Transactions on Intelligent Systems and Technology, vol. 2, no. 3, pp. 1-39, 2011., C. Chang and C. Lin), etc. Can be referenced through.
분류기에 의한 분류 결과는, 예를 들어, SVM 분류기의 분류 결과, 오경보가 아닌 정상 경보로 분류된 경우에는 '1'의 값을 가지며, 오경보로 분류된 경우에는 '-1'의 값을 갖는 라벨을 출력하는 방식으로 이뤄질 수 있다. The classification result by the classifier is, for example, a classification result of the SVM classifier, a label having a value of '1' when classified as a normal alarm instead of a false alarm, and a value having a value of '-1' when classified as a false alarm. This can be done by printing
한편, 다른예로서, SVM 분류기 이외의 다른 방식으로 구현되는 공지의 기계 학습 방식의 분류기가 사용될 수도 있음은 물론이다. Meanwhile, as another example, a known machine learning classifier implemented in a manner other than the SVM classifier may be used.
S6 단계에서, 오경보 저감 장치는, 상기 S5 단계에서 오경보로 분류된 오류 검출 경보를, 해당 경보 타입에 있어서의 정적분석기의 오류 검출 경보 대상에서 삭제한다. 바람직하게, 이러한 삭제 처리는 오경보 저감 장치에 미리 설정된 기준에 근거하여 자동으로 이뤄질 수 있으며, 다른 예로, 오경보로 분류된 오류 검출 경보를 사용자가 확인할 수 있도록 하고 삭제 명령을 입력받는 방식도 가능하다. In step S6, the false alarm reducing device deletes the error detection alarm classified as false alarm in step S5 from the error detection alarm object of the static analyzer of the corresponding alarm type. Preferably, such deletion processing may be automatically performed based on a preset criterion in the false alarm reduction apparatus. As another example, a user may check an error detection alarm classified as a false alarm and receive a deletion command.
이를 통해, 상기 삭제 이후의 정적분석기의 소스 코드 분석 과정에서 오경보로 분류된 오류 검출 경보가 발생되는 것이 방지될 수 있으며, 결과적으로 오경보가 저감될 수 있다. Through this, an error detection alarm classified as a false alarm may be prevented from occurring during a source code analysis process of the static analyzer after the deletion, and as a result, a false alarm may be reduced.
상기와 같은 최종 삭제 처리 과정에서 있어서, 상기 분류 결과값과 함께 해당 결과값에 대한 개연성(probability) 정보값을 더욱 제공하도록 구성될 수 있으며, 상기 개연성 정보값에 스레쉬홀드(θ)를 설정할 수 있도록 하여, 최종 삭제 분류 결과에 더욱 타당성을 부여할 수 있다. In the final deletion process as described above, it may be configured to further provide a probability information value for the result value together with the classification result value, and a threshold θ may be set in the probability information value. In this way, more validity can be given to the final deletion classification result.
예를 들어, 특정 오류 검출 경보가 오경보로 분류된 경우, 분류 결과값과 함께 제공된 개연성 정보값이 미리 설정된 스레쉬홀드보다 높은 경우에만 실제 오경보로 판단하여 삭제 처리되도록 구성될 수 있다. For example, when a specific error detection alarm is classified as a false alarm, it may be configured to be determined as a real false alarm only when the probability information value provided with the classification result value is higher than a preset threshold.
스레쉬홀드를 높이면, 오경보 분류의 정확도는 더욱 높아지지만 오경보임에도 불구하고 오경보로 분류되지 않는 경우가 증가될 수 있으며, 스레쉬홀드를 낮추면, 정상 경보가 오경보로 분류될 확률이 높아지게 되므로, 오류 검출 경보의 건 수, 정확도에 대한 트레이드 오프 고려 등 여러가지 상황을 고려하여 적절하게 스레쉬홀드가 설정되는 것이 바람직하다. Increasing the threshold increases the accuracy of false alarm classifications, but may increase the chance of false alarms not being classified as false alarms, and lowering the threshold increases the probability of a normal alarm being classified as a false alarm. It is desirable to set the threshold appropriately in consideration of various situations such as the number of alarms and the trade-off of accuracy.
개연성(probability) 정보값의 제공은 "Probability Estimates for Multi-class Classification by Pairwise Coupling,"(The Journal of Machine Learning Research, vol. 5, pp. 975-1005, 2004., T. Wu et al.)를 포함하는 공지 기술을 통해 이뤄질 수 있다. Probability information values are provided in "Probability Estimates for Multi-class Classification by Pairwise Coupling," The Journal of Machine Learning Research, vol. 5, pp. 975-1005, 2004., T. Wu et al. It can be achieved through known techniques, including.
본 출원인에 의해 제안된 상용 정적분석기(SPARROW)로부터 발생되는 경보를 대상으로 본 실시예에 의한 오경보 저감 방법을 실험하였다. 실험 대상의 경보는 10개의 자바 오픈 소스 코드로부터 제공되었다. 각 소스 코드는 213~3,398 개의 파일과, 15,037~292,967 개의 라인으로 구성된 것들이 사용되었다. 이들 소스 코드로부터 총 265개의 경보가 얻어졌다. The false alarm reduction method according to the present embodiment was tested for the alarm generated from the commercial static analyzer (SPARROW) proposed by the applicant. Test subject alerts were provided from 10 Java open source code. Each source code consists of 213 to 3,398 files and 15,037 to 292,967 lines. A total of 265 alerts were obtained from these source codes.
실험에는 'general null dereference', 'dereferencing of an unchecked null value' 및 'dereferencing of a returned null value' 의 3가지 '경보 타입'을 사용하였다. In the experiment, three 'alarm types' were used: 'general null dereference', 'dereferencing of an unchecked null value' and 'dereferencing of a returned null value'.
피쳐 패턴으로서 상기 표 1에 예시된 피쳐 패턴들이 사용되었다. As the feature pattern, the feature patterns illustrated in Table 1 above were used.
실험 결과, 본 실시예의 오경보 저감 방법에 의해, 50%의 스레쉬홀드에서 37.33% 의 오경보가 발견 및 제거될 수 있었다. As a result of the experiment, by the method of reducing false alarms of this example, 37.33% of false alarms could be found and removed at 50% threshold.
본 발명의 실시예 들은 다양한 컴퓨터로 구현되는 동작을 수행하기 위한 프로그램과 이를 기록한 컴퓨터 판독가능 매체를 포함한다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체는 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD, USB 드라이브와 같은 광기록 매체, 플롭티컬 디스크와 같은 자기-광 매체, 및 롬, 램, 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 상기 매체는 프로그램 명령, 데이터 구조 등을 지정하는 신호를 전송하는 반송파를 포함하는 광 또는 금속선, 도파관 등의 전송 매체일 수도 있다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다.Embodiments of the present invention include a program for performing various computer-implemented operations and a computer readable medium recording the same. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The media may be those specially designed and constructed for the purposes of the present invention, or they may be of the kind well-known and available to those having skill in the computer software arts. Examples of computer readable recording media include magnetic media such as hard disks, floppy disks and magnetic tape, optical recording media such as CD-ROM, DVD, USB drives, magnetic-optical media such as floppy disks, and ROM, RAM, Hardware devices specifically configured to store and execute program instructions, such as flash memory, are included. The medium may be a transmission medium such as an optical or metal wire, a waveguide, or the like including a carrier wave for transmitting a signal specifying a program command, a data structure, or the like. Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like.

Claims (8)

  1. 정적분석기와 연동하는 오경보 저감 장치에서 실행되며, 정적분석기에서 발생하는 오류 검출 경보 중 오경보를 저감시키기 위한 방법으로서, As a method for reducing false alarms among error detection alarms generated by static analyzers,
    1) 발생한 오류 검출 경보에 관한 경보 타입(alarm types) 정보, 경보 경로(alarm path) 정보 및 경보의 대상이 된 소스 코드 정보를 입력받는 단계- 상기 경보 타입 정보는 발생한 오류 검출 경보가 미리 설정된 경보 타입 중에서 어느 타입에 해당하는지에 관한 정보이며, 상기 경보 경로 정보는 소스 코드의 실행 경로 중에서 상기 발생한 오류 검출 경보와 관련된 실행 경로에 관한 정보임-; 1) receiving alarm type information, alarm path information, and source code information targeted for an alarm, in which an error detection alarm has occurred. Information regarding which type corresponds to a type, wherein the alarm path information is information on an execution path associated with the generated error detection alarm in an execution path of source code;
    2) 상기 소스 코드를 추상 구문 트리(abstract syntax tree, AST)로 변환하는 단계; 2) converting the source code into an abstract syntax tree (AST);
    3) 상기 추상 구문 트리에서 상기 오류 검출 경보와 관련되지 않은 불요 서브트리(unnecessary subtree)를 제거하는 단계; 3) removing an unnecessary subtree not associated with the error detection alert from the abstract syntax tree;
    4) 상기 오류 검출 경보의 경보 타입에 대하여 미리 설정된 피쳐 패턴 세트에 근거하여, 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터를 수득하는 단계; 및 4) obtaining a feature vector for the abstract syntax tree from which unnecessary subtrees have been removed based on a set of feature patterns preset for the alert type of the error detection alert; And
    5) 수득된 상기 피쳐 벡터를 오경보 분류 정보가 미리 학습된 분류기에 입력하여 오경보를 분류하는 단계;를 포함하여 구성된 소스 코드의 오류 검출에 있어서 오경보 저감 방법.5) classifying false alarms by inputting the obtained feature vector into a classifier for which false alarm classification information has been learned in advance. 5.
  2. 제1항에 있어서, The method of claim 1,
    6) 상기 5) 단계에서 오경보로 분류된 오류 검출 경보를, 해당 경보 타입에 있어서의 정적분석기의 오류 검출 경보 대상에서 삭제하는 단계;를 더욱 포함하여 구성된 것을 특징으로 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법.And 6) deleting the error detection alarm classified as a false alarm in step 5) from the error detection alarm object of the static analyzer of the corresponding alarm type. How to reduce false alarms.
  3. 제1항에 있어서, The method of claim 1,
    상기 3) 단계에서, 상기 불요 서브트리(unnecessary subtree)의 제거는, In the step 3), the removal of the unnecessary subtree (unnecessary subtree),
    오류 검출 경보와 관련된 실행 경로 상에서 실행된 구문을 제외한 다른 일반 구문을 제거하는 제1 정책과, A first policy for removing general syntax other than syntax executed on an execution path associated with an error detection alert;
    오류 검출 경보와 관련된 실행 경로 상에서 실행된 분기문이 아닌 다른 분기문을 제거하는 제2 정책과- 단, 오류 검출 경보와 관련된 실행 경로는 분기문의 조건 판별 결과를 포함함-, A second policy for removing a branch statement other than the branch statement executed on the execution path associated with the error detection alert, provided that the execution path related to the error detection alert includes the result of condition determination of the branch statement,
    오류 검출 경보와 관련된 실행 경로 상에서 실행된 반복문이 아닌 다른 반복문을 제거하는 제3 정책과, A third policy for removing loops other than loops executed on the execution path associated with the error detection alert;
    오류 검출 경보와 관련된 실행 경로 상에서 호출된 함수 및 상기 함수의 실행 경로를 상기 함수를 호출하는 노드의 서브트리로 포함하는 제4 정책과, A fourth policy comprising a function called on an execution path associated with an error detection alert and a execution path of the function as a subtree of a node invoking the function;
    오류 검출 경보와 관련된 실행 경로와 관계 없는 선언문을 제거하는 제5 정책 중의 적어도 어느 하나의 정책에 근거하여 이뤄지는 것을 특징으로 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법.A method for reducing false alarms in source code error detection, characterized in that based on at least one of the fifth policies for removing a statement irrelevant to an execution path associated with an error detection alarm.
  4. 제1항에 있어서, The method of claim 1,
    상기 4) 단계에서, 상기 피쳐 패턴 세트는, In the step 4), the feature pattern set,
    상기 오류 검출 경보의 특정 경보 타입에 대하여 미리 설정된 n 개의 피쳐 패턴의 세트 형태로 구성되며, Consists of a set of n feature patterns preset for the specific alarm type of the error detection alarm,
    상기 피처 패턴은, 조건문 발생, 루프문 발생, 리턴문 발생, 브레이크(break) 또는 컨티뉴(continue)문 발생, 엑시트(exit) 또는 어서트(assert) 메소드 호출(method invocation) 발생, 널 표현(null expression) 발생, 널 값과의 비교(comparisons with a null value) 발생, 널 할당(null assignments) 발생, 널 값을 리턴하는 문(statements)의 발생 중의 어느 하나인 것을 특징으로 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법.The feature pattern may include a conditional statement, a loop statement, a return statement, a break or continue statement, an exit or assert method invocation, and a null expression. expression detection, occurrences of comparisons with a null value, occurrences of null assignments, or occurrences of statements that return null values. False alarm reduction method in the.
  5. 제1항에 있어서, The method of claim 1,
    상기 4) 단계에서, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))의 수득 과정은, In the step 4), the process of obtaining a feature vector (V j (R)) for the abstract syntax tree from which the unnecessary subtree is removed,
    401) 상기 오류 검출 경보의 경보 타입(j)에 대하여, 하기 수학식1과 같이, n 개의 피쳐 패턴(p)의 세트 형태로 구성된 피쳐 패턴 세트(P)를 정의하는 단계; 401) for the alarm type (j) of the error detection alert, defining a feature pattern set (P) consisting of a set of n feature patterns (p), as shown in Equation 1 below;
    [수학식1][Equation 1]
    P = {p1, p2, ..., pn}P = {p 1 , p 2 , ..., p n }
    402) 하기 수학식2와 같이, 추상 구문 트리 상의 임의의 노드 d에 대한 n 차원의 패턴 만족 벡터(v(P,d))를 정의하는 단계; 402) defining an n-dimensional pattern satisfaction vector v (P, d) for any node d on the abstract syntax tree as shown in Equation 2 below;
    [수학식2][Equation 2]
    Figure PCTKR2015012791-appb-I000012
    Figure PCTKR2015012791-appb-I000012
    (단, S(d,pi)는 임의의 노드 d 또는 노드 d를 루트로 하는 서브트리가 i 번째 피쳐 패턴(pi)에 매칭되는지 여부를 나타내는 인자로서, 하기 수학식3과 같이 정의되며, i 번째 피쳐 패턴(pi)은 단일 노드 또는 서브트리일 수 있음(Where S (d, p i ) is a factor indicating whether an arbitrary node d or a subtree rooted at node d matches the i th feature pattern p i , and is defined as in Equation 3 below. , i th feature pattern (p i ) can be a single node or a subtree
    [수학식3][Equation 3]
    Figure PCTKR2015012791-appb-I000013
    )
    Figure PCTKR2015012791-appb-I000013
    )
    403) 하기 수학식4와 같이, 추상 구문 트리 상의 임의의 노드 D에 대한 피쳐 벡터(V(P,D))를 정의하는 단계; 및 403) defining a feature vector V (P, D) for any node D on the abstract syntax tree, as shown in Equation 4 below; And
    [수학식4][Equation 4]
    Figure PCTKR2015012791-appb-I000014
    Figure PCTKR2015012791-appb-I000014
    (단, d1,...,dm은 임의의 노드 D의 자식 노드들이며, (Where d 1 , ..., d m are children of any node D,
    V(P,d1)...V(P,dm) 는 자식 노드 d1,...,dm에 대하여 상기 수학식4를 통해 구한 피쳐 벡터이며, V (P, d 1 ) ... V (P, d m ) is a feature vector obtained through Equation 4 for the child nodes d 1 , ..., d m ,
    v(P,D)는 임의의 노드 D에 대한 n 차원의 패턴 만족 벡터임)v (P, D) is an n-dimensional pattern satisfaction vector for any node D)
    404) 하기 수학식5를 이용하여, 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리에 대한 피쳐 벡터(Vj(R))를 수득하는 단계;를 포함하여 구성된 것을 특징으로 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법.404) using Equation 5 below, obtaining a feature vector V j (R) for the abstract syntax tree from which the unnecessary subtree has been removed; A method for reducing false alarms in detecting errors in codes.
    [수학식5] [Equation 5]
    Figure PCTKR2015012791-appb-I000015
    Figure PCTKR2015012791-appb-I000015
    (단, R은 상기 불요 서브트리(unnecessary subtree)가 제거된 상기 추상 구문 트리의 루트 노드로서 상기 수학식4의 노드 D에 대응하며, R is a root node of the abstract syntax tree from which the unnecessary subtree is removed and corresponds to node D of Equation 4,
    j는 발생한 오류 검출 경보에 관한 경보 타입을 나타내는 인자임)j is a factor indicating an alarm type for an error detection alarm that has occurred)
  6. 제1항에 있어서, The method of claim 1,
    상기 5) 단계의 분류기는 SVM(Support Vector Machine)이며, 오류 검출 경보에 관한 경보 타입 별로 생성되는 것을 특징으로 하는 소스 코드의 오류 검출에 있어서 오경보 저감 방법.The classifier of step 5) is a support vector machine (SVM), and the false alarm reduction method for error detection of the source code, characterized in that it is generated for each alarm type related to the error detection alarm.
  7. 하드웨어와 결합되어 제1항 내지 제6항 중의 어느 한 항에 따른 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 실행시키기 위하여 매체에 저장된 컴퓨터 프로그램.A computer program, coupled with hardware, stored on a medium for executing a method for reducing false alarms in detecting errors in the source code according to any one of claims 1 to 6.
  8. 제1항 내지 제6항 중의 어느 한 항에 따른 소스 코드의 오류 검출에 있어서 오경보 저감 방법을 컴퓨터에서 실행하기 위한 컴퓨터 프로그램이 기록된, 컴퓨터로 판독 가능한 기록 매체.A computer-readable recording medium having recorded thereon a computer program for executing a method for reducing false alarms on a computer in error detection of source code according to any one of claims 1 to 6.
PCT/KR2015/012791 2014-11-28 2015-11-26 Method for reducing false alarms in detecting source code error, computer program therefor, recording medium thereof WO2016085272A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2014-0168981 2014-11-28
KR20140168981 2014-11-28
KR10-2015-0011094 2015-01-23
KR1020150011094A KR101694778B1 (en) 2014-11-28 2015-01-23 False alarm reducing method in finding potential bug in a source code, computer program for the same, recording medium storing computer program for the same

Publications (1)

Publication Number Publication Date
WO2016085272A1 true WO2016085272A1 (en) 2016-06-02

Family

ID=56074709

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2015/012791 WO2016085272A1 (en) 2014-11-28 2015-11-26 Method for reducing false alarms in detecting source code error, computer program therefor, recording medium thereof

Country Status (1)

Country Link
WO (1) WO2016085272A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273289A (en) * 2017-06-13 2017-10-20 西北工业大学 Parallel error pattern matching process based on global analysis
CN109117633A (en) * 2018-08-13 2019-01-01 百度在线网络技术(北京)有限公司 Static source code scan method, device, computer equipment and storage medium
CN109726120A (en) * 2018-12-05 2019-05-07 北京计算机技术及应用研究所 A kind of software defect confirmation method based on machine learning
KR20190112524A (en) * 2018-03-26 2019-10-07 한국과학기술원 Architecture-independent similarity measuring method for program function
CN112131122A (en) * 2020-09-27 2020-12-25 北京软安科技有限公司 Method and device for source code defect detection tool misinformation evaluation
CN112597038A (en) * 2020-12-28 2021-04-02 中国航天系统科学与工程研究院 Software defect prediction method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100333069A1 (en) * 2009-06-29 2010-12-30 International Business Machines Corporation Static code analysis
US20110078661A1 (en) * 2009-09-30 2011-03-31 Microsoft Corporation Marker correlation of application constructs with visualizations
EP2369529A1 (en) * 2010-03-24 2011-09-28 Alcatel Lucent A method of detecting anomalies in a message exchange, corresponding computer program product, and data storage device therefor
US20120216280A1 (en) * 2011-02-18 2012-08-23 Microsoft Corporation Detection of code-based malware
US20130145215A1 (en) * 2011-12-04 2013-06-06 International Business Machines Corporation Eliminating false-positive reports resulting from static analysis of computer software

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100333069A1 (en) * 2009-06-29 2010-12-30 International Business Machines Corporation Static code analysis
US20110078661A1 (en) * 2009-09-30 2011-03-31 Microsoft Corporation Marker correlation of application constructs with visualizations
EP2369529A1 (en) * 2010-03-24 2011-09-28 Alcatel Lucent A method of detecting anomalies in a message exchange, corresponding computer program product, and data storage device therefor
US20120216280A1 (en) * 2011-02-18 2012-08-23 Microsoft Corporation Detection of code-based malware
US20130145215A1 (en) * 2011-12-04 2013-06-06 International Business Machines Corporation Eliminating false-positive reports resulting from static analysis of computer software

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273289A (en) * 2017-06-13 2017-10-20 西北工业大学 Parallel error pattern matching process based on global analysis
KR20190112524A (en) * 2018-03-26 2019-10-07 한국과학기술원 Architecture-independent similarity measuring method for program function
KR102418212B1 (en) 2018-03-26 2022-07-08 한국과학기술원 Architecture-independent similarity measuring method for program function
CN109117633A (en) * 2018-08-13 2019-01-01 百度在线网络技术(北京)有限公司 Static source code scan method, device, computer equipment and storage medium
CN109726120A (en) * 2018-12-05 2019-05-07 北京计算机技术及应用研究所 A kind of software defect confirmation method based on machine learning
CN109726120B (en) * 2018-12-05 2022-03-08 北京计算机技术及应用研究所 Software defect confirmation method based on machine learning
CN112131122A (en) * 2020-09-27 2020-12-25 北京软安科技有限公司 Method and device for source code defect detection tool misinformation evaluation
CN112131122B (en) * 2020-09-27 2022-09-30 北京智联安行科技有限公司 Method and device for source code defect detection tool misinformation evaluation
CN112597038A (en) * 2020-12-28 2021-04-02 中国航天系统科学与工程研究院 Software defect prediction method and system
CN112597038B (en) * 2020-12-28 2023-12-08 中国航天系统科学与工程研究院 Software defect prediction method and system

Similar Documents

Publication Publication Date Title
WO2016085272A1 (en) Method for reducing false alarms in detecting source code error, computer program therefor, recording medium thereof
She et al. Neutaint: Efficient dynamic taint analysis with neural networks
US11494295B1 (en) Automated software bug discovery and assessment
JP6369736B2 (en) Alarm type classification method in error detection of source code, computer program therefor, and recording medium therefor
US8412653B2 (en) Knowledge extraction and transformation
US9141806B2 (en) Mining source code for violations of programming rules
WO2017213400A1 (en) Malware detection by exploiting malware re-composition variations
JP7115552B2 (en) Analysis function imparting device, analysis function imparting method and analysis function imparting program
CN107862327B (en) Security defect identification system and method based on multiple features
US20080127043A1 (en) Automatic Extraction of Programming Rules
CN109657461B (en) RTL hardware Trojan horse detection method based on gradient lifting algorithm
US11960597B2 (en) Method and system for static analysis of executable files
CN107239694A (en) A kind of Android application permissions inference method and device based on user comment
WO2022114392A1 (en) Feature selection-based mobile malicious code classification method, and recording medium and device for performing same
WO2016085273A1 (en) Method for classifying alarm types in detecting source code error, computer program therefor, recording medium thereof
Wang et al. Explainable apt attribution for malware using nlp techniques
US20230385037A1 (en) Method and system for automated discovery of artificial intelligence (ai)/ machine learning (ml) assets in an enterprise
WO2017052318A1 (en) Method and apparatus for analyzing software
EP3504597A1 (en) Identification of deviant engineering modifications to programmable logic controllers
CN109002716A (en) A kind of malicious code intrusion detection of mobile application and prevention method
Kalaki et al. Anomaly detection on OpenStack logs based on an improved robust principal component analysis model and its projection onto column space
US11868473B2 (en) Method for constructing behavioural software signatures
KR101694778B1 (en) False alarm reducing method in finding potential bug in a source code, computer program for the same, recording medium storing computer program for the same
CN112464237A (en) Static code safety diagnosis method and device
Bose et al. Root cause analysis using sequence alignment and Latent Semantic Indexing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15862796

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15862796

Country of ref document: EP

Kind code of ref document: A1