The Community for Technology Leaders
2013 IEEE International Conference on Software Maintenance (2012)
Trento, Italy Italy
Sept. 23, 2012 to Sept. 28, 2012
ISSN: 1063-6773
ISBN: 978-1-4673-2313-0
pp: 88-97
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
Benjamin Biegel, Fabian Beck, Willi Hornig, Stephan Diehl, "The Order of Things: How developers sort fields and methods", 2013 IEEE International Conference on Software Maintenance, vol. 00, no. , pp. 88-97, 2012, doi:10.1109/ICSM.2012.6405258
192 ms
(Ver 3.3 (11022016))