书籍详情

软件单元测试

软件单元测试

作者:顾翔

出版社:电子工业出版社

出版时间:2023-06-01

ISBN:9787121455094

定价:¥89.00

购买这本书可以去
内容简介
  本书对软件单元测试进行了详细介绍。第1 章与第2 章介绍软件单元测试的概念和基础知识;第3 章到第5 章介绍C 语言、Java 语言和Python 语言的单元测试框架和技巧;第6 章与第7 章介绍代码覆盖率工具和代码语法规范检查工具;第8 章通过两个案例详细介绍TDD。读者可以根据自己的需求对以上内容进行选择性阅读或者全部阅读。另外,为了巩固大家的学习效果,每一章结尾都有相应的习题。 本书适合软件开发工程师、测试工程师、项目经理和大学计算机专业本科高年级学生与研究生阅读。
作者简介
  顾翔,1997年毕业于北京工业大学,中国计算机学会(CFF)会员,上海开源协会个人会员,开源网安专家组成员,国家职业教育研究院软件测试、安全专家组成员。著有《软件测试技术实战:设计、工具及管理》《基于Django的电子商务网站设计》《全栈软件测试工程师宝典》《通过案例玩转JMeter(微课版)》图书。软件绿色联盟2018年优秀讲师获得者,先后就职于炎黄新星网络科技有限公司、中兴通讯股份有限公司、意法半导体(中国)有限公司和爱立信通信(中国)有限公司,担任软件开发工程师、软件测试工程师,软件测试经理等职务,积累了丰富的软件研发测试理论和实践经验,精通测试设计、测试管理、安全测试、性能测试、自动化测试、敏捷测试和DevOps测试技术,从2015年起,从事金融、通信、航空、邮政等行业及高校的软件测试咨询和培训服务。
目录
目 录
第1 章 软件单元测试简介 ····································································.1
1.1 桩对象和测试驱动函数 ······························································.1
1.2 测试驱动开发 ·········································································.2
1.3 软件测试应该贯彻始终 ······························································.2
1.4 软件测试金字塔·······································································.3
1.5 单元测试在传统开发模式中的地位 ···············································.4
1.6 单元测试在敏捷开发模式中的地位 ···············································.5
1.7 精准测试 ···············································································.5
1.8 单元测试和白盒测试 ·································································.6
1.9 单元测试的FIRST 原则和AIR 原则 ··············································.7
1.10 习题 ····················································································.7
第2 章 软件单元测试基础知识 ······························································.8
2.1 动态自动化单元测试 ·································································.8
2.1.1 被测程序 ·······································································.8
2.1.2 语句覆盖 ·······································································.8
2.1.3 分支覆盖 ······································································.11
2.1.4 条件覆盖 ·······································································13
2.1.5 条件/分支覆盖 ································································15
2.1.6 MC/DC 覆盖 ··································································15
2.1.7 路径覆盖 ·······································································17
2.1.8 几种覆盖率的强弱关系 ·····················································18
2.1.9 控制流覆盖 ····································································18
2.2 静态自动化单元测试:代码扫描 ··················································19
2.3 手工单元测试:代码调试 ···························································20
2.4 手工单元测试:代码评审 ···························································20
2.5 单元测试中的问题 ····································································20
2.5.1 功能层面的问题·····························································.21
2.5.2 性能层面的问题·····························································.22
2.5.3 安全层面的问题·····························································.22
2.6 习题 ····················································································.23
第3 章 C 语言动态自动化单元测试框架 ·················································.24
3.1 在Windows 下安装C 语言运行环境 ············································.24
3.1.1 安装配置MinGW ···························································.24
3.1.2 安装配置MSYS2 ···························································.25
3.1.3 安装配置IDE ································································.25
3.2 安装编译CUnit ······································································.31
3.2.1 在Windows 下安装CUnit ·················································.31
3.2.2 在Linux 下安装CUnit ·····················································.31
3.2.3 创建被测文件和测试文件 ·················································.32
3.2.4 在Windows 下运行测试文件 ·············································.34
3.2.5 在Linux 下运行测试文件 ·················································.34
3.2.6 运行结果 ·····································································.35
3.3 查看测试报告 ········································································.35
3.4 CUnit 介绍 ············································································.36
3.4.1 CUnit 的四种运行模式 ·····················································.36
3.4.2 CUnit 头文件 ································································.38
3.4.3 CUnit 支持的断言 ··························································.39
3.4.4 CUnit 架构 ···································································.40
3.4.5 CUnit 的基本测试步骤 ·····················································.40
3.5 案例 ····················································································.41
3.5.1 指针操作 ·····································································.41
3.5.2 返回结构体 ··········································
猜您喜欢

读书导航