计算机工程与应用 ›› 2013, Vol. 49 ›› Issue (6): 80-85.

• 理论研究、研发设计 • 上一篇    下一篇

基于拉力算法的面向对象程序结构可视化研究

李  宁,刘  超,原  子   

  1. 北京航空航天大学 计算机学院,北京 100191
  • 出版日期:2013-03-15 发布日期:2013-03-14

Research on visualization for object-oriented program structure based on force-directed layout

LI Ning, LIU Chao, YUAN Zi   

  1. School of Computer Science and Engineering, Beihang University, Beijing 100191, China
  • Online:2013-03-15 Published:2013-03-14

摘要: 面向对象程序整体结构及其特性的逆向分析和可视化在软件维护、软件重用等过程中起着重要作用。现有的逆向工程工具尽管可以通过对程序代码的静态分析自动获取类模型,但是在自动布图方面仍存在一些明显的问题,特别是难以直观展现类之间的耦合性、聚集效应等程序整体结构的重要特性,从而影响其实际应用。Force-Directed Layout算法能够自然展现复杂结构的耦合关系和聚集现象,因此,将其应用于类图的逆向生成,使其在充分展示程序整体结构的同时,清晰展现类之间的耦合性和聚集效应等结构特征,为软件结构演化分析、缺陷分布分析等提供辅助支持。据此,开发了软件分析与测试工具系列QESat的子工具——基于拉力算法的类图可视化工具QESat/FCD(QualityEasy-Software Analysis and Testing Tools:Force-Directed Class Diagram),通过实例展示了其在大型类图结构特性方面的展现效果。

关键词: 面向对象程序, 程序结构, 类图, 耦合性, 可视化

Abstract: The analysis and visualization of the overall structure and characteristics in OO programs play an important role in software maintenance and reuse. Although the existing reverse engineering tools can automatically obtain class model through static analysis of source code, there are still some obvious problems in the layout, especially in showing coupling and cohesion of program structure. As a result, these problems have an influence on its practical application. Force-Directed Layout algorithm can show coupling and cohesion in the structure naturally. So it is applied in the class diagram layout in reverse engineering. Consequently, the layout can not only visualize the overall structure of the program clearly, but also show coupling and cohesion in the class diagram at the same time. What’s more, this layout can be extended to support the evolution and defect distribution analysis. Accordingly, a sub-tool of software analysis and testing tools is developed based on the Force-Directed Layout algorithm, named QESat/FCD(QualityEasy-Software Analysis and Testing Tools:Force-Directed Class Diagram). And some test cases are introduced to show the visualization of the characteristics of the complex class diagram.

Key words: object-oriented program, program structure, class diagram, coupling, visualization