Apparatus and method for assisting in identifying defective parts

The fault location identification support device improves debugging efficiency by recalculating suspicion values based on intra-source file relationships and test execution data, addressing the inefficiencies of existing SBFL methods.

JP7562483B2Active Publication Date: 2024-10-07HITACHI LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2021105236
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-06-24
Publication Date
2024-10-07
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

Existing fault localization techniques, such as Spectrum-Based Fault Localization (SBFL), struggle to accurately rank defective locations due to similar suspicion values across multiple lines, leading to inefficiencies in debugging, and fail to assign appropriate suspicion values to parts with high successful testing rates, resulting in missed failures.

Method used

A fault location identification support device and method that utilizes an intra-source file relationship acquisition unit to analyze relationships between instruction statements, combined with test execution information and initial suspicion values, to recalibrate suspicion values for improved localization, focusing on related statements with high failure possibilities.

Benefits of technology

Enhances debugging efficiency by accurately identifying defective locations with appropriate suspicion values, reducing the likelihood of missed failures and streamlining the debugging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007562483000001
    Figure 0007562483000001
  • Figure 0007562483000002
    Figure 0007562483000002
  • Figure 0007562483000003
    Figure 0007562483000003
Patent Text Reader

Abstract

To support a failure place specification work of a developer by assigning an appropriate suspicious value to a failure place so as to improve efficiency of debugging work.SOLUTION: A preferred aspect of the present invention is a failure place specification support device including: an intra-source-file relevance acquisition unit that acquires intra-source-file relevance information indicating a relevance between respective instruction statements in a source file; and a suspicious value re-assignment unit that calculates a suspicious value using test execution information for holding execution results of a test case, test result starting point suspicious value information for holding the suspicious value calculated based on the number of times of execution of each instruction statement in the source file when executing the test case, and the intra-source-file relevance information, and generates recalculation suspicious value information.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a technique for assisting in identifying defective parts in a source file. [Background technology]

[0002] In software development, when a program malfunctions (behavior that differs from what the developer intended), the cause of the malfunction must be identified and the program must be modified so that the malfunction does not occur again. The cause of a program malfunction is called a defect (fault, bug). The process of identifying the part of a program's source file that contains the malfunction and rewriting that part to remove the malfunction is called debugging. As debugging is one aspect of the software development process that takes up a lot of time, debugging support technologies are being developed to shorten the development process. Automated technology for extracting the cause of a malfunction is one such technology.

[0003] Among the automated techniques for fault location extraction, the technique that has been most actively researched in recent years is Spectrum-Based Fault Localization (SBFL), which automatically extracts fault locations using information on execution paths in source files (source code) by test cases. SBFL is a technique for extracting fault locations based on the idea that, among the lines in a source file, lines executed in failing test cases are highly likely to be the cause of a fault, and lines executed in successful test cases are unlikely to be the cause of a fault. SBFL calculates a value (hereinafter referred to as the "suspicion value") indicating the likelihood that a line is the cause of a fault, using information on how many times each line was executed in failing and successful test cases.

[0004] In SBFL, suspicion values ​​are assigned based only on the execution path (executed lines) when a test case is executed and information on the success or failure of the test. This means that there are many lines with the same suspicion value in multiple statements in a source file, and it is not possible to rank them, making it difficult to narrow down the location of the defect.

[0005] Figure 1 shows an example where many suspected equivalents occur as a result of using SBFL. Specifically, in the source code in Figure 1, the instruction statement L48 marked with a circle is the defective part, but the same suspect value of 0.6 is assigned to L45 to L49. In this case, there is no difference in the ranking from L45 to L49, making it difficult to narrow down the defective part.

[0006] To address the problem of SBFL, Patent Document 1 discloses a technology that helps narrow down the problem areas when a large number of suspected equivalent values ​​occur in SBFL. Specifically, the suspicion value calculated by SBFL is corrected to be higher for source files with a large number of violations based on the number of violations of code rules. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] JP 2021-005171 A Summary of the Invention [Problem to be solved by the invention]

[0008] Another problem with SBFL is that defective parts that have a high rate of successful tests have a lower suspicion value than non-defective parts, resulting in missing defective parts.

[0009] Figure 2 shows an example of the results of using SBFL where the suspicion value of the defective part is smaller than that of the non-defective part. Specifically, in the source code in Figure 2, the statements L83 and L86 marked with circles are defective parts, but the L86 statement is given a suspicion value of 0.3, which is smaller than the suspicion value of 0.7 of the non-defective parts L81 and L82, and the L86 statement is ranked lower than the L81 and L82 statements.

