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& ...
随机推荐
- 【396】python 递归练习题(COMP9021)
Merging two strings into a third one Say that two strings s1 and s2 can be merged into a third strin ...
- windows+Pycharm+Anaconda下安装opencv
本人最近开始使用pycharm,之前一直是在Anaconda环境下跑的程序,在Anaconda Navigator下运行,但发现Jupyter Notebook界面下的程序提示不是很人性化,所以迁移到 ...
- MVC生成页码选择器返回HTML代码
我主要讲此代码用于MVC的分布页. 先看最终效果最终效果: 样式为bootstrap3中的分页“pagination”,如果不使用bootstrap单独提出来并不大 页码生成代码为: public s ...
- jquery 事件的触发与绑定
bind事件绑定: live事件绑定: hover事件绑定: one事件绑定 toggle事件绑定:
- easyui的datagrid某个字段return一个a链接
实现方法用 formatter formatter: function(value, row, index) { return '<a href="javascript:void(0) ...
- StringUtils.isEmpty StringUtils.isBlank
两个方法都是判断字符是否为空的.前者是要求没有任何字符,即str==null 或 str.length()==0:后者要求是空白字符,即无意义字符.其实isBlank判断的空字符是包括了isEmpty ...
- 如何用frp进行来无影去无踪
准备工作 和 注意事项: 1.frp 下载地址 https://github.com/fatedier/frp/releases 2. 需要给有公网ip 的服务端服务器 和 本地客户端服务器 各放一 ...
- Python设计模式 - UML - 时序图(Sequence Diagram)
简介 时序图表示参与者与对象之间.对象与对象之间的动态交互过程及时序关系. 时序图详细而直观地展示了对象随时间变化的状态.调用关系和消息时序,时序图中的主要元素有:参与者(Actor), 对象(Obj ...
- java实现将包含多个<REC>的文件拆成若干只包含一个<REC>的文件
遍历文件夹里的文件,将包含多个<REC>的文件拆成若干只包含一个<REC>的文件 package com.prepub; import java.io.BufferedRead ...
- git log命令常用参数集合
git log 查看 提交历史 默认不用任何参数的话,git log 会按提交时间列出所有的更新,最近的更新排在最上面. 常用的格式占位符写法及其代表的意义.选项 说明%H 提交对象(commit)的 ...