软件测试:2.Two Faulty Programs
软件测试:2.Two Faulty Programs

Questions:
1.Identify the fault;
2.If possible, identify a test case that does not execute the fault; (Reachability)
3.If possible, identify a test case that executes the fault, but does not result in an error state;
4.If possible, identify a test case that result in an error, but not a failure.
Answers:
1.左侧函数fault位于第7行的for循环里的循环条件,循环结束的判断条件有误,对应代码应为
for(int i=x.length-1; i>=0; i--)
右侧函数fault位于第7行的for循环里的循环条件,循环遍历数组的方向有误,找到最后一个0的函数,数组应该从后往前遍历,对应代码应为
for(int i=x.length-1; i>=0; i--)
2.Identify a test case that does not execute the fault.
左侧函数:
test: x=[]; y=3
右侧函数:
test: x=[]
3.Identify a test case that executes the fault, but does not result in an error state.
左侧函数:
test: x=[2,3,5]; y=3
右侧函数:
test: x=[0]
4.Identify a test case that result in an error, but not a failure.
左侧函数:
test: x=[2,3,5]; y=1
右侧函数:
test: x=[1,0,1]
如果不足,欢迎指教,感激不尽
软件测试:2.Two Faulty Programs的更多相关文章
- 软件测试学习日志————round 1 some questions of two small programs
Below are four faulty programs. Each includes a test case that results in failure. Answer the follow ...
- Page 16 Exercises 1.2.3 -------Introduction to Software Testing (Paul Ammann and Jeff Offutt)
Below are four faulty programs. Each includes a test case that results in failure. Answer the follow ...
- ST HW2 fault & error & failure
Software Testing 3014218128 牛菲菲 Below are two faulty programs. Each includes a test case that result ...
- Reading List on Automated Program Repair
Some resources: https://www.monperrus.net/martin/automatic-software-repair 2017 [ ] DeepFix: Fixing ...
- Software Testing 2 —— Fault、error and failure小练习
Questions: Below are two faulty programs. Each includes a test case that results in failure. Answer ...
- 小公司0成本基于Pythony的单元\GUI\Web自动化\性能的几个开源软件测试工具
以下是当前流行的几款适合小公司0成本的几个开源软件测试解决方案: 1.单元测试 a.unittest :Python自带的单元测试框架 b.pyunit:Junit的Python版本 2.使用Pyho ...
- Anliven - 基础知识梳理汇总 - 软件测试
基础知识梳理 - 软件测试 - 概念 基础知识梳理 - 软件测试 - 分类 基础知识梳理 - 软件测试 - 流程 基础知识梳理 - 软件测试 - 用例 基础知识梳理 - 软件测试 - 方法 基础知识梳 ...
- IEEE829-2008软件测试文档标准介绍
1998版中定义了一套文档用于8个已定义的软件测试阶段: 测试计划: 一个管理计划的文档 包括: 测试如何完成 (包括SUT的配置). 谁来做测试 将要测试什么 测试将持续多久 (虽然 ...
- some simple recursive lisp programs
1. Write a procedure count-list to count the number of elements in a list (defun count-list (numbers ...
随机推荐
- [转]CentOS7利用systemctl添加自定义系统服务
原文:https://www.cnblogs.com/saneri/p/7778756.html CentOS7自定义系统服务 CentOS7的服务systemctl脚本存放在:/usr/lib/sy ...
- matlab中特殊符号如希腊字符
使用legend 'Best' 图标标识放在图框内不与图冲突的最佳位置'BestOutside' 图标标识放在图框外使用最小空间的最佳位置 legend('sin','cos','location', ...
- Golang基本语法
(1) 全局变量与局部变量 首先,得了解go代码块,也就是"{}",代码块外面访问不到代码块里面的变量. 在go语言里,变量民首写字母为大写则是全局变量,首写字母小写则是局部变量. ...
- Map<String,Integer>acount字符串出现的次数
- ITextSharp构造PDF文件
1.1 生成Document Document是我们要生成的PDF文件所有元素的容器,因此要生成一个PDF文档,必须首先定义一个Document对象. Document有三种构造函数: publ ...
- Ubuntu18.04下make menuconfig缺少ncurses库
kent@hu:~/work/03-kernel/linux-4.15.1$ make menuconfig *** Unable to find the ncurses libraries or t ...
- Mybatis---架构图
- 【项目经验】Mockito教程
一.教程 转载:https://blog.csdn.net/sdyy321/article/details/38757135/ 官网: http://mockito.org API文档:http:// ...
- Spring BOOT的学习笔记
1,静态文件夹src/main/resources/static下的,图片必须放在images文件夹下才能访问,直接放在static下不能访问 2,配置热部署,否则修改下Html,图片都得重启 htt ...
- vue-router 路由跳转:和name配对的是params,和path配对的是query
1.命名路由name搭配params,刷新页面参数会丢失 2.路由path搭配query,刷新页面数据不会丢失 3.接收参数使用this.$router,就能获取到参数的值