[0010] In the technology described in Patent Document 1, the same suspicion value calculated by SBFL is ranked based on additional information, namely the number of violations of code rules. However, it is not possible to assign a high suspicion value to defect points that originally have a low suspicion value, and the relevant defect points cannot be extracted as high-ranking points.

[0011] The main objective of the present invention is to assist developers in identifying defective parts and to make debugging more efficient by assigning appropriate suspicion values ​​to defective parts. [Means for solving the problem]

[0012] A preferred aspect of the present invention is a defect location identification support device, comprising: an intra-source file relevance acquisition unit that acquires intra-source file relevance information indicating the relevance between each command statement within a source file; test execution information that holds the execution results of a test case; test result starting suspicion value information that holds a suspicion value calculated based on the number of times each command statement in the source file is executed when the test case is executed; and a suspicion value reassignment unit that calculates a suspicion value using the intra-source file relevance information and generates recalculated suspicion value information.

[0013] Another preferred aspect of the present invention is a defect location identification support method for identifying defect locations in a source file using an information processing device, the defect location identification support method using source file relevance information including relevance information between each command statement in the source file, test execution information including information on where an exception occurs when a test file is executed, and test result origin suspicion value information in which command statements in the source file are assigned a suspicion value generated by an SBFL technique, the method uses the source file relevance information to extract command statements that are highly relevant to the command statement corresponding to the exception occurrence location information, and assigns a suspicion value to the extracted command statements that is higher than the suspicion value assigned by the test result origin suspicion value information. Effect of the Invention

[0014] According to the present invention, by assigning an appropriate suspicion value to a defective part, it is possible to assist a developer in identifying the defective part and to make the debugging work more efficient. [Brief description of the drawings]

[0015] [Figure 1] FIG. 13 is a table showing an example in which suspected-equivalence values ​​are assigned to a plurality of statements. [Diagram 2] 13 is a table showing an example in which a suspected defect value is assigned smaller than a suspected non-defective defect value. [Diagram 3] 1 is a block diagram showing an example of a hardware configuration of a defect point identification support device according to an embodiment of the present invention. [Figure 4] 1 is a block diagram showing an example of a functional configuration of a defect point identification support device according to an embodiment of the present invention; [Diagram 5] FIG. 4 is a list diagram showing an example of a source file group according to the embodiment of the present invention. [Figure 6] FIG. 11 is a list diagram showing an example of a test file group according to the embodiment of the present invention. [Figure 7] FIG. 11 is a table illustrating an example of test execution information according to an embodiment of the present invention. [Figure 8] FIG. 11 is a table showing an example of test result starting suspicious value information in an embodiment of the present invention. [Figure 9] 11 is a table showing an example of intra-source file correlation information in the embodiment of the present invention. FIG. [Figure 10] FIG. 11 is a table showing an example of malfunction possibility information in the embodiment of the present invention. [Figure 11] FIG. 13 is a table showing an example of recalculated suspicious value information in an embodiment of the present invention. [Figure 12] FIG. 4 is a flowchart of a defect location identification support process according to an embodiment of the present invention. [Figure 13] FIG. 11 is a flowchart of a suspicious value assignment process according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] Hereinafter, an embodiment will be described with reference to the drawings. In the following description, the same reference numerals will be used to designate the same or similar components, and redundant description will be omitted.

[0017] The present invention should not be construed as being limited to the description of the embodiments shown below. It will be easily understood by those skilled in the art that the specific configurations can be modified without departing from the concept or spirit of the present invention.

[0018] When there are multiple elements having the same or similar functions, they may be described by using the same reference numerals with different subscripts. However, when there is no need to distinguish between multiple elements, the subscripts may be omitted.

[0019] The designations "first," "second," "third," and the like in this specification are given to identify components, and do not necessarily limit the number, order, or content. Furthermore, numbers for identifying components are used in different contexts, and a number used in one context does not necessarily indicate the same configuration in another context. Furthermore, a component identified by a certain number does not prevent the component from also having the function of a component identified by another number.

[0020] In order to facilitate understanding of the invention, the position, size, shape, range, etc. of each component shown in the drawings, etc. may not represent the actual position, size, shape, range, etc. Therefore, the present invention is not necessarily limited to the position, size, shape, range, etc. disclosed in the drawings, etc.

[0021] All publications, patents, and patent applications cited herein are hereby incorporated by reference in their entirety.

[0022] As used herein, elements referred to in the singular are intended to include the plural unless the context clearly indicates otherwise.

[0023] In the embodiment described below, the main objective is to improve the efficiency of debugging work by developers by appropriately assigning a suspicion value to a defect location that is overlooked by SBFL. For this purpose, a defect location identification support device in one embodiment includes a source file relevance acquisition unit that uses a source file to extract source file relevance information, and a suspicion value reassignment unit that calculates and assigns a suspicion value using test execution information, test result starting point suspicion value information, and the source file relevance information. More detailed means will be described later.

