摘要
面向对象的软件测试应该也只能被设计所指导。提出了一种方案:在使用UML进行面向对象的设计阶段为类和方法加入OCL约束,然后由一种转换工具将带有OCL约束的UML类图转换为带有JML(Java建模语言,Java Modeling Language)注解的Ja-va类代码框架,就可以利用JML丰富的支撑工具进行调试和自动测试,从而实现了设计指导测试的思想。研究了OCL到JML的转换机制,并给出了基于Rational Rose的转换工具JML-AddIn的实现框架。
The object-oriented test should absolutely reflect the design, and the whole process of the test phase should be thoroughly directed by the design. The OCL constraints are added during the design with UML,and they are translated into Java skeleton code annotated by JML by a special tool. The test can be done automatically by the JML supporting tools. The translation rules between OCL and JML are set and analyzed,and the implementation architecture of the translation tool JML-Addln based on Rational Rose is presented.
出处
《计算机应用与软件》
CSCD
北大核心
2008年第4期106-108,共3页
Computer Applications and Software