基于MVC模型和行为描述的Web应用测试框架
2017-04-10蒋破荒徐建明
蒋破荒 徐建明



摘 要: MVC模型分离设计的思想提高了软件的整体质量,然而由于模型只定义了静态架构组件的配置,其并不能明显地提供Web应用程序开发过程中的行为表现,这导致了Web应用程序的描述和其行为特性间较为明显的差异。为了解决这一问题,提出一种行为模型来填补该差异,即对该程序的URL请求序列自动接收机制进行模式化,为Web应用程序提出一个基于行为模式的测试框架。研究表明,当集中于循环行为自动机制时,该框架可提供Web应用程序更好的测试标准。最后,将框架应用于Jakarta Struts框架的配置方案中,其结果表明,该行为模型在对Web应用的测试路径进行分类时取得了较好的效果。
关键词: 计算机软件; MVC构架; Jakarta Struts框架; 软件测试
中图分类号: TN911?34; TP311.5 文献标识码: A 文章编号: 1004?373X(2017)06?0071?04
Abstract: Although the separation design thought of MVC model has improved the overall quality of the software, but because the model only defines the configuration of static architectural components, MVC model con not clearly provide the behavioral expression of Web application program development process, which leads to the obvious differences between the description of Web application program and its behavioral characteristics. To fill this difference, a behavior model is proposed in this paper, in which the automatical receiving mechanism of the URL request sequence of the program is modeled, and a testing framework based on behavior pattern is proposed for Web application program. The research result shows that, when it is focused on the cyclic behavior of an automatic mechanism, this framework can provide a better test standard for Web application program. The result that the framework is applied to the configuration scheme of Jakarta Struts framework shows that the behavior model has achieved a very good effect in the classification of the testing paths of the Web application.
Keywords: computer software; MVC architecture; Jakarta Struts framework; software testing
0 引 言
Web应用是计算机响应系统外的网络请求所需的一种软件技术,其基本特征是根据不同交互系统和环境所表现出的特殊行为机制。在传统基于功能模块的软件中,输入输出关系极为重要,这种特征影响着软件架构的各个方面[1?3]。网页应用普遍建立在基于MVC架构上的J2EE平台上,其为Sun 微系统公司制定的一系列構建网页应用的基础API接口集合。MVC模型给出了在API之上来结合组件以开发网页应用的架构模型,其旨在采用合适的方式对组件进行分离式设计,增加Web应用的可维护性和可重用性。然而,由于MVC模型仅提供抽象的形式,导致了行为描述在描述组件静态架构关系时被分离,在实际开发调试及测试的过程中两者差异较大[4?6]。……
