Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Oct 27:2:37.
doi: 10.12688/openreseurope.14507.2. eCollection 2022.

An open-source natural language processing toolkit to support software development: addressing automatic bug detection, code summarisation and code search

Affiliations

An open-source natural language processing toolkit to support software development: addressing automatic bug detection, code summarisation and code search

Cristian Robledo et al. Open Res Eur. .

Abstract

This paper aims to introduce the innovative work carried out in the Horizon 2020 DECODER project - acronym for "DEveloper COmpanion for Documented and annotatEd code Reference" - (Grant Agreement no. 824231) by linking the fields of natural language processing (NLP) and software engineering. The project as a whole addresses the development of a framework, namely the Persistent Knowledge Monitor (PKM), that acts as a central infrastructure to store, access, and trace all the data, information and knowledge related to a given software or ecosystem. This meta-model defines the knowledge base that can be queried and analysed by all the tools integrated and developed in DECODER. Besides, the DECODER project offers a friendly user interface where each of the predefined three roles (i.e., developers, maintainers and reviewers) can access and query the PKM with their personal accounts. The paper focuses on the NLP tools developed and integrated in the PKM, namely the deep learning models developed to perform variable misuse, code summarisation and semantic parsing. These were developed under a common work package - "Activities for the developer" - intended to precisely target developers, who can perform tasks such as detection of bugs, automatic generation of documentation for source code and generation of code snippets from natural languages instructions, among the multiple functionalities that DECODER offers. These tools assist and help the developers in the daily work, by increasing their productivity and avoiding loss of time in tedious tasks such as manual bug detection. Training and validation were conducted for four use cases in Java, C and C++ programming languages in order to evaluate the performance, suitability, usability, etc. of the developed tools.

Keywords: Code Summarisation; Deep Learning; Natural Language Processing; Semantic Parsing; Software Engineering; Variable Misuse.

Plain language summary

Software engineers usually spends a lot of time in tedious activities like debugging and documenting code or finding examples of code snippets to use as a basis for their new programmes. Given the large and complex software systems that exist nowadays, being forced to perform these tasks manually causes a considerable drop in the overall productivity of programmers. The models developed in this work target Java, C and C++ programming languages and aim to alleviate software developers’, maintainers’ and reviewers’ efforts, by proposing automatic NLP solutions to carry out tasks such as bug detection, documentation generation and code search.

PubMed Disclaimer

Conflict of interest statement

No competing interests were disclosed.

Figures

Figure 1.
Figure 1.. Variable misuse bug detection and repair architecture.
Figure 2.
Figure 2.. Transformer architecture (From , Vaswani et al. (2017) under CC-BY).
Figure 3.
Figure 3.. RecycleBERT architecture (From [recyclebert], under CC-BY).
[CLS] and [SEP] are two special tokens added before and after the source tokens si. hj are tensors for each token at the output of the encoder. is a special token added at the beginning of the tk target output tokens and . Likewise, is a special token generated at the end of the sequence of generated output tokens.
Figure 4.
Figure 4.. AST of ASDL type of a line of Python code and list of actions generating the tree (From [tranx], under CC-BY).
Figure 5.
Figure 5.. Java model confusion matrix.
Figure 6.
Figure 6.. C/C++ model confusion matrix.
Figure 7.
Figure 7.. Java example - XPage application.
Figure 8.
Figure 8.. C/C++ example – Access debug.
Figure 9.
Figure 9.. Java snippet - XPage redirect.
Figure 10.
Figure 10.. Java snippet - SetAmount.
Figure 11.
Figure 11.. Java snippet - shutdown.
Figure 12.
Figure 12.. C++ snippet - dwg_ent_text_get_height.
Figure 13.
Figure 13.. C++ snippet - get_desktop_file_path_list.
Figure 14.
Figure 14.. C++ snippet - mxr_streamer_put.
Figure 15.
Figure 15.. Code from a Concode example associated with an instruction.

Similar articles

References

    1. Xia X, Bao L, Lo D, et al. : Measuring Program Comprehension: A Large-Scale Field Study with Professionals. IEEE Transactions on Software Engineering. 2018;44(10):951–976. 10.1109/TSE.2017.2734091 - DOI
    1. Allamanis M, Brockschmidt M, Khademi M: Learning to represent Programs with graphs. Proceedings of the 6th International Conference on Learning Representations (ICLR). 2018. Reference Source
    1. Vessey I: Expertise in debugging computer programs: A process analysis. Int J Man Mach Stud. 1985;23(5):459–494. 10.1016/S0020-7373(85)80054-7 - DOI
    1. Haiduc S, Aponte J, Moreno L, et al. : On the Use of Automated Text Summarization Techniques for Summarizing Source Code. 2010 17th Working Conference on Reverse Engineering. 2010;35–44. 10.1109/WCRE.2010.13 - DOI
    1. Ahmad WU, Chakraborty S, Ray B, et al. : A Transformer-based Approach for Source Code Summarization. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL). 2020;4998–5007. Reference Source

LinkOut - more resources