DocumentCode
2328779
Title
Automatic Segmentation of Method Code into Meaningful Blocks to Improve Readability
Author
Wang, Xiaoran ; Pollock, Lori ; Vijay-Shanker, K.
Author_Institution
Comput. & Inf. Sci., Univ. of Delaware, Newark, DE, USA
fYear
2011
fDate
17-20 Oct. 2011
Firstpage
35
Lastpage
44
Abstract
With the goal of increasing program readability for easier understanding, coding guidelines often include formatting standards such as indenting loop and conditional branch body statements. Similarly, good programming practice suggests that programmers use blank lines to visibly delineate between code segments that represent different algorithmic steps or high level actions. Unfortunately, programmers do not always follow these guidelines. While editors and IDEs can easily indent code based on syntax, they do not currently support automatic blank line insertion, which presents more significant challenges involving the semantics. This paper presents a heuristic solution to the automatic blank line insertion problem, by leveraging both program structure and naming information to identify "meaningful blocks", consecutive statements that logically implement a high level action. Our tool, SEGMENT, takes as input a Java method, and outputs a segmented version that separates meaningful blocks by vertical spacing. We report on an evaluation of the effectiveness of SEGMENT based on developers\´ opinions. SEGMENT assists in making users obtain an overall picture of a method\´s actions and comprehend it quicker r as well as provides hints for internal documentation placement.
Keywords
Java; document handling; program compilers; software maintenance; source coding; IDE; Java method; SEGMENT; automatic blank line insertion problem; automatic method code segmentation; blank lines; conditional branch body statements; formatting standards; indenting loop; internal documentation placement; program readability; Compounds; Encoding; Humans; Java; Reverse engineering; Semantics; Syntactics; automatic formatting; program understanding; readability; software tool;
fLanguage
English
Publisher
ieee
Conference_Titel
Reverse Engineering (WCRE), 2011 18th Working Conference on
Conference_Location
Limerick
ISSN
1095-1350
Print_ISBN
978-1-4577-1948-6
Type
conf
DOI
10.1109/WCRE.2011.15
Filename
6079773
Link To Document