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& ...
随机推荐
- JEECG 上传插件升级-标签
前言: 现有的uploadify上传是基于swf的,随着H5的普及,flash即将退出历史舞台,JEECG团队本着与时俱进的原则,将全面升级JEECG系统中的上传功能,采用新式上传插件plupload ...
- 微信小程序海报生成功能
如果是H5页面的话给大家推荐一款不错的插件html2canvas,这个插件可以将html元素转为canvas并一键生成png图片,但是本文的重点是在小程序上如何实现生成图片的功能.因为小程序没有DOM ...
- hbase 存储结构和原理
HBase的表结构 建表时要指定的是:表名.列族 建表语句 create 'user_info', 'base_info', 'ext_info' 意思是新建一个表,名称是user_info,包含两个 ...
- jquery中的 deferred之 then (二)
例: var def = $.Deferred(); var prs1 = def.then(function (val) { var result = val + "_123" ...
- 浅谈Tomcat和Servlet
本文浅谈下对Tomcat和Servlet总体的理解,初学时有用过一段时间,但当时疲于应对如何xml配置和使用,对他们的理解就像是一个黑匣子.现在回顾一下帮助自己加深网络的理解.开始还是先推荐我看的文章 ...
- 爬虫之scrapy扩展
针对pipelines的扩展 from scrapy.exceptions import DropItem class CustomPipeline(object): def __init__(sel ...
- 基于mysql创建库的报错解决小记mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database
mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database异常处理 1.找到find / -name my. ...
- Appium 学习三:Appium-Desktop 填坑
之前使用appium执行自动化脚本,现使用appium-desktop 遇到了一些问题 1.使用name定位的报错 Locator Strategy 'name' is not supporte ...
- SQL语句 拆分某些字段,一行变多行
原文链接:http://bbs.csdn.net/topics/310219852 ------------------------------------- -- Author : liangCK ...
- Centos 7下网卡bonding配置之mode4
一.bonding技术 bonding(绑定)是一种linux系统下的网卡绑定技术,可以把服务器上n个物理网卡在系统内部抽象(绑定)成一个逻辑上的网卡,能够提升网络吞吐量.实现网络冗余.负载等功能,有 ...