一种基于使用模型和可执行规格说明的软件测试框架

上传人:E**** 文档编号:111792387 上传时间:2019-11-03 格式:PDF 页数:71 大小:1.28MB
返回 下载 相关 举报
一种基于使用模型和可执行规格说明的软件测试框架_第1页
第1页 / 共71页
一种基于使用模型和可执行规格说明的软件测试框架_第2页
第2页 / 共71页
一种基于使用模型和可执行规格说明的软件测试框架_第3页
第3页 / 共71页
一种基于使用模型和可执行规格说明的软件测试框架_第4页
第4页 / 共71页
一种基于使用模型和可执行规格说明的软件测试框架_第5页
第5页 / 共71页
点击查看更多>>
资源描述

《一种基于使用模型和可执行规格说明的软件测试框架》由会员分享,可在线阅读,更多相关《一种基于使用模型和可执行规格说明的软件测试框架(71页珍藏版)》请在金锄头文库上搜索。

1、合肥工业大学 硕士学位论文 一种基于使用模型和可执行规格说明的软件测试框架 姓名:程胜来 申请学位级别:硕士 专业:计算机技术 指导教师:邵堃 2009-06 I 一种基于使用模型和可执行规格说明的软件测试框架一种基于使用模型和可执行规格说明的软件测试框架 摘 要 摘 要 如何提高测试软件的正确性和可靠性是软件工程中最棘手的问题之 一,软件测试是其中一个比较重要的手段。对于大型复杂软件系统,基于 模型的测试往往存在模型建立困难和输入空间爆炸的问题,而基于使用模 型的测试又不能完成对被测件执行结果的验证。为更好的解决这些问题, 本文提出了一种基于使用模型和可执行规格说明的软件测试框架。完成的 主

2、要工作有以下三个方面: 1、应用一种基于使用模型和可执行规格说明的测试框架,将这两种测 试方法结合起来,从而解决了这些问题或者至少降低了其中的难度。该测 试框架可适用的前提在于测试人员耗费在被测件功能规格说明描述上的代 价必须大幅度小于实现被测件的代价,这样才可以在构建复杂的使用模型 的前提下将测试软件本身的耗费维持在一个比较低的水平。 在对 OpenLDAP 主服务程序 slapd 测试的实验中,通过详细的代价分析论证了这一点。 2、使用面向重放的软件架构,提高了测试软件本身的可靠性。目前大 多重放技术涉及到工具的开发,它们存在两方面的缺点:一是工具的开发 需要耗费;二是缺乏移植性,往往在某

3、一平台下实现的重放技术或者工具 无法在另外一个平台下使用。采用面向重放的软件架构来实现的软件系统 自身便具备可重放性。 3、介绍了纯实体和纯属性的概念,并证明了:在面向重放架构的支持 下,纯实体和纯属性中的错误都可以按照系统化的方法通过重放调试出来。 在对 OpenLDAP 主服务程序 slapd 测试的实验中,按照基于使用模型和可 执行规格说明的测试框架的要求,采用面向重放的软件架构,实现了测试 软件 Tester。通过对 Tester 实现的详细分析,发现 Tester 中绝大部分的代码 都可以组织成纯实体和纯属性。 关键词关键词: 软件测试,使用模型,可执行规格说明,面向重放的软件架构

4、- II - A New Software Test Framework Based On Model-use And Executable Specification Abstract How to enhance the correctness and reliability of the testing software is one of the toughest problems in software engineering, one solution to which is by software test. For large scale and complicated sof

5、tware system, however, model-based test always faces the common difficulties of model establishment and input space explosion, while model-use-based test usually fails to verify the test results of the tested software. To better address these problems, this paper suggests a new software test framewo

6、rk which is based on model-use and executable specification. The major work covered lies in the following three aspects: First, the paper application of the forward a new software test framework based on model-use and executable specification. The combination of the two solves, or at least reduces,

7、the difficulties mentioned. The application of this test framework lies in the precondition that the expenses of the making of the specification by the test engineers must be considerably smaller than that of the tested object. In this way, with the construction of complicated use model, the test co

8、st will be maintained at a relatively low level, which has been confirmed by detailed analysis in the test of the main server software slapd of OpenLDAP. Second, the paper use of a software framework based on playback, which can improve the reliability of test software. Currently, playback technolog

