软件测试: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 ...
随机推荐
- Javascript 严格模式(strict mode)详解
Javascript 严格模式详解 一.概述 除了正常运行模式,ECMAscript 5添加了第二种运行模式:"严格模式"(strict mode).顾名思义,这种模式使得Ja ...
- 07_mysql常用sql语句
一.数据库相关 1.创建数据库: mysql> create database test default character set utf8 collate utf8_general_ci;Q ...
- 在LINUX上查询哪个用户从哪个IP登录,登录时间,执行了什么命令?
在/etc/profile里面加入以下代码 PS1="`whoami`@`hostname`:"'[$PWD]' history USER_IP=`>/dev/null| a ...
- bug狩猎
最近需求少了,终于有时间修一下底层的bug,做一点工具方便查bug,写篇文章简单记录一下. 一是优化了一个玩法进程的启动速度.这个玩法需要用战力做匹配,玩家按战力分段放进不同的桶里,每个桶用skipl ...
- excel 格式化姓名
在做excel时,难免会遇到输入姓名对齐这种情况,如果数据少时我们可以手动敲空格来进行对齐,但数据量大时,手动调整就不是好办法了. 此时我们可以通过excel自带公式对 ...
- jmeter 报错Error in NonGUIDriver java.lang.IllegalArgumentException: Report generation requires csv output format, check 'jmeter.save.saveservice.output_format' property
设置jmeter报个的时候报下面错 只要细心看问题就是把它jmeter.save.saveservice.output_format'的格式改为csv就对 这个属性是在jmeter.propertie ...
- 小程序wx.request的封装
第一次做小程序项目,这个封装方法是同学推荐的一个网址,对我帮助很大,如果想看代码部分,请看网址详细介绍 网络请求都写在Page里,每个请求都要重复的写wx.request以及一些基础配置: 每个页面里 ...
- linux设置自启动redis
vi /etc/init.d/redis # chkconfig: 2345 10 90 # description: Start and Stop redis PATH=/usr/local/bin ...
- PHP连接mysql数据库报错:Call to undefined function mysql_connect()
http://php.net/manual/zh/intro.mysqli.php 系统环境PHP7.0+Mysql5.7+Apache2. 运行一个数据库连接测试示例时报错: [client 127 ...
- 【bug记录】OS Lab3 踩坑记
OS Lab3 踩坑记 Lab3在之前Lab2的基础上,增加了进程建立.调度和中断异常处理.其中测试包括进程建立以及进程调度部分. 由于是第一次做bug记录,而且是调试完bug后再做的记录,所以导致记 ...