Metrics

We have the following vulnerability discovery metrics implemented in the Samaritan project. If you want to know more about a specific metric, please click the name of the metric.

Name Languages Definition
Churn Independent The total number of lines added, modified, and deleted throughout the history of a file. [3]
Collaboration Centrality Independent The maximum of the edge centrality of edges representing files in a collaboration network. A collaboration network is an unweighted and undirected graph in which nodes represent developers and edges represent files. An edge exists between two developers if they both changed at least one file. [1]
Cyclomatic Complexity C/C++, C#, Ada, Basic, Fortran, Java, Jovial, Pascal, PL/M, Python, VHDL, Cobol, Web The number of unique decision paths through a function. [2]
Contribution Centrality Independent The node betweenness centrality of nodes representing files in a contribution network. A contribution network is a weighted and undirected bipartite graph with two sets of nodes: files and developers. An edge exists between a developer node and a file node if the developer made a change (commit) to the file. The weight of the edge is the number of changes a single developer made to a particular file. [1]
Nesting C/C++, C#, Ada, Basic, Fortran, Java, Jovial, Pascal, Python, Web The maximum nesting level of control structures in a function. [2]
Number of Inputs C/C++, C#, Fortran, Java The number of inputs that a function uses. [2]
Number of Outputs C/C++, C#, Fortran, Java The number of functions that a function calls. [2]
Number of Paths C/C++, C#, Ada, Basic, Fortran, Java, Jovial, Pascal, Python, Web The number of unique decision paths through a function. [2]
Source Lines of Code C/C++, C#, Ada, Basic, Fortran, Java, Jovial, Pascal, PL/M, Python, VHDL, Cobol, Web The number of source lines of code in a file. [3]

Reference(s)

[1] Andrew Meneely and Laurie Williams. 2009. Secure Open Source Collaboration: An Empirical Study of Linus’ Law. In Proceedings of the 16th ACM Conference on Computer and Communications Security (CCS '09). New York, NY, USA, 453–462. https://doi.org/10.1145/1653662.1653717

[2] Awad Younis, Yashwant Malaiya, Charles Anderson, and Indrajit Ray. 2016. To Fear or Not to Fear That is the Question: Code Characteristics of a Vulnerable Function with an Existing Exploit. In Proceedings of the 6th ACM Conference on Data and Application Security and Privacy (CODASPY '16). New York, NY, USA, 97–104. https://doi.org/10.1145/2857705.2857750

[3] Thomas Zimmermann, Nachiappan Nagappan, and Laurie Williams. 2010. Searching for a Needle in a Haystack: Predicting Security Vulnerabilities for Windows Vista. In Proceedings of the 3rd International Conference on Software Testing, Verification and Validation (ICST '10). 421-428. https://doi.org/10.1109/ICST.2010.32