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

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. activiti官网实例项目activiti-explorer之扩展流程节点属性

    节点中添加“关联表单”属性 1,stencilset.json中加入如下代码 , {    "name" : "approveTypepackage",    ...

  2. Python 3.7 安装Twisted

    win10电脑  64位系统 Python 3.7 版本安装Twisted-18.9.0-cp37-cp37m-win32.whl 会成功 先下载下来,放到 Scripts文件夹下 然后cmd 我的是 ...

  3. EMF32名词解释

    (EFM32)32位节能微控制器(Energy Friendly Microcontroller 32-bit) (Gecko)壁虎 (Starter Kit)入门套件 (STK)入门套件 (Debu ...

  4. 使用mysqldump以分隔文本格式转储数据

    1.使用mysqldump以分隔文本格式转储数据 mysqldump --tab=/tmp/data --fields-terminated-by=, --fields-enclosed-by=&qu ...

  5. Ymodem协议说明

      模块的固件烧录过程,由Term(发送方)发送固件文件,模块(接收方)接收并写入MCU,期间使用的数据传输协议是ymodem协议. 一.概述 ymodem协议是一种发送并等待的协议,即发送方发送一个 ...

  6. 富文本编辑器 CKeditor 配置使用 (带附件)

    Ckeditor下载地址:http://ckeditor.com/download 1.CKeditor的基本配置 var textval=CKEDITOR.instances.TextArea1.g ...

  7. MFC列表控件更改一行的字体颜色

    参考自(http://blog.csdn.net/ribut9225/article/details/6720639) 1.首先从CListCtrl 继承一个类,命名为CListCtrlCl 在头文件 ...

  8. 开源虚拟化KVM(二)管理虚拟存储

    五,管理虚拟存储 5.1 虚拟磁盘概述 5.1.1 虚拟化项目中存储的注意事项 [x] 存储的性能几乎总是虚拟化的瓶颈 [x] 通过多个硬盘驱动以分布磁盘I/O来实现存储解决方案 [x] 考虑部署集中 ...

  9. python经典案例

    前言:初学者对python的流程语句有一定的了解,但是运用起来总会磕磕碰碰.本文总结了一些初学者在学习python时做的经典案例 一.名片管理系统(限单个名片) info = {'name':'jam ...

  10. Java框架spring 学习笔记(十四):注解aop操作

    回见Java框架spring Boot学习笔记(十三):aop实例操作,这里介绍注解aop操作 首先编写一个切入点HelloWorld.java package com.example.spring; ...