The present invention relates to a method and associated system for using multiple metrics to inspect source code for defects.
Identifying defective data typically comprises an inefficient process with little flexibility. Accordingly, there exists a need in the art to overcome at least some of the deficiencies and limitations described herein above.
The present invention provides a method comprising: receiving, by a computing system, a set of source code files associated with a specified project; retrieving, by the computing system, metrics data comprising software metrics associated with the source code files; generating, by the computing system, a set comprising the software metrics; generating, by the computing system based on the software metrics, first evaluation scores associated with the source code files; generating, by the computing system, a first graph displaying the first evaluation scores; first presenting, by the computing system to a user the first graph; receiving, by the computing system from the user in response to the first presenting, a selection of a first source code file of the source code files; calculating, by the computing system based on the first source code file, parameter values associated with an evaluation function used to calculate second evaluation scores associated with the source code files; generating, by a computer processor of the computing system, the second evaluation scores, wherein the generating the second evaluation scores comprises enabling the evaluation function using the parameter values; generating, by the computing system, a second graph displaying the second evaluation scores; and second presenting, by the computing system to the user, the second graph.
The present invention provides a method comprising: receiving, by a computing system, a first set of source code files associated with a specified project; retrieving, by the computing system, first metrics data comprising first software metrics associated with the first source code files; generating, by the computing system, a first set comprising the first software metrics; generating, by the computing system, first evaluation scores associated with the first source code files; generating, by the computing system, a first graph displaying the first evaluation scores; first presenting, by the computing system to a user the first graph; retrieving, by the computing system, a list of reference projects; second presenting, by the computing system to the user, the list of reference projects; receiving, by the computing system from the user in response to the second presenting, a selection for a first reference project of the list of reference projects; retrieving, by the computing system, second metrics data comprising second software metrics associated with second source code files associated with the first reference project; generating, by the computing system based on the second source code files associated with the first reference project, parameter values associated with an evaluation function used to calculate second evaluation scores and third evaluation scores associated with the first source code files and the second source code files; generating, by a computer processor of the computing system, the second evaluation scores, wherein the generating the second evaluation scores comprises enabling an evaluation function using the parameter values and the second software metrics; generating, by the computing system, a second graph displaying the second evaluation scores; and third presenting, by the computing system to the user, the second graph.
The present invention advantageously provides a simple method and associated system capable of identifying defective data.
System 5 of
Software application 18 (of
1. A user may confirm source code files included in a project for inspection (or a project implemented in the past) using first display section 202 or second display section 204. For example, the user may select (e.g., by using a mouse to clicks any one of points 202b or 204b) a source code file. The selected source code file is called a reference source code file. Software application 18 enables a method to change parameter values for an evaluation function in response to a selected reference source code file.
2. First display section 202 and second display section 204 provides a function for selecting a reference source code file. When a source code file is selected, an editor is enabled.
3. A user may confirm the names of past projects (or their profiles) using third display section 208 and selects a project. The selected project is called a reference project. Based on all source code files included in the reference project, an evaluation function that is used for the target project for inspection is determined. Using linear programming, parameter values are found so that the sum of evaluation scores of all source code files included in the reference project will be the worst. By employing the evaluation function based on parameter values, an evaluation score of each source code file in the project targeted for inspection is calculated.
User interface 200 in combination with computing system 10 of
1. Displaying a list of inspected projects in third display section 208.
2. Determining parameter values for an evaluation function in accordance with a source code file specified by a user. The parameter values will generate a worst evaluation score of the source code file based on obtained metrics data.
3. Allowing a user to select a reference source code file by selecting one of points 202b or 204b indicating a source code file.
4. Determining parameter values for an evaluation function based on the reference source code file.
5. Calculating an evaluation score for each source code file of a project for inspection and a reference project and displaying results in the windows in first display section 202 and second display section 204.
6. Determining parameter values for an evaluation function in accordance with the reference project specified by the user. The parameter values are determined such that a sum of evaluation scores of all source code files included in the project will be the worst based on an obtained evaluation function and metrics data.
7. Allowing a user to select a reference project from display section 208.
8. Determining parameter values for an evaluation function based on source code files of the reference project.
9. Calculating an evaluation score for each source code file of the project for inspection and reference project.
The following example illustrates an implementation scenario for enabling a process for inspecting source code during software development:
In this example, it is assumed that a number of the source code files of the project for inspection are represented by I and K metrics are obtained for each source code file. xi,1, . . . , xi,K are given for K metrics of the source code file number i. It is additionally assumed that for each metric, the larger the value, the lower the quality. A relationship between an evaluation score vi of an ith source code file and metrics xi,1, . . . , xi,K is expressed by the following equation 1:
Equation 1 (i.e., an evaluation function) is defined as a weighted sum of metrics and a constant. By changing values of parameters a1, . . . , aK, b (b is a constant), equation 1 expresses various evaluation functions (a linear expression). Alternatively, nonlinear relationships (e.g., a gradual increasing type, a gradual decreasing type, an S-shaped type) may be used. In this case (i.e., by appropriately changing a scale for metrics), they are expressed by a linear expression. In order to calculate parameter values for the evaluation function (i.e., equation 1), it is assumed that the user selects the i0th source code file as a reference source code file. In the following equation 2, the following constraint is introduced: an evaluation score of each source code file is 0 or more and 1 or less and based on the following equation 2, the values of parameters a1, . . . , aK for Equation 1 are calculated.
Equation 2 is used to determine values of parameters a1, . . . , aK so that the evaluation score of the reference source code file will be the maximum (i.e. the worst). After parameter values are calculated, an evaluation score vi for each source code file i (i.e., apart from the reference source code file) is calculated using equation 1. When the user specifies another reference source code file, values of parameters a1, . . . , aK are determined so that its evaluation score will comprise a maximum score. It may be interpreted that an evaluation equation obtained by means of these methods characterizes the defects of the reference source code file. Such an evaluation function may be obtained by a click operation on user interface 200. Each evaluation score for each source code file is calculated using Equation 1 and displayed via user interface 200.
In order to calculate parameter values, a set of source code file numbers comprises the following variables defined as follows:
1. A set R is defined as a collection of source code file numbers of a reference project selected by a user.
2. A set T is defined as a collection of source code file numbers of a project for inspection.
3. A number of source code files I is included in the project for inspection and therefore T={1, . . . , I}. Where both the reference project and project for inspection are a combined a set of source code file numbers expressed as T∪R .
The following constraint (with respect to equation 3 below) is introduced: an evaluation score for each source code file is 0 or more and 1 or less and based on equation 3 below, the values of parameters a1, . . . , aK for Equation 1 are calculated.
Equation 3 is used to calculate values of parameters a1, . . . , aK so that the sum of evaluation scores in the reference project will be a maximum (i.e. the worst). After parameter values are calculated, an evaluation score vi for each source code file i of the reference project is determined by using Equation 1. When the user specifies another reference project, values of parameters a1, . . . , aK are determined so that the sum of its evaluation scores will comprise a maximum.
In equation 4, K equals a number of software metrics, k equals a number of iterations enabled for retrieving the metrics data, x is a metric, v′i is the average of the metrics, and vi is a first evaluation score.
In step 318, the computing system generates a first graph displaying the first evaluation scores (e.g., see graph 202a in
The objective function comprises a linear objective function and a set of linear inequality constraints. The linear objective function is configured to be solved by a linear programming technique as follows:
The objective of the linear objective function is to find the value of parameters a1, . . . , aK of equation 1 as described with respect to
There are I+K constraints so that the evaluation scores of all source code files are between zero and 1 as follows:
a1x1,1+ . . . +aKx1,K≦1−b,
a1x2,1+ . . . +aKx2,K≦1−b,
. . .
a1xI,1+ . . . +aKxI,K≦1−b,
a1≧0,
a2≧0,
. . .
aK≧0.
b is a constant value where 0≦b<1 holds. Finding values of parameters a1, . . . , aK so that the objective function: a1xi
In step 328, the computing system calculates second evaluation scores by enabling an evaluation function (i.e., equation 1 as described with respect to
where:
1. vi equals each evaluation score of the second evaluation scores.
2. 0≦vi≦1
3. K equals a number of the software metrics.
4. k equals a number of iterations enabled for retrieving the metrics data.
5. ak equals each parameter value of the parameter values.
6. xi,k equals the software metrics
7. b equals a constant (i.e., where 0≦b<1).
In step 332, the computing system generates and presents a second graph displaying the second evaluation scores (e.g., see graph 202b in
In equation 4, K equals a number of the first software metrics, k equals a number of iterations enabled for retrieving the first metrics data, x is a metric, v′i is the average of the metrics, and vi is a first evaluation score.
In step 418, the computing system generates a first graph displaying the first evaluation scores (e.g., see graph 202a in
The evaluation function maximizes a sum of evaluation scores
of the second source files associated with the first reference project. The objective function comprises a linear objective function and a set of linear inequality constraints. The linear objective function is configured to be solved by a linear programming technique as described with reference to
Still yet, any of the components of the present invention could be created, integrated, hosted, maintained, deployed, managed, serviced, etc. by a service provider who offers to for inspect source code during software development. Thus the present invention discloses a process for deploying, creating, integrating, hosting, maintaining, and/or integrating computing infrastructure, comprising integrating computer-readable code into the computer system 90, wherein the code in combination with the computer system 90 is capable of performing a method for inspecting source code during software development. In another embodiment, the invention provides a method that performs the process steps of the invention on a subscription, advertising, and/or fee basis. That is, a service provider, such as a Solution Integrator, could offer to inspect source code during software development. In this case, the service provider can create, maintain, support, etc. a computer infrastructure that performs the process steps of the invention for one or more customers. In return, the service provider can receive payment from the customer(s) under a subscription and/or fee agreement and/or the service provider can receive payment from the sale of advertising content to one or more third parties.
While
While embodiments of the present invention have been described herein for purposes of illustration, many modifications and changes will become apparent to those skilled in the art. Accordingly, the appended claims are intended to encompass all such modifications and changes as fall within the true spirit and scope of this invention.
This application is a continuation application claiming priority to Ser. No. 12/561,339 filed Sep. 17, 2009.
Number | Date | Country | |
---|---|---|---|
Parent | 12561339 | Sep 2009 | US |
Child | 13929192 | US |