Modern programming languages, such as Python, have introduced a variety of constructs and syntactical elements to make software development more efficient and concise. Examples include lambda functions, comprehension collections, or mechanisms to facilitate the passing of arguments to a function. While many such constructs may, in principle, be beneficial for developers, recent studies have shown that certain programming constructs may affect program understanding and even induce more fixes than other changes. This paper studies the effect of different Python argument-passing mechanisms to investigate their relationship with code proneness to be fixed. Specifically, we study the fix-proneness with regard to function definitions and invocations. This is done by analyzing the evolutionary history of 200 Python projects, for a total of about 1.9M function definitions and 9.8M call site changes. While there are varying effects for what concerns parameter declaration mechanisms, we found evidence that keyword-based argument passing is less defect-prone than positional argument passing, and this is not affected by size-related confounding factors.

The relationship between different python argument-passing mechanisms and fixes: An empirical study

Di Penta M.;Antoniol G.
2027-01-01

Abstract

Modern programming languages, such as Python, have introduced a variety of constructs and syntactical elements to make software development more efficient and concise. Examples include lambda functions, comprehension collections, or mechanisms to facilitate the passing of arguments to a function. While many such constructs may, in principle, be beneficial for developers, recent studies have shown that certain programming constructs may affect program understanding and even induce more fixes than other changes. This paper studies the effect of different Python argument-passing mechanisms to investigate their relationship with code proneness to be fixed. Specifically, we study the fix-proneness with regard to function definitions and invocations. This is done by analyzing the evolutionary history of 200 Python projects, for a total of about 1.9M function definitions and 9.8M call site changes. While there are varying effects for what concerns parameter declaration mechanisms, we found evidence that keyword-based argument passing is less defect-prone than positional argument passing, and this is not affected by size-related confounding factors.
2027
Empirical Study
Fix-Inducing Change
Function Parameters
Python
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/20.500.12070/77612
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? ND
social impact