[0024] 3 shows an example of a hardware configuration of the defect location identification support device 100. The defect location identification support device 100 includes a processor 110, a main memory device 120, an auxiliary memory device 130, an input device 140, an output device 150, and a communication device 160. These are connected to each other so as to be able to communicate with each other via a communication means such as a bus (not shown).

[0025] The processor 110 is configured using, for example, a CPU (Central Processing Unit) or an MPU (Micro Processing Unit). The processor 110 reads and executes a program stored in the main memory device 120, thereby realizing various functions of the defect location identification support device 100.

[0026] The main memory device 120 is a device that stores programs and data, and is, for example, a Read Only Memory (ROM), a Random Access Memory (RAM), or a non-volatile semiconductor memory (Non Volatile RAM (NVRAM)).

[0027] The auxiliary storage device 130 is, for example, a hard disk drive, an SSD (SolID State Drive), an optical storage device (CD (Compact Disc), DVD (Digital Versatile Disc), etc.), a storage system, an IC card, a read / write device for a recording medium such as an SD memory card or an optical recording medium, a storage area of ​​a cloud server, etc. The programs and data stored in the auxiliary storage device 130 are loaded into the main storage device 120 as needed.

[0028] The input device 140 is, for example, a keyboard, a mouse, a touch panel, a card reader, a voice input device, etc. The output device 150 is a user interface that provides the user with various information such as the process progress and the process results, and is, for example, a screen display device (liquid crystal monitor, LCD (Liquid Crystal Display), graphic card, etc.), a voice output device (speaker, etc.), a printer, etc. For example, the defect point identification support device 100 may be configured to input and output information to and from other devices via the communication device 160.

[0029] The communication device 160 is a wired or wireless communication interface that realizes communication with other devices via a communication means such as a LAN or the Internet, and is, for example, a NIC (Network Interface Card), a wireless communication module, a USB (Universal Serial Bus) module, a serial communication module, etc.

[0030] The hardware configuration of the defect point identification support device 100 may be configured as a single computer, or any part may be configured as another computer connected via a network.

[0031] Here, the terms used in this embodiment are defined. A "source file" is a program that is the subject of software development, and may contain defects that cause behavior different from that intended by the developer. A "statement" is a program statement that constitutes a source file. A "test file" is a file that stores a program that checks the behavior of source code. A "test method" is a program that checks the behavior of a single method by dividing test code into units of integrated processing. Test code includes one or more test methods. A "method" is a subroutine that inputs data called arguments and obtains output called return values.

[0032] 4 is a diagram showing an example of a functional configuration of the defect location identification support device 100. The defect location identification support device 100 includes a source file correlation acquisition unit 210, a defect possibility determination unit 220, and a suspicion value reassignment unit 230. The processes executed by these functional units will be described later with reference to the flowchart in FIG.

[0033] The intra-source-file correlation acquisition unit 210, the defect possibility determination unit 220, and the suspicion value reassignment unit 230 are configured by the processor 110 in FIG.

[0034] The information storage unit 240 is mainly configured by the auxiliary storage device 130 of Fig. 3. The information storage unit 240 stores a source file group 241, a test file group 242, test execution information 243, test result starting point suspicious value information 244, intra-source file relevance information 245, defect possibility information 246, and recalculated suspicious value information 247. Details of the various information in the information storage unit 290 will be described later with reference to Figs. 5 to 11.

[0035] FIG. 5 is a diagram showing an example of a source file group 241. The source file group 241 includes one or more source folders 510. The source folder 510 has a folder name of core. The source folder 510 includes one or more source files 520. The source file 520 has a file name of CreateCore. The source file 520 includes one or more lines of source code, and FIG. 5 shows an example of 17 lines. The source file 520 includes a method named create in lines 1 to 17.

[0036] The source folder may contain one or more other source folders. The source code may be in a programming language such as Java or C++, or any other programming language.

[0037] Regarding the defect contained in source file 520, in lines 5 and 7, the method “createData” is called, but if we assume that the method “createDate” should actually be called, then the statements in lines 5 and 7 can be said to be the defective parts.

[0038] 6 is a diagram showing an example of the test file group 242. The test file group 242 includes one or more test folders 610. The test folder 610 has a folder name of coretest. The test folder 610 includes one or more test files 620. The test file 620 has a file name of CreateCoreTest.

