Ontology-based code snippets management in a cloud environment

Jianjun Shi, Weixing Ji*, Zhiwei Gao, Yujin Gao, Yizhuo Wang, Xinyi Liao, Feng Shi

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

1 Citation (Scopus)

Abstract

A code snippet is a small region of reusable source code that is common to many functions. Skilled management and reuse of snippets can improve programming efficiency in practice. However, we find that most snippets are posted to online blogs or snippet management systems with little description and tagging, which leads to an embarrassing situation in which existing snippets are difficult to reuse. This occurs because snippets are usually hastily pushed to online services or saved in text files by programmers and also because existing management systems do not provide efficient labeling and reusing frameworks. In this paper, we propose to annotate snippets with a well-formed domain-specific ontology—programming ontology. With a thorough investigation of real world snippets, we designed a programming ontology to annotate and recommend snippets. We show how to annotate a snippet with ontology terms based on text classification models. In addition, we built a snippet management system that stores user snippets in the cloud and automatically recommends snippets, so that the retrieval of snippets becomes trivial in popular integrated developing environments, such as Eclipse and Visual Studio. Our evaluation results demonstrate that the ontology annotation algorithm is able to automatically annotate a snippet with a high degree of accuracy. The shared domain knowledge also makes it possible to share snippets among programmers and systems. As the number of labeled snippets increases, deep learning models can be trained and used to annotate code snippets with high accuracy.

Original languageEnglish
Pages (from-to)2971-2985
Number of pages15
JournalJournal of Ambient Intelligence and Humanized Computing
Volume10
Issue number8
DOIs
Publication statusPublished - 1 Aug 2019

Keywords

  • Cloud computing
  • Code snippet
  • Deep learning
  • Ontology
  • Programming language

Fingerprint

Dive into the research topics of 'Ontology-based code snippets management in a cloud environment'. Together they form a unique fingerprint.

Cite this