计算机工程与应用
計算機工程與應用
계산궤공정여응용
COMPUTER ENGINEERING AND APPLICATIONS
2013年
14期
51-55
,共5页
司海平%乔红波%虎晓红%陈宝钢%曹永生
司海平%喬紅波%虎曉紅%陳寶鋼%曹永生
사해평%교홍파%호효홍%진보강%조영생
静态分析%软件工程%用况图%程序理解
靜態分析%軟件工程%用況圖%程序理解
정태분석%연건공정%용황도%정서리해
static analysis%software engineering%use case diagram%program comprehension
用况图从用户的角度描述了系统需求,是表达系统功能的有效方式。如果能从系统源代码中直接抽象程序的用况图,对于程序理解工作将具有很大的帮助。基于此理念,提出了基于用况图的辅助用户程序理解方法。该方法通过静态分析把源代码抽象为树型图表达结构,通过度量计算树型图中各类结点值并生成带权的树型图,根据设定的阈值对该图进行剪裁来控制程序复杂度,通过对剪裁后的树型图进行遍历形成系统的执行路径集合,抽象为最终的候选用况。在图形化工具的辅助支持下从候选用况中抽象出系统的用况图,实验分析取得良好效果。
用況圖從用戶的角度描述瞭繫統需求,是錶達繫統功能的有效方式。如果能從繫統源代碼中直接抽象程序的用況圖,對于程序理解工作將具有很大的幫助。基于此理唸,提齣瞭基于用況圖的輔助用戶程序理解方法。該方法通過靜態分析把源代碼抽象為樹型圖錶達結構,通過度量計算樹型圖中各類結點值併生成帶權的樹型圖,根據設定的閾值對該圖進行剪裁來控製程序複雜度,通過對剪裁後的樹型圖進行遍歷形成繫統的執行路徑集閤,抽象為最終的候選用況。在圖形化工具的輔助支持下從候選用況中抽象齣繫統的用況圖,實驗分析取得良好效果。
용황도종용호적각도묘술료계통수구,시표체계통공능적유효방식。여과능종계통원대마중직접추상정서적용황도,대우정서리해공작장구유흔대적방조。기우차이념,제출료기우용황도적보조용호정서리해방법。해방법통과정태분석파원대마추상위수형도표체결구,통과도량계산수형도중각류결점치병생성대권적수형도,근거설정적역치대해도진행전재래공제정서복잡도,통과대전재후적수형도진행편력형성계통적집행로경집합,추상위최종적후선용황。재도형화공구적보조지지하종후선용황중추상출계통적용황도,실험분석취득량호효과。
Use case diagram is an effective way to express system functions from the perspective of the user, which is often used to describe system demands. If use case diagram of program can be abstracted from the system source code directly, that will be of great help for user to understand program. Based on this idea, a reverse engineering method to enhance program com-prehension for user is designed in this paper. A tree graph express structure of source codes is abstracted by using the static analy-sis method. By setting metric value of the nodes of the tree graph, the weighted tree diagram can be generated. According to the metric it sets, the nodes of the tree graph can be clipped, which controls program complexity. Execution paths of the software, which are the candidates of use cases, are obtained by traversing the clipped tree graph. With the help of graphic tool, use case diagrams can be abstracted from the candidates of use cases, and experimental analysis has gained good effects.