[0039] Test file 620 includes one or more lines of test code, and an example of 23 lines is shown in Fig. 6. Test file 620 includes a test method named testCreate1 on lines 1 to 5, a test method named testCreate2 on lines 7 to 11, a test method named testCreate3 on lines 13 to 17, and a test method named testCreate4 on lines 19 to 23. Test methods testCreate1, testCreate2, testCreate3, and testCreate4 are all test methods corresponding to method create included in source file 520 in Fig. 5.

[0040] 7 is a diagram showing an example of test execution information 243 used in the SBFL technique. The test execution information 243 can be generated from a log of the results of executing the test file 620, and includes one or more entries. An entry of the test execution information 243 includes columns for the success or failure result when the test file is executed, and for information on the location where an exception occurred in the case of failure. The information on the location where an exception occurred corresponds to information output as a stack trace during test execution, for example. The stack trace indicates which processes were called and in what order when an exception occurred.

[0041] The example of Fig. 7 shows test execution information when the test file 620 of Fig. 6 is executed. In the example of Fig. 7, each column includes the test method name, execution result, exception type in case of failure, and information on the location where the exception occurred in case of failure. The information on the location where the exception occurred includes the folder name, file name, and line number.

[0042] Figure 7 shows that the test method "testCreate2" has failed and an AssertionError has occurred. It also shows that the statement on line 5 of the source file "CreateCore" shown in Figure 5 is being processed when the AssertionError occurs. It also shows that the method "create" which contains the statement on line 5 of the source file "CreateCore" is being called by the statement on line 9 of the test file "CreateCoreTest" in Figure 6.

[0043] 8 is a diagram showing an example of the test result origin suspicious value information 244. The test result origin suspicious value information 244 is generated in advance after the test file 620 is executed by a conventional SBFL technique. The test result origin suspicious value information 244 includes one or more entries. An entry of the test result origin suspicious value information 244 includes columns for the target source folder name, the target source file name, the line number of the target statement, and the suspicious value of the target statement.

[0044] The suspicion value is calculated using information on how many times each statement in a source file was executed in a failing test method and a passing test method. The suspicion value may be corrected using the technique of Patent Document 1. Figure 8 shows test result origin suspicion value information generated for the source file shown in Figure 5 when the test code in Figure 6 is executed.

[0045] In the test result starting suspicion value information shown in Figure 8, the command statement on line 5, which is the defective part of the source file “CreateCore” shown in Figure 5, has been assigned a suspicion value of 1.0, and the command statement on line 7 has been assigned a suspicion value of 0.0. In particular, the command statement on line 7 has a lower suspicion value than the other command statements that are not defective.

[0046] 9 is a diagram showing an example of the source file relation information 245. The source file relation acquisition unit 210 receives a source file as input and generates the source file relation information 245. The source file relation information 245 may also receive defect possibility information 246 as input.

[0047] The source file relevance information 245 includes one or more entries. An entry of the source file relevance information 245 includes columns for the source file name including the comparison source statement, the line number of the comparison source statement, the source file name including the related statement, the line number of the related statement, and the relevance to the comparison source statement. Types of relevance include similar statements, used variable setting statements, etc. The source file including the comparison source statement and the source file including the related statement may be the same or different.

[0048] The details of the generation of the intra-source-file relationship information 245 by the intra-source-file relationship acquisition section 210 will be shown in S1210 of FIG. 12 and described later.

[0049] 10 is a diagram showing an example of defect possibility information 246. Defect possibility determination unit 220 receives as input a source file, test execution information 243, and test result starting point suspicious value information 244, determines the defect possibility of each command statement in the source file, and generates defect possibility information 246.

[0050] The defect possibility information 246 includes one or more entries. An entry of the defect possibility information 246 includes columns of a source file name, a line number, a defect possibility value, and a reason for setting the defect possibility value. The defect possibility value may be indicated by a level as in FIG. 10, or may be indicated by a quantitative value. Details of the generation of the defect possibility information 246 by the defect possibility determination unit 220 are shown in S1220 of FIG. 12 and will be described later.

[0051] 11 is a diagram showing an example of the recalculated suspicious value information 247. The suspicious value reassignment unit 230 receives as input the source file group 241, the test execution information 243, the test result starting point suspicious value information 244, and the intra-source file relevance information 245, and generates the recalculated suspicious value information 247. The suspicious value reassignment unit 230 may also receive as input fault possibility information 246.

[0052] The recalculated suspicious value information 247 includes one or more entries. An entry of the recalculated suspicious value information 247 includes columns for the target folder name, the target source file name, the line number of the target statement, and the suspicious value of the target statement. In addition, if the suspicious value has been changed from the test result starting suspicious value information 244, the entry of the recalculated suspicious value information 247 may also include columns for the suspicious value change content and the suspicious value change reason. Details of the generation of the recalculated suspicious value information 247 by the suspicious value reassignment unit 230 are shown in S1230 of FIG. 12.

