Skip to main content
zenodoopen

Impact of Methodological Choices on the Analysis of Code Metrics and Maintenance

<p>The repo-data folder contains 53 <code>.json</code> files, each corresponding to one of the 53 Java open-source projects. Each file contains various metrics for methods in the project.</p> <p>&nbsp;</p> <pre><code> { "hawtio-3976.json": { "Age": 794, "sloc": [11,11,11], "slocAsItIs": [11,14,14], "slocNoCommentPretty": [11,11,11], "diffSizes": [0,7,0 ], "bodychanges": [0,1,0], "newAdditions": [0,5,0], "isGetter": [false,false,false], "isSetter": [false,false,false], "changeDates": [0,3,794], "isEssentialChange": [false,true,false], "isBuggy": [false,false,false], "changeTypes": ["Yintroduced","Ybodychange","Yfilerename"], "filename": "hawtio-3976.json", "authors": ["X","Y","Z"], "editDistance": [0, 68, 0], "repo": "hawtio" }, "method_id": {...}, "method_id": {...} } </code></pre> <p>&nbsp;</p> <p>The above method with id <code>hawtio-3976.json</code> has total 3 revisions which is why the array of values for a particular metric (e.g., sloc: <code>[11,11,11]</code>) are of length 3. <code>Index 0</code> of the array represents the introduction value of a particular metric for the above method.</p> <div> <h3>Description of the metrics</h3> </div> <ul> <li><code>Age</code>: Age of the method in days</li> <li><code>sloc</code>: Source line of code of a method without comment and blank lines</li> <li><code>slocAsItIs</code>: Source line of code of a method with comment and blank lines</li> <li><code>slocNoCommentPretty</code>: Source line of code pretty printed without comment and blank lines</li> <li><code>diffSizes</code>: Total number of lines added + removed in git <code>diff</code></li> <li><code>bodychanges</code>: Contains value 0 or 1; where 1 implies occurrence of body change</li> <li><code>newAdditions</code>: Total number of lines added in git <code>diff</code></li> <li><code>isGetter</code>: Contains <code>true</code> or <code>false</code>; where <code>true</code> indicates it is a <code>get</code> method</li> <li><code>isSetter</code>: Contains <code>true</code> or <code>false</code>; where <code>true</code> indicates it is a <code>set</code> method</li> <li><code>changeDates</code>: Contains the date difference in days from when the method was introduced. Index <code>0</code> is always 0 which indicates the introduction date</li> <li><code>isEssentialChange</code>: Contains <code>true</code> or <code>false</code>; where <code>true</code> indicates it is an essential change. Essential change includes: <code>Ybodychange</code>, <code>Ymodifierchange</code>, <code>Yexceptionschange</code>, <code>Yrename</code>, <code>Yparameterchange</code>, <code>Yreturntypechange</code> and <code>Yparametermetachange</code> detected by <code>CodeShovel</code></li> <li><code>isBuggy</code>: Contains <code>true</code> or <code>false</code>; where <code>true</code> indicates the method bug was fixed at a particular revision</li> <li><code>changeTypes</code>: All transformations applied to the method at each revision. The full list of transformation that is detected by <code>CodeShovel</code> are: <code>Ybodychange</code>, <code>Ymodifierchange</code>, <code>Yexceptionschange</code>, <code>Yrename</code>, <code>Yparameterchange</code>, <code>Yreturntypechange</code>, <code>Yparametermetachange</code>, <code>Yannotationchange</code>, <code>Ydocchange</code>, <code>Yformatchange</code>, <code>Yfilerename</code> and <code>Ymovefromfile</code></li> <li><code>filename</code>: It is the method <code>id<br></code> <p><strong>bugData</strong> folder contains 53 .json files with bug information, each belonging to one of the 53 Java open-source projects. The sample JSON schema of a file is given below:</p> <pre><code>{ "hawtio-3976.json":{ "exactBug0Match": [false, false, false], "exactBug1Match": [false, false, false], "exactBug2Match": [false, false, false], "exactBug3Match": [false, false, false], "regExBug0": [false, false, false], "regExBug1": [false, false, false], "regExBug2": [false, false, false], "regExBug3": [false, false, false] }, "method_id": {...}, "method_id": {...}, }</code></pre> <p>The above method can be mapped to its metrics dataset using the method_id. For e.g., the above method with id hawtio-3976.json in bugData/hawtio.jsonthat has 3 revision can be found in the metric dataset using the same id hawtio-3976.json in the file repo-data/hawtio.json.<br>Description of bug dataset</p> <p>Each key in the above example contains value true or false indicating if a method was buggy or not at each revision. The "hawtio-3976.json method has 3 revisions (including method's introduction) which is why the array length is 3. The keys in the above json output represent bug-fix classification based on buggy keywords adopted from prior work.</p> <p>We identified bug-fix commit using two approaches:</p> <p>&nbsp; &nbsp; Exact case insensitive match of buggy keywords from the commit message (keys prefix wih exact represent this)<br>&nbsp; &nbsp; Partial case insensitive substring match (using regular expression) excluding words that ends with fix or bug. (keys prefix with regEx represent this)</p> <p>&nbsp; &nbsp; Bug0: This is the approach that we have used for classifying bug-fix commit. Buggy keyword list: <strong>["error", "bug", "fixes", "fixing", "fix", "fixed", "mistake", "incorrect", "fault", "defect", "flaw"]</strong><br>&nbsp; &nbsp; Bug1: Same keyword list as exactBug0Match with the addition of keyword issues<br>&nbsp; &nbsp; Bug2: Buggy keyword list from prior work: <strong>["bug", "fix", "error", "issue", "crash", "problem", "fail", "defect", "patch"]</strong><br>&nbsp; &nbsp; Bug3: Buggy keyword list from prior work: <strong>["error", "bug", "fix", "issue", "mistake", "incorrect", "fault", "defect", "flaw", "type"]</strong></p> </li> </ul>

ShareScore

32/100

Overall dataset sharing score

Score breakdown

These five areas show where the dataset supports — or may limit — practical reuse.

Stewardship
4
Harmonization
4
Access
16
Reuse readiness
8
Engagement
0