Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

NCQ: Code Reuse Support for Node.js Developers

Published: 01 May 2023 Publication History

Abstract

Code reuse is an important part of software development. The adoption of code reuse practices is especially common among Node.js developers. The Node.js package manager, NPM, indexes over 1 Million packages and developers often seek out packages to solve programming tasks. Due to the vast number of packages, selecting the right package is difficult and time consuming. With the goal of improving productivity of developers that heavily reuse code through third-party packages, we present <italic>Node Code Query</italic> (NCQ), a Read-Eval-Print-Loop environment that allows developers to 1) search for NPM packages using natural language queries, 2) search for code snippets related to those packages, 3) automatically correct errors in these code snippets, 4) quickly setup new environments for testing those snippets, and 5) transition between search and editing modes. In two user studies with a total of 20 participants, we find that participants begin programming faster and conclude tasks faster with NCQ than with baseline approaches, and that they like, among other features, the search for code snippets and packages. Our results suggest that NCQ makes Node.js developers more efficient in reusing code.

References

[1]
W3Techs, “Usage statistics of node.js,” 2020. [Online]. Available: https://w3techs.com/technologies/details/ws-nodejs
[2]
L. Tal and S. Maple, “NPM passes the 1 millionth package milestone! What can we learn?” 2020. [Online]. Available: https://snyk.io/blog/npm-passes-the-1-millionth-package-milestone-what-can-we-learn/
[3]
R. G. Kula, A. Ouni, D. M. German, and K. Inoue, “On the impact of micro-packages: An empirical study of the NPM JavaScript ecosystem,” 2017,.
[4]
E. Sandewall, “Programming in an interactive environment: The“LISP”experience,” ACM Comput. Surv., vol. 10, no. 1, pp. 35–71, 1978.
[5]
B. A. Campbell and C. Treude, “NLP2Code: Code snippet content assist via natural language tasks,” in Proc. IEEE Int. Conf. Softw. Maintenance Evol., 2017, pp. 628–632.
[6]
L. Ponzanelli, G. Bavota, M. Di Penta, R. Oliveto, and M. Lanza, “Prompter: A self-confident recommender system,” in Proc. IEEE Int. Conf. Softw. Maintenance Evol., 2014, pp. 577–580.
[7]
H. Zhang, A. Jain, G. Khandelwal, C. Kaushik, S. Ge, and W. Hu, “Bing developer assistant: Improving developer productivity by recommending sample code,” in ACM SIGSOFT Int. Symp. Found. Softw. Eng., 2016, pp. 956–961.
[8]
J. Brandt, M. Dontcheva, M. Weskamp, and S. R. Klemmer, “Example-centric programming: Integrating web search into the development environment,” in Proc. Conf. Hum. Factors Comput. Syst., 2010, pp. 513–522.
[9]
L. Ponzanelli, A. Bacchelli, and M. Lanza, “Seahawk: Stack overflow in the IDE,” in Proc. IEEE 35th Int. Conf. Softw. Eng., 2013, pp. 1295–1298.
[10]
R. El-Hajj and S. Nadi, “LibComp: An IntelliJ Plugin for Comparing Java Libraries,” in Proc. 28th ACM Joint Meeting Eur. Softw. Eng. Conf. Symp. Found. Softw. Eng., 2020, pp. 1591–1595.
[11]
B. Reid, C. Treude, and M. Wagner, “Optimising the fit of stack overflow code snippets into existing code,” in Proc. Genet. Evol. Comput. Conf. Companion, 2020, pp. 1945–1953.
[12]
V. Terragni, Y. Liu, and S.-C. Cheung, “CSNIPPEX: Automated synthesis of compilable code snippets from Q&A sites,” in Proc. Int. Symp. Softw. Testing Anal., 2016, pp. 118–129.
[13]
S. A. Licorish and M. Wagner, “Combining GIN and PMD for code improvements,” in Proc. Genet. Evol. Comput. Conf. Companion, 2022, pp. 790–793.
[14]
A. Danilova, A. Naiakshina, S. Horstmann, and M. Smith, “Do you really code? Designing and evaluating screening questions for online surveys with programmers,” in Proc. IEEE/ACM 43rd Int. Conf. Softw. Eng., 2021, pp. 537–548.
[15]
B. Reid, M. Wagner, M. d’Amorim, C. Treude, and C. Treude, “Software engineering user study recruitment on prolific: An experience report,” 2022, arXiv:2201.05348.
[16]
A. Rainer and C. Wohlin, “Recruiting credible participants for field studies in software engineering research,” 2021. [Online]. Available: https://arxiv.org/abs/2112.14186
[17]
F. D. Davis, “Perceived usefulness, perceived ease of use, and user acceptance of information technology,” Manage. Inf. Syst. Quart., vol. 13, pp. 319–340, 1989.
[18]
V. Venkatesh and F. D. Davis, “A theoretical extension of the technology acceptance model: Four longitudinal field studies,” Manage. Sci., vol. 46, no. 2, pp. 186–204, 2000.
[19]
S. Proksch, V. Bauer, and G. C. Murphy, How to Build a Recommendation System for Software Engineering. Berlin, Germany: Springer, 2015, pp. 1–42.
[20]
B. Chinthanet et al., “What makes a good node.js package? Investigating users, contributors, and runnability,” 2021,.
[21]
U. F. Campos, G. Smethurst, J. P. Moraes, R. Bonifácio, and G. Pinto, “Mining rule violations in JavaScript code snippets,” in Proc. IEEE/ACM 16th Int. Conf. Mining Softw. Repositories, 2019, pp. 195–199.
[22]
R. Abdalkareem, O. Nourry, S. Wehaibi, S. Mujahid, and E. Shihab, “Why do developers use trivial packages? An empirical case study on NPM,” in Proc. 28th ACM Joint Meeting Eur. Softw. Eng. Conf. Symp. Found. Softw. Eng., 2017, pp. 385–395.
[23]
V. R. Basili, L. C. Briand, and W. L. Melo, “How reuse influences productivity in object-oriented systems,” Commun. ACM, vol. 39, no. 10, pp. 104–116, 1996.
[24]
A. Mockus, “Large-scale code reuse in open source software,” in Proc. IEEE 1st Int. Workshop Emerg. Trends FLOSS Res. Develop., 2007, p. 7.
[25]
W. C. Lim, “Effects of reuse on quality, productivity, and economics,” IEEE Softw., vol. 11, no. 5, pp. 23–30, 1994.
[26]
P. Mohagheghi, R. Conradi, O. M. Killi, and H. Schwarz, “An empirical study of software reuse versus defect-density and stability,” in Proc. 6th Int. Conf. Softw. Eng., 2004, pp. 282–291.
[27]
M. Sojer and J. Henkel, “Code reuse in open source software development: Quantitative evidence, drivers, and impediments,” J. Assoc. Inf. Syst., vol. 11, no. 12, pp. 868–901, 2010.
[28]
X. Li, Z. Wang, Q. Wang, S. Yan, T. Xie, and H. Mei, “Relationship-aware code search for JavaScript frameworks,” in Proc. ACM SIGSOFT Int. Symp. Found. Softw. Eng., 2016, pp. 690–701.
[29]
C. McMillan, D. Poshyvanyk, and M. Grechanik, “Recommending source code examples via API call usages and documentation,” in Proc. Int. Workshop Recommendation Syst. Softw. Eng., 2010, pp. 21–25.
[30]
L. Moreno, G. Bavota, M. Di Penta, R. Oliveto, and A. Marcus, “How can i use this method?,” in Proc. IEEE/ACM 37th Int. Conf. Softw. Eng., 2015, pp. 880–890.
[31]
M. A. Saied, A. Ouni, H. Sahraoui, R. G. Kula, K. Inoue, and D. Lo, “Improving reusability of software libraries through usage pattern mining,” J. Syst. Softw., vol. 145, pp. 164–179, 2018.
[32]
X. Gu, H. Zhang, and S. Kim, “Deep code search,” in Proc. IEEE/ACM 40th Int. Conf. Softw. Eng., 2018, pp. 933–944.
[33]
F. F. Xu, B. Vasilescu, and G. Neubig, “In-IDE code generation from natural language: Promise and challenges,” ACM Trans. Softw. Eng. Methodol., vol. 31, no. 2, pp. 1–47, Mar. 2022.
[34]
A. Kanade, P. Maniatis, G. Balakrishnan, and K. Shi, “Learning and evaluating contextual embedding of source code,” in Proc. Int. Conf. Mach. Learn., 2020, pp. 5110–5121.
[35]
E. Larios Vargas, M. Aniche, C. Treude, M. Bruntink, and G. Gousios, “Selecting third-party libraries: The practitioners’ perspective,” in Proc. 28th ACM Joint Meeting Eur. Softw. Eng. Conf. Symp. Found. Softw. Eng., 2020, pp. 245–256.
[36]
S. Mirhosseini and C. Parnin, “Docable: Evaluating the executability of software tutorials,” in Proc. 28th ACM Joint Meeting Eur. Softw. Eng. Conf. Symp. Found. Softw. Eng., 2020, pp. 375–385.
[37]
Project Jupter, “Jupyter,” 2020. [Online]. Available: https://jupyter.org/
[38]
L. Melo, I. S. Wiese, and M. d’Amorim, “Using docker to assist Q A forum users,” IEEE Trans. Softw. Eng., vol. 47, no. 11, pp. 2563–2574, Nov. 2021.
[39]
D. Yang, A. Hussain, and C. V. Lopes, “From query to usable code: An analysis of stack overflow code snippets,” in Proc. Int. Conf. Mining Softw. Repositories, 2016, pp. 391–402.
[40]
I. Steinmacher, T. U. Conte, C. Treude, and M. A. Gerosa, “Overcoming open source project entry barriers with a portal for newcomers,” in Proc. IEEE/ACM 38th Int. Conf. Softw. Eng., 2016, pp. 273–284.