[0053] Fig. 12 is a flowchart for explaining a process (hereinafter referred to as a defect part identification support process 1200) performed by the defect part identification support device 100. The defect part identification support process 1200 will be explained below with reference to Fig. 12. The defect part identification support device 100 starts the defect part identification support process 1200, for example, in response to an instruction from a user. Also, the defect part identification support device 100 automatically starts the defect part identification support process 1200 by batch processing or the like at a scheduled timing. In the following, the letter "S" before the reference numerals indicates a processing step.

[0054] First, the source file relationship acquisition unit 210 reads the source file group 241 stored in the information storage unit 240, extracts the relationship between each command statement in the source file 520 and other command statements, and generates source file relationship information 245 (S1210).

[0055] The types of relationships to be extracted include similar command statements, used variable setting command statements, etc. The extraction of similar command statements and used variable setting commands will be explained using the source file 520 shown in Fig. 5. Fig. 9 shows the source file relationship information 245 generated by the source file relationship acquisition unit 210 using the source file in Fig. 5 as an input.

[0056] First, extraction of similar command statements will be described. Similar command statements can be determined based on the degree to which the command statements contain elements in common. To determine whether a command statement is similar, for example, the number of types of tokens (variable names, method names, etc.) contained in the command statements is used to calculate the number of tokens in common between the tokens in the source command statement and the tokens in the target command statement, and if the difference between the number of tokens in common and the number of tokens in the target command statement is equal to or less than a preset threshold, the command statements are determined to be similar.

[0057] In the example of obtaining the intra-source file correlation information in FIG. 9, the threshold value of the difference between the number of common tokens and the number of tokens included in the comparison target command statement when searching for a similar command statement is set to 1. In the source file 520 in FIG. 5, the tokens included in the command statement on the fifth line, which is the comparison source command statement, are (String, result, createData, str, name), and the tokens of the command statement on the seventh line, which is the comparison target command statement, are (String, result, createData, name), and the number of common tokens between the comparison source command statement and the comparison target command statement is 4. The difference between the number of common tokens and the number of tokens included in the comparison target command statement is |4-5|=1, which is less than the threshold value of 1, so the command statement on the seventh line, which is the comparison target command statement, is determined to be similar to the command statement on the fifth line, which is the comparison source command statement. Therefore, the intra-source file correlation information 245 shown in FIG. 9 indicates that the seventh line of the CreateCore file corresponds to a command statement similar to the fifth line of the comparison source command statement, which is the comparison source command statement.

[0058] The threshold value for the difference is arbitrary, and besides making the judgment based on the difference, the judgment may be made based on the ratio of the number of common tokens among the tokens contained in the compared command statements.

[0059] Next, extraction of used variable setting statements will be explained. A used variable setting statement is a statement that assigns a value to a variable used in the comparison source statement. For example, when the comparison source statement contains a method call statement, the used variable setting statement is determined by searching for the statement that most recently assigned a value to the variable used as an argument in the method call using syntax tree analysis.

[0060] Here, in source file 520 in Fig. 5, the statement that most recently assigns a value to the argument "name" in the method call "createData(str, name)" on line 5, which is the comparison source statement, is "String name = tmp.get("data");" on line 3, so the statement on line 3 is determined to be a used variable setting statement for the statement on line 5. Therefore, the intra-source file relevance information shown in Fig. 9 indicates that line 3 of the CreateCore file corresponds to the used variable setting location on line 5 of the comparison source statement, the CreateCore file.

[0061] In this way, command statements that perform processes such as definition, assignment, or use on the same parameter are likely to be related to each other, and there is a possibility that malfunctions will occur in common.

[0062] Next, the defect possibility determination unit 220 reads the source file 520, the test execution information 243, and the test result starting point suspicious value information 244, determines the defect possibility of each command statement in the source file, and generates the defect possibility information 246 (S1220). At this time, since the source file group 241 usually includes a plurality of source files, for example, the source files are called one by one and a defect is determined for each source file to be determined.

[0063] Determining the defect possibility for a statement in a source file will be explained using the source file shown in Fig. 5, the test execution information shown in Fig. 7, and the test result starting point suspicious value information shown in Fig. 8. Note that defect possibility information 246 shown in Fig. 10 indicates defect possibility information generated by defect possibility determination unit 220 using as input the source file 520 shown in Fig. 5, the test execution information 243 shown in Fig. 7, and the test result starting point suspicious value information 244 shown in Fig. 8.

