软件测试: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 ...
随机推荐
- linux防火墙设置常用命令
1.永久性生效,重启后不会复原 开启: chkconfig iptables on 关闭: chkconfig iptables off 2.即时生效,重启后复原 开启: service iptabl ...
- sql业务分割
create Function StrToTable(@str varchar(1000)) Returns @tableName Table ( str2table varchar(50) ) As ...
- 商品规格,自定义SKU类型
<html> <head> <script type="text/javascript" src="http://xoxco.com/exa ...
- web页面弹出窗口代码大全
//-----------按钮提示框----------// <input type="button" name="btn2" id="btn2 ...
- mysql数据库 事务和索引
1.MySQL数据库特性: 原子性(atomidity) 一个事务必须被视为一个不可分割的最小工作单元,整个事务中的所有操作要么全部提交成功,要么全部失败回滚,对于一个事务来说,不可能只执行其中的一 ...
- npm 遇到的坑
在脚手架方式搭建react项目时,输入命令:npm install -g create-react-app,出现错误: UNABLE_TO_VERIFY_LEAF_SIGNATUREUNABLE_TO ...
- register form code(2nd week blog)
register form code(2nd week blog) 注册 用户名: 密码: 确认密码: 邮箱: 电话: 性别: 男 女
- java根据ip地址获取详细地域信息的方法
通过淘宝IP地址库获取IP位置(也可以使用新浪的) 请求接口(GET):http://ip.taobao.com/service/getIpInfo.php?ip=[ip地址字串] 响应信息:(jso ...
- 关于修改banner信息;nginx反向代理apache应用
本周实验 1. Linux下Apache部署一个php页面,返回http数据包中查看server信息,修改Apache 配置使server banner自定义. 2. nginx设置反向代理,代理上面 ...
- Python练习十
1.生成随机整数,从1-5取出来然后输入一个数字,来猜,如果大于,则打印bigger小了,则打印less如果相等,则打印equal. import random num1 = random.randi ...