9、y mainly involves the development of tools, the demerits of which are mainly the following two: on the one hand, tool development is costly; on the other hand, it lacks transplantablility, which means that the playback tech in one platform may not be usable in another platform. A software system bas

10、ed on playback framework itself is playbackable. Third, the paper introduced forward two conceptions: “pure entity” and “pure attribute” and confirms that the errors of the two can both be tested out by systemized playback. In the testing experiment of the main server software slapd of OpenLDAP, acc

11、ording to the requirement of the test framework based on model-use and executable specification, and with the application of playbackable software framework, it realizes the test software Tester, a further research of which shows that the majority of codes of Tester can be organized as pure entity o

12、r pure attribute. Key words:Testing software , Usage model , Executable specification , Replay-oriented software architecture. - VI - 图表清单 图表清单 图 2-1 软件测试框架 . 7 图 2-2 模型(规格说明)的抽象关系 . 8 图 2-3 联机测试时的测试框架 11 图 3-1 软件测试系统的正确性逻辑 12 图 3-2 OpenLDAP 功能测试系统结构组成 13 图 3-3 OpenLDAP 功能测试系统实体图 13 图 3-4 实体事件交互示意图

13、14 图 3-5 事件的定义 15 图 3-6 属性基类 15 图 3-7 属性样例 15 图 3-8 属性 cmd_validator 的实现 16 图 3-9 实体 entity 基类 16 图 3-10 验证器实体的简化实现 . 17 图 3-11 事件总线 . 18 图 3-12 架构示意图 . 18 图 3-13 纯属性的代码通式 . 20 图 3-14 纯实体的代码通式 . 20 图 3-15 实体 case_displayer 的实现 23 图 3-16 代码比例饼图 . 25 图 3-17 硬盘消耗量与用例数量关系图 . 26 图 4-1 LDAP 结构 27 图 4-2 LD

14、AP 信息模型 28 图 4-3 LDAP 命名模型 28 图 4-4 目录服务网络结构图 29 图 4-5 目录服务网络应用示意图 30 图 4-6 测试系统结构图 31 图 4-7 OpenLDAP 功能测试软件体系结构 33 图 4-8 实体 Executor 在框架中的位置 . 37 图 4-9 OpenLDAP 库及主要模块 38 图 4-10 用户的生命期 . 39 图 4-11 管理员行为状态机 . 40 图 5-1 GCov 代码覆盖结果 44 图 5-2 代码覆盖比例图 45 图 5-3 数据库“id2entry.bdb”中存取的数据示例 46 - VII - 图 5-4 采

15、用 hdb 后端时数据库“dn2id.bdb”的存储示例 . 47 图 5-5 目录项在slapd内存中的结构 48 图 5-6 目录树在slapd内存中的结构 49 图 5-7 目录数据在Tester中的类型 . 50 图 5-8 目录树在Tester内存中的结构 . 50 图 5-9 Tester的 search 函数实现 . 50 图 5-10 函数 get_candidates 的实现 51 图 5-11 函数 get_subtree_dn 的实现 51 图 5-12 get_subtree_dn 的 C 语言实现 . 52 图 5-13 函数 bdb_dn2entry 的实现 52

16、图 5-14 函数 bdb_cache_find_ndn 的实现 53 图 5-15 ID 号在内存中的存储 . 56 图 5-16 Tester对 filter 的词法语法分析结果 57 图 5-17 filter 在slapd中的结构 . 57 - VIII - 表格清单 表格清单 表 3-1 不同情况的论证 . 22 表 3-2 测试软件Tester的统计数据表 . 24 表 3-3 实体属性比例分析表 25 表 4-1 元素交互关系说明表 . 30 表 4-2 被测件功能点和测试点 . 31 表 4-3 测试系统结构关系表 . 32 表 4-4 对图 4-7 中实体和属性的简要说明. 33 表 4-5 事件基本类型 slapd_command 34 表 4-6 事件基本类型 slapd_command_result. 35 表 4-7 事件基本类型 bind_request. 35 表 4-8 事件基本类型 bind_result 36 表 4-9 事件类型 event_type. 36 表 5-1 测试点覆盖用例表 42 表 5-2 测试软件Tester代码信息表 43

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号