[0064] For example, the malfunction possibility determination unit 220 determines that the statement of the source file indicated in the exception occurrence location information of the test execution information 243 has a high malfunction possibility because it was called when the exception occurred, and gives information indicating the high malfunction possibility. In the example of the test execution information 243 in FIG. 7, it is indicated that the source file "CreateCore" shown in FIG. 5 is called when the exception occurred by the statement on the fifth line. Therefore, in FIG. 10, the malfunction possibility value for the fifth line of the source file "CreateCore" is set to "high". In addition, the reason for determining the malfunction possibility as "high" is indicated as "location of the exception occurrence".

[0065] Furthermore, the defect possibility determination unit 220 determines that the statement with the highest suspicion value indicated in the test result starting point suspicion value information 244 has a high defect possibility because it tends to be executed in failure tests and tends not to be executed in success tests. This is processing based on the conventional SBFL principle.

[0066] The example of test result origin suspicion value information 244 in Fig. 8 shows that the highest suspicion value of 1.0 has been assigned to the statements in lines 3, 4, and 5 of the source file "CreateCore" shown in Fig. 5. Therefore, in Fig. 10, the malfunction possibility value is set to "high" for lines 3, 4, and 5 of the source file "CreateCore". In addition, the reason for determining that lines 3 and 4 of "CreateCore" have a "high" malfunction possibility is shown to be that they are the "highest test-induced suspicion value points."

[0067] Here, in the case where the location of the highest test suspected value and the location of an exception overlap, as in the case of line 5 of the source file “CreateCore”, it is acceptable to indicate either the reason for determining the possibility of a malfunction for both, or the reason for determining the possibility of a malfunction for only one of them, as in Figure 10.

[0068] Furthermore, the defect possibility determination unit 220 extracts a specific type of instruction not related to the defect in the source file, and adds information indicating that the defect possibility is low. For example, it determines that a debug command in the source file is not related to the test execution result, and therefore has a low defect possibility. In the example of the source file in FIG. 5, the command “System.err.println(e.getMessage());” in the 11th and 14th lines indicates standard error output, and the command “e.printStackTrace();” in the 12th and 15th lines indicates output to the stack trace, and are both commands for debugging. Therefore, in FIG. 10, the defect possibility values ​​of the 11th, 12th, 14th, and 15th lines of the source file “CreateCore” are set to “low”. Also, the reason for the “low” defect possibility is indicated as “debug command”.

[0069] Here, regarding the order of the processing steps of the defect location identification support process 1200, the order of execution of the source file relation acquisition unit 210 (S1210) and the processing of the defect possibility determination unit 220 (S1220) may be reversed. In other words, it is sufficient if both are prepared before S1230.

[0070] When the defect possibility determination unit 220 is executed first, the source file relation acquisition unit 210, which is executed later, may read the defect possibility information 246 as an input together with the source file. When the source file relation acquisition unit 210 reads the defect possibility information 246, only the parts indicated as having a "high" defect possibility in the defect possibility information 246 may be used as the comparison source command statements to extract related command statement information.

[0071] Next, the suspicion value reassignment unit 230 calculates a suspicion value using the test execution information 243, the test result starting point suspicion value information 244, the source file relevance information 245, and the defect possibility information 246, and generates recalculated suspicion value information 247 (S1230).

[0072] Fig. 13 is a flowchart for explaining a process (hereinafter, referred to as suspicious value reassignment process 1300) performed by the suspicious value reassignment unit 230. Hereinafter, the suspicious value reassignment process 1300 for generating the recalculated suspicious value information shown in Fig. 11 will be explained with reference to Fig. 13. The recalculated suspicious value information shown in Fig. 11 represents the result of reassigning suspicious values ​​for the source file shown in Fig. 5 using the test execution information shown in Fig. 7, the test result starting suspicious value information shown in Fig. 8, the intra-source file relevance information shown in Fig. 9, and the defect possibility information shown in Fig. 10. The suspicious value reassignment unit 230 automatically starts the suspicious value reassignment process 1300 by batch processing or the like at a scheduled timing, for example.

[0073] First, the suspicious value reassignment unit 230 generates original data for the recalculated suspicious value information 247 by referring to the information in the test result starting suspicious value information 244 (S1310). Specifically, for example, data in which a column for suspicious value change content and a column for suspicious value change reason are added to the entry of the test result starting suspicious value information 244 shown in FIG. 8 is used as the original data for the recalculated suspicious value information 247.

[0074] Next, the suspicion value reassignment unit 230 assigns a suspicion value to the associated command statement of the command statement with a high probability of malfunction, and updates the recalculated suspicion value information 247 (S1320). Specifically, the associated command statement information of the command statement whose malfunction possibility information 246 indicates a "high" malfunction is extracted from the source file relevance information 245. If the recalculated suspicion value information 247 contains the corresponding command statement information, the corresponding suspicion value in the recalculated suspicion value information 247 is rewritten, and if the recalculated suspicion value information 247 does not contain the corresponding command statement information, the command statement information and the suspicion value information are added. For example, the highest suspicion value in the test result starting point suspicion value information is assigned as the suspicion value for the command statement associated with the command statement with a high probability of malfunction. A specific example is described below.

