Reading beside the lines: Indentation as a proxy for complexity metrics

被引:19
作者
Hindle, Abram [1 ]
Godfrey, Michael W. [1 ]
Holt, Richard C. [1 ]
机构
[1] Univ Waterloo, Waterloo, ON N2L 3G1, Canada
来源
PROCEEDINGS OF THE 16TH IEEE INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION | 2008年
关键词
D O I
10.1109/ICPC.2008.13
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Maintainers face the daunting task of wading through a collection of both new and old revisions, trying to ferret out revisions which warrant personal inspection. One can rank revisions by size/lines of code (LOC), but often, due to the distribution of the size of changes, revisions will be of similar size. If we can't rank revisions by LOC perhaps we can rank by Halstead's and McCabe's complexity metrics? However, these metrics are problematic when applied to code fragments (revisions) written in multiple languages: special parsers are required which may not support the language or dialect used; analysis tools may not understand code fragments. We propose using the statistical moments of indentation as a lightweight, language independent, revision/diff friendly metric which actually proxies classical complexity metrics. We have extensively evaluated our approach against the entire CVS histories of the 278 of the most popular and most active SourceForge projects. We found that our results are linearly correlated and rank-correlated with traditional measures of complexity, suggesting that measuring indentation is a cheap and accurate proxy for code complexity of revisions. Thus ranking revisions by the standard deviation and summation of indentation will be very similar to ranking revisions by complexity.
引用
收藏
页码:133 / 142
页数:10
相关论文
共 16 条
[1]   A STYLE ANALYSIS OF C-PROGRAMS [J].
BERRY, RE ;
MEEKINGS, BAE .
COMMUNICATIONS OF THE ACM, 1985, 28 (01) :80-88
[2]  
CHEN X, 2004, SHARED INFORM PROGRA
[3]   USING METRICS TO EVALUATE SOFTWARE SYSTEM MAINTAINABILITY [J].
COLEMAN, D ;
ASH, D ;
LOWTHER, B ;
OMAN, P .
COMPUTER, 1994, 27 (08) :44-49
[4]  
CONWAY D, 2005, PERL BEST PRACTICE
[5]  
FINDLER RB, 2007, PLTTR20073V371 PLT S
[6]  
GERMAN DM, 2005, P 11 INT SOFTW METR
[7]   DEBUGGING EFFORT ESTIMATION USING SOFTWARE METRICS [J].
GORLA, N ;
BENANDER, AC ;
BENANDER, BA .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1990, 16 (02) :223-231
[8]  
Halstead M. H., 1977, Elements of Software Science (Operating and programming systems series
[9]  
Herraiz I., 2007, 4 INT WORKSH MIN SOF, P21
[10]  
Mathis R. F., 1975, SIGPLAN Notices, V10, P33, DOI 10.1145/987278.987282