On method ordering

Yorai Geffen, Shahar Maoz

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


As the order of methods in a Java class has no effect on its semantics, an engineer can choose any order she prefers. Which code conventions regarding methods ordering are common in practice, if any? Are some orders better than others in making the code easier to understand? Can good orders be computed and applied automatically? In this work we address these questions. First, we present a study of method orders in a large body of open source projects, where we identify existing common practices. Second, we present four method ordering strategies, which we automate and provide in an Eclipse plugin, as a form of refactoring. Finally, we present the results of a user study, which evaluates the effect of our methods ordering strategies on engineers' code comprehension in terms of correctness and time spent on answering.

Original languageEnglish
Title of host publicationProceedings of the 24th IEEE International Conference on Program Comprehension, ICPC 2016 - co-located with ICSE 2016
PublisherIEEE Computer Society
ISBN (Electronic)9781509014286
StatePublished - 5 Jul 2016
Event24th IEEE International Conference on Program Comprehension, ICPC 2016 - Austin, United States
Duration: 16 May 201617 May 2016

Publication series

NameIEEE International Conference on Program Comprehension


Conference24th IEEE International Conference on Program Comprehension, ICPC 2016
Country/TerritoryUnited States


Dive into the research topics of 'On method ordering'. Together they form a unique fingerprint.

Cite this