Software Defect Prediction via Attention-Based Recurrent Neural Network
Table 1
Description of the 20 static code metrics.
Metric Name
Symbol
Description
Weighted methods per class
WMC
The number of methods in the class
Depth of inheritance tree
DIT
The position of the class in the inheritance tree
Number of children
NOC
The number of immediate descendants of the class
Coupling between object classes
CBO
The value increases when the methods of one class access services of another
Response for a class
RFC
Number of methods invoked in response to a message to the object
Lack of cohesion in methods
LCOM
Number of pairs of methods that cannot share a reference to an instance variable
Lack of cohesion in methods, different from LCOM
LCOM3
If m and a are the number of methods and attributes in a class number and is the number of methods accessing an attribute, then
Number of public methods
NPM
The number of all the methods in a class that are declared as public
Data access metric
DAM
Ratio of the number of private (protected) attributes to the total number of attributes
Measure of aggregation
MOA
The number of data declarations (class fields) whose types are user-defined classes
Measure of function abstraction
MFA
Number of methods inherited by a class plus number of methods accessible by member methods of the class
Cohesion among methods of class
CAM
Summation of the number of different types of method parameters in every method divided by the multiplication of the number of different method parameter types in whole class and number of methods
Inheritance coupling
IC
The number of parent classes to which a given class is coupled
Coupling between methods
CBM
Total number of new/redefined methods to which all the inherited methods are coupled
Average method complexity
AMC
The number of JAVA byte codes
Afferent couplings
Ca
How many other classes use the specific class
Efferent couplings
Ce
How many other classes are used by the specific class
Maximum McCabe
Max (CC)
Maximum McCabe’s cyclomatic complexity values of methods in the same class
Average McCabe
Avg (CC)
Average McCabe’s cyclomatic complexity values of methods in the same class