程序理解的目的在于获得足够的软件系统信息,以适用于人理解的形式展现出来,辅助开发人员对软件的理解.本文通过使用相关主题模型,为软件系统类层次的代码文件建立程序网络,并可视化展示整个软件系统的相关结构和功能,辅助开发者理解整个程序代码.该技术综合考虑了软件代码中的结构性信息和内容性信息,所建立的程序网络可帮助开发者更好的理解程序的语法依赖关系和语义功能相关关系.实验验证了建立的程序网络具有较好的准确性以及可以为指定的类推荐相关类.%Program comprehension aims to obtain enough information in the software system to promote the comprehension of the target software.This paper proposes a novel technique,which uses relational topic model (RTM) to model code (class-level) documents in the software system into a program network.Then,the program network is visualized to help developers understand the whole software.The advantage of RTM is that it takes into account both the structural and textual information in the software system,which enables developers to fully understand the syntax dependence and semantic functional relationship in the program.The empirical results show that the program network is more accurate to model the relation among different classes,moreover,it is able to recommend relevant classes for a given class to understand a local part in the program.
展开▼