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

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. 分享一个微信自动跳转外部浏览器下载app的api接口!

    现在微信渠道可以说是拉新最快的渠道,因为微信具备强裂变性.但是目前微信对第三方下载链接的拦截是越来越严格了,那么想要在微信内肆无忌惮地推广链接就需要用到微信跳转浏览器的接口,那如何获取该接口呢?   ...

  2. 用phpstudy配置网站遇到的一些问题

    第一次是配置在我本机,总是连不上数据库,后来查看到mysql.ini配置文件里面端口号有一个不是3306,更改之后就好了. 第二次是配置在笔记本电脑上,安装的时候比较顺利,也就遇到80端口被占用还有缺 ...

  3. SQL Server死锁诊断--同一行数据在不同索引操作下引起的死锁

    死锁概述 对于数据库中出现的死锁,通俗地解释就是:不同Session(会话)持有一部分资源,并且同时相互排他性地申请对方持有的资源,然后双方都得不到自己想要的资源,从而造成的一种僵持的现象.当然,在任 ...

  4. Dynamic Method Binding in Delphi 动态方法绑定

    Dynamic Method Binding in Delphi  动态方法绑定 https://docs.dataabstract.com/Delphi/AdvancedTopics/Dynamic ...

  5. spring boot常用注解小计

    @Async 需要执行异步方法时,在方法上加上@Async之后,底层使用多线程技术 .启动类上需要加上 @EnableAsync 注意:异步执行方法,不能与引用方法同在一个类里 @Transactio ...

  6. 《DOM Scripting》学习笔记-——第八章 充实文档的内容

    本章内容 一.一个为文档创建“缩略词语表”的函数 二.一个为文档创建“文献来源链接”的函数 三.一个为文档创建“快速访问键清单”的函数 利用DOM动态的收集和创建一些有用的辅助信息,并把它们呈现在网页 ...

  7. phpstudy设置允许远程访问mysql数据库

    1.先在服务器中通过命令行方式(打开phpstudy界面->右下角其他菜单选项->MySQL工具->MySQL命令行) 登录mysql:mysql   -u root -p 密码 ( ...

  8. docker学习-lnmp+redis之搭建redis容器服务

    1. 目录映射:/lnmp/data/redis:/data/lnmp/conf/redis/redis.conf:/etc/redis/redis.conf/lnmp/logs/redis:/var ...

  9. Python设计模式 - UML - 对象图(Object Diagram)

    简介 对象图和类图的基本概念是类似的,可以看作类图在系统某一时刻的镜像,显示了该时刻系统中参与交互的各个对象以及它们之间的关系. 对象图的元素包括对象.链接.包,元素之间的关系和类图相似. 对象图建模 ...

  10. idea激活方式

    idea破解方法:转自https://note.youdao.com/ynoteshare1/index.html?id=d0f3fb42bfa1bb65a33115a1b6140f5f&ty ...