2012 28th IEEE International Conference on Software Maintenance (ICSM) (2012)
Trento, Italy Italy
Sept. 23, 2012 to Sept. 28, 2012
Benjamin Biegel , University of Trier, Trier, Germany
Fabian Beck , University of Trier, Trier, Germany
Willi Hornig , University of Trier, Trier, Germany
Stephan Diehl , University of Trier, Trier, Germany
In source code files, fields and methods are arranged in linear order. Modern programming languages such as Java do not constrain this order-developers are free to choose any sequence. In this paper we examine the largely unexplored strategies developers apply for ordering fields and methods: First, we use visualization to explore different ordering criteria within two open source Java projects. Second, we verify our observations in a metric-based analysis on an extended set of 16 projects. Third, we present the results of a survey that reflects the opinion and applied ordering strategies of 52 developers. 87% of the participants agreed that ordering of fields and methods is meaningful or important. Our results suggest that there exists a set of criteria repeatedly used for ordering. Among these, the categories defined in the official Java Code Conventions appear to be the primary ordering criterion. However, in the individual strategies of the participants of the survey, we identified 15 ordering criteria additional to the five criteria we considered in the empirical analysis.
Java, Visualization, Measurement, Semantics, Sorting, Indexes, Software maintenance, linear arrangement, code conventions, code navigation
B. Biegel, F. Beck, W. Hornig and S. Diehl, "The Order of Things: How developers sort fields and methods," 2012 28th IEEE International Conference on Software Maintenance (ICSM), Trento, Italy Italy, 2012, pp. 88-97.