hw1

如上面两个小程序中,分析下列问题:
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 results in an error, but not a failure.
答:1.
程序1 for循环里i没有遍历到数组里第一个数
程序2 for循环是从前往后循环,应该从后往前循环,因为是找最后一个0;还有一点就是应为length-1,而不是length;
2.
程序1: test: x=null; y=5
程序2: all case will execute the fault
3.
程序1: test: x=[1,3,5]; y=5
程序2: test: x=null;
4
程序1:test: x=[1,3,5]; y=0
程序2:test: x=[2,0,2];
hw1的更多相关文章
- 「BUAA OO Unit 1 HW1」面向测试小白的简易评测机
「BUAA OO Unit 1 HW1」面向测试小白的简易评测机 声明:本评测机所使用数据生成来自郭鸿宇同学,这对本评测机非常重要 目录 「BUAA OO Unit 1 HW1」面向测试小白的简易评测 ...
- Software Project Management hw1
I just want to say something about my java project that I did last year. Our task is to finish a lin ...
- Software Testing hw1
I still remember the error which I made in my java project last year. I spent a whole night solving ...
- HW1.3
public class Solution { public static void main(String[] args) { System.out.println(" J A V V A ...
- HW1.2
public class Solution { public static void main(String[] args) { System.out.println("Welcome to ...
- HW1.1
public class Solution { public static void main(String[] args) { System.out.println("Welcome to ...
- HW1.7
public class Solution { public static void main(String[] args) { System.out.println("π = " ...
- HW1.6
public class Solution { public static void main(String[] args) { System.out.println("1 + 2 + 3 ...
- HW1.5
public class Solution { public static void main(String[] args) { System.out.println("(9.5 * 4.5 ...
- HW1.4
public class Solution { public static void main(String[] args) { System.out.println("a a^2 a^3& ...
随机推荐
- EventEmitter:nodeJs事件触发机制
Node.js 所有的异步 I/O 操作在完成时都会发送一个事件到事件队列 Node.js 里面的许多对象都会分发事件:一个 net.Server 对象会在每次有新连接时触发一个事件, 一个 fs.r ...
- C# 构造函数中base和this的使用。
使用base时,首先给父类中的构造函数赋值. 使用this时,先调用父类无参构造函数,再调用自身其他构造函数并对其赋值,最后调用自身当前构造函数.
- EL表达式与JSTL标签map遍历varStatus属性下标使用
在JSP页面开发中,JSTL标签库迭代标签<c:forEach>为我们迭代遍历数组集合提供了一种选择. 遍历过程中varStatus属性为我们遍历集合提升了很大操作空间. 贴一下具体使用 ...
- K8s存储卷、pv和pvc的使用
emptyDIR 临时目录 hostPath :使用主机的路径 网络存储: 传统的设备存储:NAS,SAN 分布式存储:glusterfs,rbd,cephfs 云存储:EBS,Azure,阿里云的 ...
- 2017-11-11 Sa Oct How to open a browser in Python
2017-11-11 Sa Oct How to open a browser in Python python -m webbrowser "http://www.example.com/ ...
- 初识docker
什么是docker Docker 最初是 dotCloud 公司创始人 Solomon Hykes 在法国期间发起的一个公司内部项目,于 2013 年 3 月以 Apache 2.0 授权协议开源,主 ...
- Java框架spring Boot学习笔记(七):@Configuration,@bean注解
@Configuration作用在类上,相当于一个xml文件 @bean作用于方法上,相当于xml配置中的<bean>标签 一个例子: 新建一个Springboot工程 新建一个User类 ...
- poj2182(线段树求序列第k小)
题目链接:https://vjudge.net/problem/POJ-2182 题意:有n头牛,从1..n编号,乱序排成一列,给出第2..n个牛其前面有多少比它编号小的个数,记为a[i],求该序列的 ...
- input控制输入保留一位小数
function zlip(obj){ obj.value = obj.value.replace(/[^\d.]/g,""); //清除“数字”和“.”以外的字符 obj.val ...
- Docker端口映射
Docker端口映射是指将容器内应用的服务端口映射到本机宿主机器.当要在宿主机外部访问Docker内部应用时,需要对容器内应用端口进行映射. 一.容器启动时指定端口映射 容器运行时可以通过-p 或 - ...