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& ...
随机推荐
- Django08-批量创建数据
通过views.py文件中创建 第1种方法循环创建数据, 这种方法不推荐,因为每一次循环都会连接一次数据库,效率较慢 def user_list(request): user_all = models ...
- Django06-ORM操作
ORM操作 1.基本操作 # 查 models.Tb1.objects.get(id=123) # 获取单条数据,不存在则报错(不建议) models.Tb1.objects.all() # 获取全部 ...
- ---mipi command
可惜这是5.1系统: http://www.cnblogs.com/lialong1st/p/8534728.html
- oracle EBS SLQ语句
1.查询公司主体 SELECT a.flex_value_id,b.flex_value,B.SUMMARY_FLAG,A.flex_value_meaning,c.flex_value_set_na ...
- jsp页面选择文件上传,获取不到绝对路径问题
选择"D:\\temp\file\test.txt"文件,alert(filename)却是"C:\\fakepath\test.txt" 出现D:\\temp ...
- IEEE/ACM International Conference on Advances in Social Network Analysis and Mining (ASONAM) 2014 Industry Track Call for Papers
IEEE/ACM International Conference on Advances in Social Network Analysis and Mining (ASONAM) 2014 In ...
- 吴裕雄 python 机器学习——岭回归
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model from s ...
- jQuery之遍历索引相关方法
遍历索引相关方法: .each(),补充.children() .index() 1 .each() 2..children() .index()
- CS通用项目系统搭建——三层架构第二天 (补一篇完整的SqlHelper)
#region ExecuteNonQuery(如果是增,删,修) /// <summary> /// 执行sql命令 /// </summary> /// <param ...
- Excel VBA ——字典实用技巧
最近写了一些小功能,对字典有了进一步的理解,太强大了! 个人最近用过的字典应用有这么几个,写下来防止自己忘~同时方便大家 一.查找重复行 [原理]利用字典的exist方法,将数据加入字典时判断一下,如 ...