[0075] The source file relevance information shown in Fig. 9 reveals that the command statements related to the command statement on line 5 of the source file "CreateCore", which is indicated as having a "high" defect possibility in the defect possibility information shown in Fig. 10, are the command statements on lines 7 and 3 of the source file "CreateCore". Therefore, the suspicion value reassignment unit 230 assigns the highest suspicion value of 1.0 in the test result starting point suspicion value information shown in Fig. 8 to the command statements on lines 7 and 3 of the source file "CreateCore", and updates the recalculated suspicion value information.

[0076] The updated result is shown in line #4 of the example of recalculated suspicion value information in Figure 11. Note that the suspicion value of the command statement on line 3 of the source file "CreateCore" remains unchanged, since it has already been assigned the highest suspicion value of 1.0 in the test result starting suspicion value information shown in Figure 8. From the above, we can see that an appropriate suspicion value is assigned to the command statement on line 7, which is the defective part in the source file "CreateCore" shown in Figure 5.

[0077] The above operation increases the suspicion value of the command statements related to the command statements that are likely to be defective. In the above example, the highest suspicion value of 1.0 is assigned to the related command statements, but it is also possible to add a certain number of points or multiply the suspicion value by a coefficient.

[0078] Next, the suspicion value reassignment unit 230 assigns a suspicion value to the command statement having a high malfunction probability, and updates the recalculated suspicion value information 247 (S1330). Specifically, the command statement having a malfunction probability of "high" is extracted from the malfunction possibility information 246. If the recalculated suspicion value information 247 contains the corresponding command statement information, the corresponding suspicion value in the recalculated suspicion value information 247 is rewritten, and if the recalculated suspicion value information 247 does not contain the corresponding command statement information, the command statement information and the suspicion value information are added. As a calculation of the suspicion value for the command statement at the location where the exception occurred, for example, a suspicion value higher than the highest suspicion value in the test result starting point suspicion value information 244 is assigned. A specific example is shown below.

[0079] It can be seen that the statement on line 5 of the source file "CreateCore", which is indicated as having a "high" defect possibility in the defect possibility information shown in Figure 10, is the location where the exception occurred. Therefore, the suspicion value reassignment unit 230 assigns a suspicion value of 1.5, which is higher than the highest suspicion value of 1.0 in the test result starting point suspicion value information shown in Figure 8, to the statement on line 5 of the source file "CreateCore", and updates the recalculated suspicion value information. The updated result is shown in line #1 of the example of recalculated suspicion value information in Figure 11. From the above, it can be seen that a higher suspicion value has been assigned to the statement on line 5, which is the defect location in the source file "CreateCore" shown in Figure 5, than to other locations.

[0080] Next, the suspicious value reassignment unit 230 deletes the suspicious value information of the command statement with low malfunction probability held in the recalculated suspicious value information 247 (S1340). Specifically, when suspicious value information exists in the recalculated suspicious value information 247 for a command statement whose malfunction probability is indicated as "low" in the malfunction possibility information 246, the suspicious value information is deleted. A specific example is shown below.

[0081] The statements in lines 11 and 12 of the source file "CreateCore", which are indicated as having a "low" defect possibility in the defect possibility information shown in Fig. 10, are assigned a suspicion value of 0.25 in the test result starting suspicion value information shown in Fig. 8. Therefore, the suspicion value reassignment unit 230 deletes the suspicious values ​​in lines 11 and 12 of the source file "CreateCore" from the suspicious value reassignment information. The result of the deletion is shown in lines #11 and #12 of the example of recalculated suspicious value information in Fig. 11. From the above, it can be seen that suspicious values ​​are not assigned to the statements in the source file "CreateCore" shown in Fig. 5 that are not related to the test execution results and cannot be defects.

[0082] As described above, the defect location identification support device 100 according to this embodiment identifies command statements that are related to command statements such as exception occurrence points that are highly likely to be defective based on the intra-source file relevance information 245, and assigns a high suspicion value to them. This makes it possible to increase the suspicion value of command statements in defect locations and prevent them from being overlooked, compared to a method in which the suspicion value calculation results based on test results are corrected to be equivalent, thereby making the defect location identification process more efficient.

[0083] Furthermore, the defect point identification support device 100 according to the present embodiment manipulates the suspicious values ​​of the test result origin in accordance with the defect possibility information 246. This makes it possible to also handle correction of the equivalence suspicious values ​​of the test result origin suspicious value information 244.

