Software Cartography: thematic software visualization with consistent layout
Journal of Software Maintenance and Evolution: Research and Practice - Working Conference on Reverse Engineering (WCRE 2008)
Data & Knowledge Engineering
Hi-index | 0.00 |
Are there statistical regularities behind computer programming? In 1970s, Halstead proposed the software science theory which attempted to describe some of the regularities based on the direct measurement of lexical tokens in programs. The famous software science length equation models the relationship between program length and vocabulary. By analyzing the source code of twelve Java software systems collected from public software repositories, we find that Halstead's length equation does not hold for large-scale modern software systems. We discover that the distribution of lexical tokens in studied systems follows the Zipf's law (or more generally, Zipf-Mandelbrot law), which is an empirical law in statistical natural language processing. Based on the discovery of Zipf's law, we propose a revised software science length equation for describing the vocabulary-length relationship. Our new equation fits the real data well and achieves better accuracy than the original equation. Our study reveals that we could discover statistical regularities behind computer programming by mining software repositories.