A Large Scale Empirical Study of the Impact of Spaghetti Code and Blob Anti-patterns on Program Comprehension

09/05/2020
by   Cristiano Politowski, et al.
0

Context: Several studies investigated the impact of anti-patterns (i.e., "poor" solutions to recurring design problems) during maintenance activities and reported that anti-patterns significantly affect the developers' effort required to edit files. However, before developers edit files, they must understand the source code of the systems. This source code must be easy to understand by developers. Objective: In this work, we provide a complete assessment of the impact of two instances of two anti-patterns, Blob or Spaghetti Code, on program comprehension. Method: We analyze the impact of these two anti-patterns through three empirical studies conducted at Polytechnique Montréal (Canada) with 24 participants; at Carlton University (Canada) with 30 participants; and at University Basilicata (Italy) with 79 participants. Results: We collect data from 372 tasks obtained thanks to 133 different participants from the three universities. We use three metrics to assess the developers' comprehension of the source code: (1) the duration to complete each task; (2) their percentage of correct answers; and, (3) the NASA task load index for their effort. Conclusions: We report that, although single occurrences of Blob or Spaghetti code anti-patterns have little effect on code comprehension, two occurrences of either Blob or Spaghetti Code significantly increases the developers' time spent in their tasks, reduce their percentage of correct answers, and increase their effort. Hence, we recommend that developers act on both anti-patterns, which should be refactored out of the source code whenever possible. We also recommend further studies on combinations of anti-patterns rather than on single anti-patterns one at a time.

READ FULL TEXT

page 13

page 15

research
08/13/2018

Automated Refactoring: Can They Pass The Turing Test?

Refactoring is a maintenance activity that aims to improve design qualit...
research
07/06/2021

COSPEX: A Program Comprehension Tool for Novice Programmers

Developers often encounter unfamiliar code during software maintenance w...
research
07/19/2022

Visual Notations in Container Orchestrations: An Empirical Study with Docker Compose

Context: Container orchestration tools supporting infrastructure-as-code...
research
01/29/2019

A Machine-learning Based Ensemble Method For Anti-patterns Detection

Anti-patterns are poor solutions to recurring design problems. Several e...
research
07/12/2020

Editable AI: Mixed Human-AI Authoring of Code Patterns

Developers authoring HTML documents define elements following patterns w...
research
06/22/2022

40 Years of Designing Code Comprehension Experiments: A Systematic Mapping Study

The relevance of code comprehension in a developer's daily work was reco...
research
04/21/2020

SQLCheck: Automated Detection and Diagnosis of SQL Anti-Patterns

The emergence of database-as-a-service platforms has made deploying data...

Please sign up or login with your details

Forgot password? Click here to reset