Stack Overflow is the most popular Q&A website among software developers. As a platform for knowledge sharing and acquisition, the questions posted in Stack Overflow usually contain a code snippet. Stack Overflow relies on users to properly tag the programming language of a question and it simply assumes that the programming language of the snippets inside a question is the same as the tag of the question itself. In this paper, we propose a classifier to predict the programming language of questions posted in Stack Overflow using Natural Language Processing (NLP) and Machine Learning (ML). The classifier achieves an accuracy of 91.1% in predicting the 24 most popular programming languages by combining features from the title, body and the code snippets of the question. We also propose a classifier that only uses the title and body of the question and has an accuracy of 81.1%. Finally, we propose a classifier of code snippets only that achieves an accuracy of 77.7%. These results show that deploying Machine Learning techniques on the combination of text and the code snippets of a question provides the best performance. These results demonstrate also that it is possible to identify the programming language of a snippet of few lines of source code. We visualize the feature space of two programming languages Java and SQL in order to identify some special properties of information inside the questions in Stack Overflow corresponding to these languages.
Searching by Code: a New SearchBySnippet Dataset and SnippeR Retrieval Model for Searching by Code Snippets
Huawei Noah's Ark lab(华为诺亚方舟实验室);St. Petersburg Department of the Steklov Institute of Mathematics(斯捷克洛夫数学研究所圣彼得堡分部);Ivannikov Institute for System Programming(伊万尼科夫系统编程研究所)
ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization
State Key Laboratory for Novel Software Technology, Nanjing University(南京大学现代软件技术国家重点实验室);Software Institute, Nanjing University(南京大学软件学院);College of Computing and Data Science, Nanyang Technological University(南洋理工大学计算与数据科学学院);Tencent Inc.(腾讯公司)
Improving Automatic Source Code Summarization via Deep Reinforcement Learning
Zhejiang University(浙江大学);Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);University of Technology Sydney(悉尼科技大学);University of Illinois at Chicago(伊利诺伊大学芝加哥分校);Tsinghua University(清华大学)