Measuring quality of software modularization
AssigneeInfosys Limited
InventorsSantonu Sarkar, Girish Maskeri Rama, Nagaraja Nanjegowda Siddaramappa, Avinash C. Kak, Shubha Ramachandran
Life of this patent
Estimating the term…
Abstract
Quality of modularization of source code is tested using different perspectives such as a structural modularity perspective, an architectural modularity perspective, a size perspective, and a similarity of purpose perspective. A history of changes in modularization may be kept such that the degree to which given source code is well-modularized can be determined over time. The changes made to the code by individual programmers may be kept, such that the degree to which their coding enhanced or harmed modularization may be tracked.
Claims31
A method for identifying degree of modularization of software source code comprising:
- receiving source code;
- measuring modularization quality of the source code;
- and
- generating results of the source code modularization quality evaluation;
- wherein measuring modularization quality of the source code comprises:
- determining a size-based metric which measures uniformity of module sizes based at least on a deviation from a uniform size constraint;
- determining an architectural metric which measures organization of modules into hierarchical partitions, wherein determining the architectural metric comprises determining a layer organization index comprising dividing a number of calls made from an upper layer of modules to modules of a lower layer by a number of calls made to the modules of the lower layer excluding interlayer calls;
- determining at least one more metric, wherein the at least one more metric comprises:
- a structural metric which measures function-call traffic through an Applications Programming Interface (API) of at least one module;
- or
- a similarity of purpose metric which measures similarity of purpose of groupings within the source code.
One or more computer-readable storage media having computer-executable instructions stored thereon, the computer-executable instructions causing a computer to perform a method, the method comprising:
- receiving source code;
- measuring modularization quality of the source code;
- and
- generating results of the source code modularization quality evaluation;
- wherein measuring modularization quality of the source code comprises:
- determining a size-based metric which measures uniformity of module sizes based at least on a deviation from a uniform size constraint;
- determining an architectural metric which measures organization of modules into hierarchical partitions, wherein determining the architectural metric comprises determining a layer organization index comprising dividing a number of calls made from an upper layer of modules to modules of a lower layer by a number of calls made to the modules of the lower layer excluding interlayer calls;
- and
- determining at least one more metric, wherein the at least one more metric comprises:
- a structural metric which measures function-call traffic through an Applications Programming Interface (API) of at least one module;
- an architectural metric which measures organization of modules into hierarchical partitions;
- or
- a similarity of purpose metric which measures similarity of purpose of groupings within the source code.
A computer-implemented system for determining modularization quality metrics for source code comprising modules, the modules comprising:
- a coupling-based structural metric module with an application programming interface (API) operationally able to calculate a metric which measures function-call traffic through the API of the at least one module based at least on a totaling of function calls made by the at least one module and a totaling of a number of API function calls made by the at least one module;
- an architectural metric module operationally able to calculate a metric which measures organization of source code modules into hierarchical partitions, wherein calculating the metric comprises determining a layer organization index comprising dividing a number of calls made from an upper layer of modules to modules of a lower layer by a number of calls made to the modules of the lower layer excluding interlayer calls;
- and
- at least one further module with an API, comprising:
- a size-based metric module operationally able to calculate a metric which measures uniformity of module sizes in relation to total size of the source code;
- or
- a similarity of purpose metric module operationally able to calculate a metric which measures similarity of purpose of groupings within the source code.
A computer-enabled method, comprising:
- by a computer:
- measuring modularity of at least a portion of source code, producing a first modularity result, wherein measuring modularity of the at least the portion of source code comprises determining a layer organization index comprising dividing a number of calls made from an upper layer of modules to modules of a lower layer by a number of calls made to the modules of the lower layer excluding interlayer calls;
- measuring modularity of a changed portion of the source code, producing a second modularity result;
- determining which changes in the changed portion of the source code produced a modularity change between the first modularity result and the second modularity result;
- and
- producing a report showing at least one changed portion of the source code that produced at least one modularity change between the first modularity result and the second modularity result.
A method for identifying degree of modularization of software source code comprising:
- receiving source code;
- measuring modularization quality of the source code;
- and
- generating results of the source code modularization quality evaluation;
- wherein measuring modularization quality of the source code comprises:
- determining metrics, wherein the metrics comprise:
- a structural metric which measures function-call traffic through an Applications Programming Interface (API) of at least one module based at least on a totaling of function calls made by the at least one module and a totaling of a number of API function calls made by the at least one module;
- a size-based metric which measures uniformity of module sizes within a specified portion of source code based at least on the average size of the modules within the specified portion of source code and a standard deviation;
- an architectural metric which measures organization of modules into hierarchical partitions, wherein the hierarchical partitions comprise differently leveled layers, and determining the architectural metric comprises calculating a number of calls to modules of a lower layer from a higher layer of modules divided by a number of external calls determined by a totaling of a number of calls to the modules of the lower layer from different layers including the higher layer of modules and excluding interlayer calls, the lower layer comprising a different portion of the modules than a portion of modules of the higher layer;
- and
- a similarity of purpose metric which measures similarity of purpose of groupings within the source code, wherein determining the similarity of purpose metric comprises determining, for at least one function of the source code, a frequency distribution of concepts that comprise words found in the source code.
Dependencies are inferred from the claim text.