基于主题建模和静态分析技术的软件代码功能性主题获取方法
JunFeng ZHAO, Meng LI, Bing Xie
Abstract
JunFeng ZHAO, Meng LI, Bing Xie
Abstract
Recently, topic modeling-based source code comprehension has become one of the research hotspots. Researchers mine functional topics from source code with topic modeling techniques, and use these functional topics to help developers comprehend the functional concerns of a software system and the corresponding implementations in source code. However, because diverse kinds of topics, including functional topics and other noisy topics, are mixed together in the raw topics mined from source code, developers have to identify functional topics manually. The manual identification process is difficult and time-consuming due to the fact that only basic information (e.g. associated words) is provided by previous approaches. In this paper, we propose a topic modeling and static analysis-based approach to obtain functional topics from source code. Firstly, we execute source code preprocessing with a series of Filtering Heuristics, and then mine raw topics from source code using topic modeling techniques. Then, we conduct static analysis on source code to obtain structural relationships, based on which we propose a novel metric called Topic Cohesion to identify functional topics from the raw topics. Finally, we locate source code elements that implement the topics, and generate topic descriptions using source code comments for the developers to comprehend the topics. Experiments on a set of open source software show that our approach can effectively obtain functional topics and their associated information, which helps developer comprehend the functional concerns of a software system and the corresponding implementations in source code.
A significance statement is not available in the OpenAlex record.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
Recently, topic modeling-based source code comprehension has become one of the research hotspots. Researchers mine functional topics from source code with topic modeling techniques, and use these functional topics to help developers comprehend the functional concerns of a software system and the corresponding implementations in source code. However, because diverse kinds of topics, including functional topics and other noisy topics, are mixed together in the raw topics mined from source code, developers have to identify functional topics manually. The manual identification process is difficult and time-consuming due to the fact that only basic information (e.g. associated words) is provided by previous approaches. In this paper, we propose a topic modeling and static analysis-based approach to obtain functional topics from source code. Firstly, we execute source code preprocessing with a series of Filtering Heuristics, and then mine raw topics from source code using topic modeling techniques. Then, we conduct static analysis on source code to obtain structural relationships, based on which we propose a novel metric called Topic Cohesion to identify functional topics from the raw topics. Finally, we locate source code elements that implement the topics, and generate topic descriptions using source code comments for the developers to comprehend the topics. Experiments on a set of open source software show that our approach can effectively obtain functional topics and their associated information, which helps developer comprehend the functional concerns of a software system and the corresponding implementations in source code.
Key concepts: Medicine, Psychology