Research Article

Software Defect Prediction via Attention-Based Recurrent Neural Network

Table 1

Description of the 20 static code metrics.

Metric NameSymbolDescription

Weighted methods per classWMCThe number of methods in the class
Depth of inheritance treeDITThe position of the class in the inheritance tree
Number of childrenNOCThe number of immediate descendants of the class
Coupling between object classesCBOThe value increases when the methods of one class access services of another
Response for a classRFCNumber of methods invoked in response to a message to the object
Lack of cohesion in methodsLCOMNumber of pairs of methods that cannot share a reference to an instance variable
Lack of cohesion in methods, different from LCOMLCOM3If 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 methodsNPMThe number of all the methods in a class that are declared as public
Data access metricDAMRatio of the number of private (protected) attributes to the total number of attributes
Measure of aggregationMOAThe number of data declarations (class fields) whose types are user-defined classes
Measure of function abstractionMFANumber of methods inherited by a class plus number of methods accessible by member methods of the class
Cohesion among methods of classCAMSummation 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 couplingICThe number of parent classes to which a given class is coupled
Coupling between methodsCBMTotal number of new/redefined methods to which all the inherited methods are coupled
Average method complexityAMCThe number of JAVA byte codes
Afferent couplingsCaHow many other classes use the specific class
Efferent couplingsCeHow many other classes are used by the specific class
Maximum McCabeMax (CC)Maximum McCabe’s cyclomatic complexity values of methods in the same class
Average McCabeAvg (CC)Average McCabe’s cyclomatic complexity values of methods in the same class
Lines of codeLOCMeasures the volume of the code