[0084] The present invention is not limited to the above-described embodiment, and can be modified as appropriate without departing from the spirit of the present invention. [Explanation of symbols]

[0085] 100... defect location identification support device, 210... source file correlation acquisition unit, 220... defect possibility determination unit, 230... suspicious value reassignment unit, 240... information storage unit, 241... source file group, 242... test file group, 243... test execution information, 244 number of steps and result starting point suspicious value information, 245... source file correlation information, 246... defect possibility information, 247... recalculated suspicious value information

Claims

1. a source file relation acquisition unit that acquires source file relation information indicating relations between each command in a source file; a suspicion value reassignment unit that calculates a suspicion value using test execution information that holds the execution results of a test case, test result starting suspicion value information that holds a suspicion value calculated based on the number of times each statement in the source file is executed when the test case is executed, and the source file relevance information, and generates recalculated suspicion value information; The present invention is characterized in that it comprises A device to assist in identifying defective areas.

2. The source file relation acquisition unit is generating the intra-source-file relevancy information by searching and extracting at least one of a command statement having a dependency relationship with a certain command statement and a command statement having similarity to the certain command statement, which are included in the source file; The defect location identification support device according to claim 1 .

3. the test execution information includes exception occurrence location information that identifies a statement related to an exception occurrence during test execution; The suspicious value reassignment unit: A command statement related to the command statement related to the occurrence of the exception is extracted using the relevance information in the source file, and a higher suspicion value than the suspicion value described in the test result starting point suspicion value information is assigned to the command statement, thereby generating recalculated suspicion value information. The defect location identification support device according to claim 1 .

4. The test execution information includes exception occurrence location information that identifies a statement related to an exception occurrence during test execution, a defect possibility determination unit that determines a defect possibility of a statement in the source file by inputting the source file, the test execution information, and the test result starting point suspicious value information, and generates defect possibility information. The defect location identification support device according to claim 1 .

5. The malfunction possibility determination unit is The malfunction possibility information is characterized in that information indicating a high malfunction possibility is added to a statement regarding an exception occurrence during the test execution. The defect location identification support device according to claim 4.

6. The malfunction possibility determination unit is In the defect possibility information, information indicating a high defect possibility is added to a command statement having the highest suspicious value included in the test result starting suspicious value information. The defect location identification support device according to claim 4.

7. The malfunction possibility determination unit is The malfunction possibility information is characterized in that information indicating that a malfunction possibility is low is added to a specific type of command statement that is not related to the malfunction. The defect location identification support device according to claim 4.

8. The suspicious value reassignment unit: Among the command statements to which information indicating a high probability of a malfunction is added in the malfunction possibility information, a first suspicion value higher than the suspicion value described in the test result starting suspicion value information is added to the command statements regarding the occurrence of an exception during the test execution, thereby generating recalculated suspicion value information. The defect location identification support device according to claim 4.

9. The suspicious value reassignment unit: a second suspicious value, which is a suspicious value described in the test result origin suspicious value information, is assigned to a command statement, other than a command statement related to an exception occurrence during the test execution, among the command statements to which information indicating a high probability of a malfunction is assigned in the malfunction possibility information, to generate recalculated suspicious value information. The defect location identification support device according to claim 4.

10. The suspicious value reassignment unit: a command statement related to a command statement related to an exception occurrence during test execution is extracted using the intra-source file correlation information, and a third suspicion value higher than the suspicion value described in the test result starting suspicion value information is assigned to the command statement, thereby generating recalculated suspicion value information. The defect location identification support device according to claim 4.

11. The suspicious value reassignment unit: a fourth suspicious value lower than the suspicious value described in the test result starting suspicious value information is assigned to a command statement to which information indicating a low probability of a defect is assigned in the defect possibility information, thereby generating recalculated suspicious value information. The defect location identification support device according to claim 4.

12. A defect location identification method for identifying a defect location in a source file using an information processing device, comprising: Using source file correlation information including correlation information between each command in the source file, test execution information including information on an exception occurrence location when the test file is executed, and test result origin suspicious value information in which a suspicious value generated by the SBFL technique is assigned to a command in the source file, extracting a command statement that is highly related to the command statement corresponding to the exception occurrence location information by using the intra-source file relevance information, and assigning a suspicion value to the extracted command statement that is higher than the suspicion value assigned by the test result starting point suspicion value information; A method to assist in identifying defective areas.

Citation Information

Patent Citations

  • Software program fault position specification

    JP2019021303A

  • Bug identification support device, bug identification support method and program

    JP2021005171A

  • US2021/75812A1