Extracting Code-relevant Description Sentences Based on Structural Similarity

Proceedings of the 11th Asia-Pacific Symposium on Internetware(2019)

引用 1|浏览19
暂无评分
摘要
Software developers often need to read code snippets that are dispersed among different documentation, e.g., Q&A; posts, to reuse APIs to complete certain tasks. These code snippets are often surrounded by lengthy context text which are used to describe the functions of code snippets. It will be helpful for code comprehension if we can align a code snippet with its description. In this paper, we propose an approach to extracting code-relevant sentences from its context text. To quantify the relevance between code line and natural language sentence, we represent them with structure trees and calculate their structural similarity. We conduct two experiments to evaluate our approach. In Experiment I, the results show that our approach achieves 83.5% precision and 80.1% recall in aligning Lucene code snippets and corresponding comments. Our approach achieves 27.6% ~ 40.2% improvement in precision compared with existing method, and 33.8% ~ 39.7% improvement in recall. In Experiment II, the results show that our approach achieves 66.4% ~ 93.9% precision to extract code-relevant sentences.
更多
查看译文
关键词
code and text alignment, code comprehension, code relevant description, structural similarity
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要