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

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. cobbler登录web界面时出现“Internal Server Error”

    当进行cobbler配置后,并进行web登录时,出现错误: 先查看其日志位置 #cat /etc/httpd/conf.d/ssl.conf 在其中位置发现其错误的日志位置为/etc/httpd/lo ...

  2. jsp页面选择文件上传,获取不到绝对路径问题

    选择"D:\\temp\file\test.txt"文件,alert(filename)却是"C:\\fakepath\test.txt" 出现D:\\temp ...

  3. 第8章 IO库 自我综合练习

    要求: 文本内容: Tom  11144455 12345678998 Jone  88888888 99999999999 1.将文本文件中的内容读入,并显示到屏幕上: 2.手动输入“Mary 77 ...

  4. Maven插件maven-shade-plugin打包配置

    转载以下两篇文章 https://www.cnblogs.com/fuxinci/p/3356087.html https://chenzhou123520.iteye.com/blog/197132 ...

  5. 【JAVA】String[]配列の相関

    配列の作成: ①String[] str = new String[5]; ②String[] str = new String[]{"","","& ...

  6. CentOS7更改运行级别

    Step 1:查看系统默认运行级别 [root@node-1 html]# systemctl get-default       //图形界面graphical.target [root@node- ...

  7. IDEA访问不到SpringBoot项目webapp下的内容

    参考:https://blog.csdn.net/weixin_43105335/article/details/87863847 https://blog.csdn.net/qq_34797335/ ...

  8. WPF中的数据绑定(初级)

    关于WPF中的数据绑定,初步探讨 数据绑定属于WPF中比较核心的范畴,以下是对WPF中数据绑定的一个初步探讨.个人感觉还是带有问题性质的叙述比较高效,也比较容易懂 第一,什么是数据绑定? 假定有这么一 ...

  9. asp.net asp.net application 升级到 asp.net web 解决找不到控件 批量生成.designer文件

    颇费周折后,其实很简单,只需要生成designer文件后,重新保存所有页面即可.就是懒得写.懒真的是一种病,手上不能懒,脑子里更不能懒,否则就是给自己挖坑,仔细认真,注意细节!!!! PS:注意修改p ...

  10. express基础项目创建

    https://www.cnblogs.com/zhentaoo/p/6392248.html