计算机工程与应用 ›› 2009, Vol. 45 ›› Issue (1): 80-85.DOI: 10.3778/j.issn.1002-8331.2009.01.024

• 研发、设计、测试 • 上一篇    下一篇

方面单元测试框架的设计与实现

陈凌鹤,毛晓光,雷 晏,王承松   

  1. 国防科学技术大学 计算机学院,长沙 410073
  • 收稿日期:2008-06-23 修回日期:2008-10-06 出版日期:2009-01-01 发布日期:2009-01-01
  • 通讯作者: 陈凌鹤

Design and implementation of a unit testing framework for aspects

CHEN Ling-he,MAO Xiao-guang,LEI Yan,WANG Cheng-song   

  1. School of Computer,National University of Defense Technology,Changsha 410073,China
  • Received:2008-06-23 Revised:2008-10-06 Online:2009-01-01 Published:2009-01-01
  • Contact: CHEN Ling-he

摘要: 缺乏成熟的方面测试和方面冲突检测技术是阻碍面向方面软件编程大规模应用的瓶颈性问题。针对方面单元测试,提出了无需与基模块编织的方面单元的独立测试框架AJUnit。该框架运用Java注释和源码与字节码映射等技术实现编译细节的透明化。基于控制流和数据流分析,AJUnit综合运用随机测试数据生成、相对测试充分性准则的优化和指定路径的测试数据生成等技术实现测试过程的自动化。文中也介绍了以AJUnit为基础的方面单元测试工具的设计和实现。

Abstract: A bottleneck problem,preventing aspect-oriented programming from massive application,is lack of mature techniques for aspect testing and conflicts detecting.Aiming at testing of aspect units,this paper presents a testing framework AJUnit for independent aspects,without weaving with base modules.The framework makes compiled details transparent by taking techniques of Java annotation and mapping between source code and byte code.Based on analysis of CFGs(Control Flow Diagrams) and DFGs(Data Flow Diagrams),AJUnit automates the testing process by use of techniques of generating test cases randomly,supplemented by optimizing of test cases with respect to test adequacy criterion,and from certain paths as well.This paper also outlines design and implementation of a testing tool for aspect units based on AJUnit.