软件测试: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 ...
随机推荐
- PHP分帧后台模板页面css样式,js引入方法
一,首先把下载好的分帧后台模板放到对应的目录中,HTML显示页面放到View目录中,CSS和JS.img图片等公共资源放到include目录中 二.然后开始准备更改CSS和JS , img路径操作:( ...
- VirtualBox安装Archlinux并配置桌面环境
最近无聊,就找来archlinux来玩一玩,去archlinux wiki上看了一下教程.以下是操作过程. 1. 下载镜像,下载地址; 2. 启动archlinux并选择Boot Arch Linux ...
- Spring Boot 定时任务使用
详情参考文章https://blog.csdn.net/qq_31001665/article/details/76408929
- web框架---django
15:31:14一.web框架1.框架:即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统,简单地说,就是你用别人搭建好的舞台来做表演. ...
- js···DOM2动态创建节点
1.生成节点的方法 document.createElement(“div”) 2.插入节点的方法 父元素.appendChild(新节点) 在父节点中的子节点后面插入新的节点 3.在指定的位置 ...
- python 多线程共享全局变量的问题
多线程都是在同一个进程中运行的.因此在进程中的全局变量所有线程都是可共享的. 这就造成了一个问题,因为线程执行的顺序是无序的.有可能会造成数据错误. 直白理解:也就是多线程执行的时候,同时对一个全局变 ...
- OO第二单元作业分析
前言 这一单元关于线程安全的作业结束了,在助教提供的接口的帮助以及老师提供的设计模型的指导下,这三次作业还是相对轻松地完成了,中间也没有出现什么bug,可能就是因为简单的逻辑不容易出错吧,可惜两次都由 ...
- PyCharm设置仿sublime配色__Py版本2018.3.5
效果图: 导出settings 模板为: 1.https://files.cnblogs.com/files/xier/PyCharm_settings.zip 2.https://files.cnb ...
- H5 实现图片上传预览
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- 图片万能居中css
.div{text-align:center;} .div img{vertical-align:middle;} .div:after{content:"";display:in ...