Cited By

View all
  • (2024)Feedback-Directed Partial ExecutionProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680320(781-793)Online publication date: 11-Sep-2024
  • (2024)A Study on the Pythonic Functional Constructs' UnderstandabilityProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639211(1-13)Online publication date: 20-May-2024
  • (2024)How Do Developers Adapt Code Snippets to Their Contexts? An Empirical Study of Context-Based Code Snippet AdaptationsIEEE Transactions on Software Engineering10.1109/TSE.2024.339551950:11(2712-2731)Online publication date: 1-Nov-2024
  • Show More Cited By

Comments

Information & Contributors

Information

Published In

cover image IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering  Volume 49, Issue 5
May 2023
312 pages

Publisher

IEEE Press

Publication History

Published: 01 May 2023

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Feedback-Directed Partial ExecutionProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680320(781-793)Online publication date: 11-Sep-2024
  • (2024)A Study on the Pythonic Functional Constructs' UnderstandabilityProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639211(1-13)Online publication date: 20-May-2024
  • (2024)How Do Developers Adapt Code Snippets to Their Contexts? An Empirical Study of Context-Based Code Snippet AdaptationsIEEE Transactions on Software Engineering10.1109/TSE.2024.339551950:11(2712-2731)Online publication date: 1-Nov-2024
  • (2023)On the recruitment of company developers for security studies: results from a qualitative interview studyProceedings of the Nineteenth USENIX Conference on Usable Privacy and Security10.5555/3632186.3632204(321-340)Online publication date: 7-Aug-2023

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media