首页 | 官方网站   微博 | 高级检索  
     

UML模型和Java代码之间的一致性检测方法
引用本文:曾 一,李函逾,刘慧君,余双双,周 波.UML模型和Java代码之间的一致性检测方法[J].计算机科学,2015,42(4):151-155.
作者姓名:曾 一  李函逾  刘慧君  余双双  周 波
作者单位:1. 重庆大学计算机学院 重庆400030;软件理论与技术重庆市重点实验室 重庆400030
2. 重庆大学计算机学院 重庆400030
基金项目:本文受国家自然科学基金:自然最近邻居的特征分析与应用研究(61272194)资助
摘    要:针对代码与模型之间的不一致性问题,提出了一种基于UML模型和Java代码之间的一致性检测方法.首先,对UML类图和时序图进行形式化描述,并提出时序调用图(SD-CG)这一概念,在此基础上完成类的关联关系到关联属性的转换以及UML时序图到时序调用图SD-CG的转换;其次,通过方法调用图CG来表达类方法之间的调用关系,从而反映代码动态行为,由此通过对Java源代码的词法分析与语法分析,可获得类的信息及方法调用图CG;然后设计了UML模型与Java源代码间一致性检测算法,包括对类间静态信息以及时序调用图SD-CG与方法调用图CG间的一致性检测;最后,通过开发UML模型与Java源代码一致性检测工具,验证了所提出的方法是可行有效的.

关 键 词:UML模型  Java代码  时序调用图  方法调用图  一致性检测

Consistency Detection Method between UML Model and Java Source Code
ZENG Yi,LI Han-yu,LIU Hui-jun,YU Shuang-shuang and ZHOU Bo.Consistency Detection Method between UML Model and Java Source Code[J].Computer Science,2015,42(4):151-155.
Authors:ZENG Yi  LI Han-yu  LIU Hui-jun  YU Shuang-shuang and ZHOU Bo
Affiliation:College of Computer Science,Chongqing University,Chongqing 400030,China;Key Laboratory of Software Theory and Technology in Chongqing,Chongqing 400030,China,College of Computer Science,Chongqing University,Chongqing 400030,China,College of Computer Science,Chongqing University,Chongqing 400030,China;Key Laboratory of Software Theory and Technology in Chongqing,Chongqing 400030,China,College of Computer Science,Chongqing University,Chongqing 400030,China and College of Computer Science,Chongqing University,Chongqing 400030,China
Abstract:Aiming at the problem of inconsistencies between the code and the model,this paper presented a consistency detection method based on UML model and the JAVA code.Firstly,the UML class diagram and sequence diagram are formalized and a concept of sequence diagram call graph(SD-CG) is put forward.On this basis,the transformation from the associated relationship between classes to the associated attribute of class and the transformation from the sequence diagram to sequence diagram call graph are completed.Thirdly,based on call graph which is made up of class methods being as nodes and the call relation between them being as edges,to analyze the dynamic behavior in the source code,this paper got the information of Java classes and the method call graph (CG) by the lexical analysis and syntax analysis of Java source code.Then the consistency detection algorithm between UML model and Java source code was designed,including the static information consistency detection and the interactive information consistency detection.At last,we developed a prototype tool which can complete information consistency detection to verify the feasibility and effectiveness of the proposed method.
Keywords:UML model  Java code  Sequence diagram call graph(SD-CG)  Call graph(CG)  Consistency detection
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《计算机科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号