Decoding Confusing Code: Social Representations among Developers
Rafael de Mello, José Aldo Silva da Costa, Benedito de Oliveira, Márcio Ribeiro, Baldoíno Fonseca, Rohit Gheyi, Alessandro Garcia, Willy C. Tiengo · 2021
Context. Confusing code is any code element in which developers have considerable difficulty reaching its comprehension. These difficulties may result from a plethora of characteristics of the source code and external issues. In this way, there is still a lack of knowledge on the core issues of confusing code. This knowledge is important for optimizing efforts in promoting program comprehension. Goal. In this paper, we investigate the social representations of confusing code among two distinct communities of software developers from industry. Method. We conducted free association tasks with the developers to characterize what is in their minds about confusing code. Then, we compiled and classified the associations composing the social representations of confusing code by each community. Finally, we compared the social representations from both communities. Results. We found that developers of both communities strongly associate confusing code with a common set of undesirable characteristics of the source code, such as different types of code smells and the badly naming of code elements. Besides, we found that the incidence of confusing code is a potential source of discouragement and conflict. In this way, we discuss alternatives for development teams overcoming these issues. Conclusion. The findings of our study reveal an initial set of core issues of confusing code. These issues can drive future investigations on technologies for promoting code comprehension.