Functional programming is expected to introduce several benefits to programs, including fewer side effects, easier parallelization, and even, in some circumstances, better comprehensibility. This paper investigates the extent to which the addition/modification of certain programming language constructs, i.e., lambdas, comprehensions, and map/filter/reduce, have higher chances to induce fixes than other changes. To this extent, we analyze the change history of 200 popular open-source programs written in Python, accounting for similar or equal to 630k commits and 6M changes. The study results show that changes to functional constructs have higher odds to induce fixes than other changes, and that some functional constructs, such as lambdas and comprehensions, have higher odds to induce fixes than others. Finally, a qualitative analysis revealed different scenarios in which functional constructs have been fixed. Results of this study may trigger better development support when using functional constructs during development, and prioritize code review and testing on certain areas of the source code.
An Empirical Study on the Fault-Inducing Effect of Functional Constructs in Python
Zampetti F.
;Di Penta M.
2022-01-01
Abstract
Functional programming is expected to introduce several benefits to programs, including fewer side effects, easier parallelization, and even, in some circumstances, better comprehensibility. This paper investigates the extent to which the addition/modification of certain programming language constructs, i.e., lambdas, comprehensions, and map/filter/reduce, have higher chances to induce fixes than other changes. To this extent, we analyze the change history of 200 popular open-source programs written in Python, accounting for similar or equal to 630k commits and 6M changes. The study results show that changes to functional constructs have higher odds to induce fixes than other changes, and that some functional constructs, such as lambdas and comprehensions, have higher odds to induce fixes than others. Finally, a qualitative analysis revealed different scenarios in which functional constructs have been fixed. Results of this study may trigger better development support when using functional constructs during development, and prioritize code review and testing on certain areas of the source code.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.