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& ...
随机推荐
- 'Settings' object has no attribute 'FYFQ_URL_test'
读取django settings内容时报错: 'Settings' object has no attribute 'FYFQ_URL_test' 原因:settings中的变量,必须都是大写
- 日常杂记——C#验证码
随机生成验证码,不能以图片的形式存在,所以需要将验证码图片以MemoryStream形式存储在内存的流当中,但是在使用时发现使用PictureBox控件无法显示内存流,所以需要先将流转化为图片,才可以 ...
- MSSQL 表修复语句
一早发现C盘爆满了,查询了下发现是mssql下面占用了几十G的log以及mdmp文件 一般发现这种文件就是代表着数据库出问题了. 检查数据库,发现某个数据库有问题,(回想起来前天做了一个操作,可能有问 ...
- mongodb插入数据获取本次插入的mongodb id
最近接了一个别人的项目做二次开发,使用php进行mongodb的数据操作时,需要插入数据后得到相应的mongodb 中的id,简单代码如下 $data = array('test' => 'aa ...
- python中TCP协议中的粘包问题
TCP协议中的粘包问题 1.粘包现象 基于TCP实现一个简易远程cmd功能 #服务端 import socket import subprocess sever = socket.socket() s ...
- 1.Sed | Awk | Grep | Find
1.Sed | Awk | Grep | Find 可以参考的文档链接 CentOS7 查看 当前机器 已经启动的端口的Shell命令: netstat -lntup | awk -F' ' {'pr ...
- 程序配置的原则和实践以及 Spring Boot 支持方式
原则 软件需要在不同的环境中部署,代码是保持不变的,但是不同的运行环境存在差异,所以需要使用配置适应不同的环境.比如: 数据库,Redis,以及其他 后端服务 的配置: 第三方服务的证书,如 oAut ...
- Visual Studio 注释与取消注释快捷键
注释: 先CTRL+K,然后CTRL+C 取消注释: 先CTRL+K,然后CTRL+U
- Java简单操作dubbo(一)
dubbo-service公共Service package com.itman.service; public interface UserService { // 提供服务 使用userId查找用 ...
- 网站改版应对google
客户要求修改网站,这会给我们带来问题!为了保留他的网站权重和关键字排名,我们必须在做网站修改工作之前分析他原来网站的连接结构和标题,这样我才能更好地保证他原来网站的整体权重不会有大的变化!以下是我们根 ...