TY - GEN
T1 - Why do developers use trivial packages? An empirical case study on npm
AU - Abdalkareem, Rabe
AU - Nourry, Olivier
AU - Wehaibi, Sultan
AU - Mujahid, Suhaib
AU - Shihab, Emad
N1 - Publisher Copyright:
© 2017 Association for Computing Machinery.
PY - 2017/8/21
Y1 - 2017/8/21
N2 - Code reuse is traditionally seen as good practice. Recent trends have pushed the concept of code reuse to an extreme, by using packages that implement simple and trivial tasks, which we call trivial packages'. A recent incident where a trivial package led to the breakdown of some of the most popular web applications such as Facebook and Netflix made it imperative to question the growing use of trivial packages. Therefore, in this paper, we mine more than 230, 000 npm packages and 38, 000 JavaScript applications in order to study the prevalence of trivial packages. We found that trivial packages are common and are increasing in popularity, making up 16.8% of the studied npm packages. We performed a survey with 88 Node.js developers who use trivial packages to understand the reasons and drawbacks of their use. Our survey revealed that trivial packages are used because they are perceived to be well implemented and tested pieces of code. However, developers are concerned about maintaining and the risks of breakages due to the extra dependencies trivial packages introduce. To objectively verify the survey results, we empirically validate the most cited reason and drawback and find that, contrary to developers' beliefs, only 45.2% of trivial packages even have tests. However, trivial packages appear to be deployment tested' and to have similar test, usage and community interest as non-trivial packages. On the other hand, we found that 11.5% of the studied trivial packages have more than 20 dependencies. Hence, developers should be careful about which trivial packages they decide to use.
AB - Code reuse is traditionally seen as good practice. Recent trends have pushed the concept of code reuse to an extreme, by using packages that implement simple and trivial tasks, which we call trivial packages'. A recent incident where a trivial package led to the breakdown of some of the most popular web applications such as Facebook and Netflix made it imperative to question the growing use of trivial packages. Therefore, in this paper, we mine more than 230, 000 npm packages and 38, 000 JavaScript applications in order to study the prevalence of trivial packages. We found that trivial packages are common and are increasing in popularity, making up 16.8% of the studied npm packages. We performed a survey with 88 Node.js developers who use trivial packages to understand the reasons and drawbacks of their use. Our survey revealed that trivial packages are used because they are perceived to be well implemented and tested pieces of code. However, developers are concerned about maintaining and the risks of breakages due to the extra dependencies trivial packages introduce. To objectively verify the survey results, we empirically validate the most cited reason and drawback and find that, contrary to developers' beliefs, only 45.2% of trivial packages even have tests. However, trivial packages appear to be deployment tested' and to have similar test, usage and community interest as non-trivial packages. On the other hand, we found that 11.5% of the studied trivial packages have more than 20 dependencies. Hence, developers should be careful about which trivial packages they decide to use.
KW - Code reuse
KW - Empirical studies
KW - JavaScript
KW - Node.js
UR - https://www.scopus.com/pages/publications/85030792039
UR - https://www.scopus.com/pages/publications/85030792039#tab=citedBy
U2 - 10.1145/3106237.3106267
DO - 10.1145/3106237.3106267
M3 - Conference contribution
AN - SCOPUS:85030792039
T3 - Proceedings of the ACM SIGSOFT Symposium on the Foundations of Software Engineering
SP - 385
EP - 395
BT - ESEC/FSE 2017 - Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering
A2 - Zisman, Andrea
A2 - Bodden, Eric
A2 - Schafer, Wilhelm
A2 - van Deursen, Arie
PB - Association for Computing Machinery
T2 - 11th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2017
Y2 - 4 September 2017 through 8 September 2017
ER -