Understanding Class Name Regularity: A Simple Heuristic and Supportive Visualization

By: Nour Jihene Agouf, St├ęphane Ducasse, Anne Etien, Abdelghani Alidra, Arnaud Thiefaine

Abstract

Studies have shown that more than 50% of software maintenance time is spent reading code to understand it. This puts a strong emphasis on the understandability of source code. Class names constitute one of the first pieces of information developers have access to. Proposal: To assist developers in understanding the logic and regularity of class names, we present a new and simple visualization, called ClassName Distribution. It brings together package and inheritance as structural perspectives on class names. ClassName Distribution allows one to spot naming irregularities in large hierarchies scattered over multiple packages. Validation: We show (1) how this visualization helps capture recurrent patterns relative to concept reference in class names and (2) that this visualization supports the evolution of software systems by monitoring and guiding class renamings over multiple versions. To evaluate our approach we did a consequent assessment with real practitioners and open-source software structured in two different setups: in the first one, we asked domain experts to use the visualization: three groups of engineers applied our tool to the the software they develop or maintain. They proposed and performed respectively 91, 68, and 24 class renamings. In the second setup, as authors of the visualization and the tool (visualization experts), we applied our tool to a new UI framework for Pharo. We sent 34 pull requests for renaming classes and 32 were accepted. Finally, we applied our visualizations to 50 Java projects and identified visual patterns in most of them. Consequently, it shows that the proposed visualization is effective for spotting class name inconsistencies, and this by both developers of the system and external persons.

Keywords

class name, visualization, program comprehension.

Cite as:

Nour Jihene Agouf, St├ęphane Ducasse, Anne Etien, Abdelghani Alidra, Arnaud Thiefaine, “Understanding Class Name Regularity: A Simple Heuristic and Supportive Visualization”, Journal of Object Technology, Volume 21, no. 1 ( 2022), pp. 1:1-31, doi:10.5381/jot.2022.21.1.a2.

PDF | DOI | BiBTeX | Tweet this | Post to CiteULike | Share on LinkedIn

The JOT Journal   |   ISSN 1660-1769   |   DOI 10.5381/jot   |   AITO   |   Open Access   |    Contact