How to Calculate Software Metrics for Multiple Languages Using Open Source Parsers

Source code metrics help to evaluate the quality of the code, for example, to detect the most complex parts of the program. When writing a system which calculates metrics, especially when it has to support multiple source code languages, the biggest problem which arises is the creation of parsers for each supported language. In this paper we suggest an unusual Open Source solution, that avoids creating such parsers from scratch. We suggest and explain how to use parsers contained in the Eclipse IDE as parsers that support contemporary language features, are actively maintained, can recover from errors, and provide not just the abstract syntax tree, but the whole type information of the source program. The findings described in this paper provide to practitioners a way to use Open Source parsers without the need to deal with parser generators, or to write a parser from scratch.

[1]  Marco Scotto,et al.  A non-invasive approach to product metrics collection , 2006, J. Syst. Archit..

[2]  Damian Conway,et al.  A modest proposal: C++ resyntaxed , 1996, SIGP.

[3]  Giancarlo Succi,et al.  The dark side of agile software development , 2012, Onward! 2012.

[4]  Alberto Sillitti,et al.  Using the Eclipse C/C++ Development Tooling as a Robust, Fully Functional, Actively Maintained, Open Source C++ Parser , 2012, OSS.

[5]  Marco Scotto,et al.  Agile Technologies in Open Source Development , 2009 .

[6]  Alberto Sillitti,et al.  Introducing the OpenSource Maturity Model , 2009, 2009 ICSE Workshop on Emerging Trends in Free/Libre/Open Source Software Research and Development.

[7]  Alberto Sillitti,et al.  Monitoring the development process with Eclipse , 2004, International Conference on Information Technology: Coding and Computing, 2004. Proceedings. ITCC 2004..

[8]  Alberto Sillitti,et al.  Visualizing software evolution with lagrein , 2008, OOPSLA Companion.

[9]  Dennis Ritchie,et al.  The development of the C language , 1993, HOPL-II.

[10]  Alberto Sillitti,et al.  Measures for mobile users: an architecture , 2004, J. Syst. Archit..

[11]  Tommi Mikkonen,et al.  Open Source Systems: Long-Term Sustainability , 2012, IFIP Advances in Information and Communication Technology.

[12]  Marco Scotto,et al.  Lagrein: Visualizing User Requirements and Development Effort , 2007, 15th IEEE International Conference on Program Comprehension (ICPC '07).

[13]  Alberto Sillitti,et al.  A multivariate classification of open source developers , 2013, Inf. Sci..