如上面两个小程序中,分析下列问题:

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的更多相关文章

  1. 「BUAA OO Unit 1 HW1」面向测试小白的简易评测机

    「BUAA OO Unit 1 HW1」面向测试小白的简易评测机 声明:本评测机所使用数据生成来自郭鸿宇同学,这对本评测机非常重要 目录 「BUAA OO Unit 1 HW1」面向测试小白的简易评测 ...

  2. 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 ...

  3. Software Testing hw1

    I still remember the error which I made in my java project last year. I spent a whole night solving  ...

  4. HW1.3

    public class Solution { public static void main(String[] args) { System.out.println(" J A V V A ...

  5. HW1.2

    public class Solution { public static void main(String[] args) { System.out.println("Welcome to ...

  6. HW1.1

    public class Solution { public static void main(String[] args) { System.out.println("Welcome to ...

  7. HW1.7

    public class Solution { public static void main(String[] args) { System.out.println("π = " ...

  8. HW1.6

    public class Solution { public static void main(String[] args) { System.out.println("1 + 2 + 3 ...

  9. HW1.5

    public class Solution { public static void main(String[] args) { System.out.println("(9.5 * 4.5 ...

  10. HW1.4

    public class Solution { public static void main(String[] args) { System.out.println("a a^2 a^3& ...

随机推荐

  1. thinkphp5.1的公共函数库 common.php

    首先引入Db类 或者是模型 use think\Db; 然后写公共函数 function getUserName($id){ return Db::table('zh_user')->where ...

  2. linux 文件压缩与解压

    zip格式: zip -r(源文件是目录) [目标文件] [源文件] unzip -d [解压到的目录] [要解压的文件] gz格式: gzip [源文件]   #会删除源文件 gzip -c [源文 ...

  3. Day06 - Ruby三种存取限制:Public,Protected,Private

    前情提要: 在第五天的最后,我们提到了一句话“相同的class的实体也无法使用别人的singleton method”. 在今天,我们把焦点放在Ruby的method,继续了解存取限制:) Ruby经 ...

  4. Build Tool/Maven, Gradle

    一.Build Tool 1.什么是Build Tool build tool是可以自动由源代码创建可执行的应用程序的程序. Building 包括编译.链接和打包代码成一个可用的或可执行形式. 在小 ...

  5. python--第二十一/二天总结

    Python的WEB框架 Bottle Bottle是一个快速.简洁.轻量级的基于WSIG的微型Web框架,此框架只由一个 .py 文件,除了Python的标准库外,其不依赖任何其他模块. 1 2 3 ...

  6. 浅析MVC模式与三层架构的区别

    浅析MVC模式与三层架构的区别 三层架构和MVC是有明显区别的,MVC应该是表现模式(三个加起来以后才是三层架构中的UI层).三层架构(3-tier application) 通常意义上的三层架构就是 ...

  7. np.where()命令介绍

  8. 2018-2019-2 20175126谢文航 实验一《Java开发环境的熟悉》实验报告

    一.实验报告封面 课程:Java程序设计 班级:1751班 姓名:谢文航 学号:20175126 指导教师:娄嘉鹏 实验日期:2019年3月28日 实验时间:--- 实验序号:实验一 实验名称:Jav ...

  9. C/C++字符串使用整理

    在C语言中,字符串有多种操作与处理方法.话不多说,下面就整理一下C语言中字符串的使用整理. 1.头文件 字符串的头文件: #include<cstring> 2.输入 通常,字符串有多种输 ...

  10. pythone函数基础(13)发送网络请求

    需要导入urllib模块,request模块发送网络请求有两种方法 第一种方法# from urllib.request import urlopen# from urllib.parse impor ...