Identifying code that exhibits ideal logging behavior
First Claim
1. A method for identifying methods which exhibit ideal logging behavior in source code, said method comprising:
- under control of one or more computer systems configured with executable instructions,processing the source code of a computer program to identify a plurality of methods that contain one or more log printing statements;
processing a commit history of the source code to identify a frequency of modifications performed on the one or more log printing statements for each of the plurality of methods;
storing each of the plurality of methods into a static call graph in memory of the one or more computing systems, wherein each node of the static call graph represents a method and each edge between nodes in the static call graph represents a function call;
assigning, to each node of the static call graph a numerical weight to indicate a log rank of the method resented by the node, the numerical weight computed based at least in part on the frequency of modifications performed on the one or more log printing statements; and
ranking the nodes of the static call graph according to the numerical weight indicating the log rank; and
displaying the method represented by the node having the highest numerical weight on a display device, wherein processing the commit history further comprises restricting the frequency of modifications used to compute the numerical weight to only changes that include verbosity level changes, and addition and deletion of log printing statements.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques are described for identifying the ideal or preferred logging behavior to be followed in a software development project. A numerical weight is computed for each method in the source code that can be used to rank the logging behavior of that method. The numerical weight is computed in such a way that the methods whose log printing statements have been modified more frequently receive higher numerical weights. The assumption is that since most logging enhancements are done as after thoughts during code reviews or while fixing bugs, the ideal logging behavior will be exhibited by those methods whose logging behavior was modified the most frequently. Once the methods have been ranked according to the numerical weight, the highest ranking methods can be used to provide insight to developers about the ideal logging behavior for the project.
-
Citations
18 Claims
-
1. A method for identifying methods which exhibit ideal logging behavior in source code, said method comprising:
under control of one or more computer systems configured with executable instructions, processing the source code of a computer program to identify a plurality of methods that contain one or more log printing statements; processing a commit history of the source code to identify a frequency of modifications performed on the one or more log printing statements for each of the plurality of methods; storing each of the plurality of methods into a static call graph in memory of the one or more computing systems, wherein each node of the static call graph represents a method and each edge between nodes in the static call graph represents a function call; assigning, to each node of the static call graph a numerical weight to indicate a log rank of the method resented by the node, the numerical weight computed based at least in part on the frequency of modifications performed on the one or more log printing statements; and ranking the nodes of the static call graph according to the numerical weight indicating the log rank; and displaying the method represented by the node having the highest numerical weight on a display device, wherein processing the commit history further comprises restricting the frequency of modifications used to compute the numerical weight to only changes that include verbosity level changes, and addition and deletion of log printing statements. - View Dependent Claims (2, 3, 4, 5, 6)
-
7. A computing device, comprising:
-
at least one processor; and memory including instructions that, when executed by the at least one processor, cause the computing device to; process the source code of a computer program to identify a plurality of methods that contain one or more log printing statements; process a commit history of the source code to identify a frequency of modifications performed on the one or more log printing statements for each of the plurality of methods; store each of the plurality of methods into a static call graph in the memory, wherein each node of the static call graph represents a method and each edge between nodes in the static call graph represents a function call; assign, to each node of the static call graph a numerical weight to indicate a log rank of the method represented by the node, the numerical weight computed based at least in part on a frequency of modifications performed on the one or more log printing statements; and rank the nodes of the static call graph according to the numerical weight indicating the log rank; and display the method represented by the node having the highest numerical weight on a display device, wherein processing the commit history further comprises restricting the frequency of modifications used to compute the numerical weight to only changes that include verbosity level changes, and addition and deletion of log printing statements. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A non-transitory computer readable storage medium comprising one or more sequences of instructions, the instructions when executed by one or more processors causing the one or more processors to execute the operations of:
-
processing the source code of a computer program to identify a plurality of methods that contain one or more log printing statements; processing a commit history of the source code to identify a frequency of modifications performed on the one or more log printing statements for each of the plurality of methods; storing each of the plurality of methods into a static call graph in the non-transitory computer readable storage medium, wherein each node of the static call graph represents a method and each edge between nodes in the static call graph represents a function call; assigning, to each node of the static call graph a numerical weight to indicate a log rank of the method represented by the node, the numerical weight computed based at least in part on a frequency of modifications performed on the one or more log printing statements; and ranking the nodes of the static call graph according to the numerical weight indicating the log rank; and displaying the method represented by the node having the highest numerical weight on a display device, wherein processing the commit history further comprises restricting the frequency of modifications used to compute the numerical weight to only changes that include verbosity level changes, and addition and deletion of log printing statements. - View Dependent Claims (14, 15, 16, 17, 18)
-
Specification