软件测试:2.Two Faulty Programs

  Questions:

  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 result in an error, but not a failure.

  Answers:

  1.左侧函数fault位于第7行的for循环里的循环条件,循环结束的判断条件有误,对应代码应为

    for(int i=x.length-1; i>=0; i--)

   右侧函数fault位于第7行的for循环里的循环条件,循环遍历数组的方向有误,找到最后一个0的函数,数组应该从后往前遍历,对应代码应为

    for(int i=x.length-1; i>=0; i--)

  2.Identify a test case that does not execute the fault.

   左侧函数:

    test: x=[]; y=3

   右侧函数:

    test: x=[]

  3.Identify a test case that executes the fault, but does not result in an error state.

   左侧函数:

    test: x=[2,3,5]; y=3

   右侧函数:

    test: x=[0]

  4.Identify a test case that result in an error, but not a failure.

   左侧函数:

    test: x=[2,3,5]; y=1

   右侧函数:

    test: x=[1,0,1]

  如果不足,欢迎指教,感激不尽

软件测试:2.Two Faulty Programs的更多相关文章

  1. 软件测试学习日志————round 1 some questions of two small programs

    Below are four faulty programs. Each includes a test case that results in failure. Answer the follow ...

  2. Page 16 Exercises 1.2.3 -------Introduction to Software Testing (Paul Ammann and Jeff Offutt)

    Below are four faulty programs. Each includes a test case that results in failure. Answer the follow ...

  3. ST HW2 fault & error & failure

    Software Testing 3014218128 牛菲菲 Below are two faulty programs. Each includes a test case that result ...

  4. Reading List on Automated Program Repair

    Some resources: https://www.monperrus.net/martin/automatic-software-repair 2017 [ ] DeepFix: Fixing ...

  5. Software Testing 2 —— Fault、error and failure小练习

    Questions: Below are two faulty programs. Each includes a test case that results in failure. Answer ...

  6. 小公司0成本基于Pythony的单元\GUI\Web自动化\性能的几个开源软件测试工具

    以下是当前流行的几款适合小公司0成本的几个开源软件测试解决方案: 1.单元测试 a.unittest :Python自带的单元测试框架 b.pyunit:Junit的Python版本 2.使用Pyho ...

  7. Anliven - 基础知识梳理汇总 - 软件测试

    基础知识梳理 - 软件测试 - 概念 基础知识梳理 - 软件测试 - 分类 基础知识梳理 - 软件测试 - 流程 基础知识梳理 - 软件测试 - 用例 基础知识梳理 - 软件测试 - 方法 基础知识梳 ...

  8. IEEE829-2008软件测试文档标准介绍

    1998版中定义了一套文档用于8个已定义的软件测试阶段: 测试计划: 一个管理计划的文档 包括:   测试如何完成 (包括SUT的配置).   谁来做测试   将要测试什么   测试将持续多久 (虽然 ...

  9. some simple recursive lisp programs

    1. Write a procedure count-list to count the number of elements in a list (defun count-list (numbers ...

随机推荐

  1. TCP协议和UDP协议下的socket

    UDP协议的服务端和客户端: ##udp_服务端 import socket udp_server = socket.socket(type=socket.SOCK_DGRAM)#选择udp协议 ip ...

  2. WEB学习笔记2-结构组织和文件命名

    常用的前端文件的组织结构: .js(放置javascript代码) .lib(放置框架javascript文件) .custom.js .css(放置CSS样式代码) .lib(放置框架CSS文件) ...

  3. AI之旅(7):神经网络之反向传播

    前置知识   求导 知识地图   神经网络算法是通过前向传播求代价,反向传播求梯度.在上一篇中介绍了神经网络的组织结构,逻辑关系和代价函数.本篇将介绍如何求代价函数的偏导数(梯度). 梯度检测   在 ...

  4. MySQL基本操作——1

    1.命令行启动或关闭MySQL服务:方式一:计算机--右击管理--服务方式二:net start MySQL服务器名称net stop MySQL服务器名称 2.登录和退出(必须在MySQL服务启动的 ...

  5. scrapy基本使用

    Scrapy笔记 安装scrapy框架 安装scrapy: 通过pip install scrapy 如果是在Windows上面,还需要安装pypiwin32,如果不安装,那么以后运行scrapy项目 ...

  6. SpringSecurity身份验证基础入门

    对于没有访问权限的用户需要转到登录表单页面.要实现访问控制的方法多种多样,可以通过Aop.拦截器实现,也可以通过框架实现(如:Apache Shiro.Spring Security). pom.xm ...

  7. jQuery之基础核心(demo)

    jQuery之基础核心     作者的热门手记 jQuery之基础核心(demo)   本文主要简单的介绍下jQuery一些基础核心,大致了解jQuery使用模式.适用于有HTML.CSS.javas ...

  8. mininet的学习之一

    mininet命令 (1)--topo (2)--switch (3)--controller (4)--mac 内部交互命令 添加主机 添加链路 添加接口 添加IP 确定是否创建成功 用h1 pin ...

  9. centos7进单用户

    当重启linux系统,进入系统选择页面的时候,按e 在linux16那一行最后面添加 init=/bin/sh 按ctrl+c 挂载根分区,可读写 mount / -o rw, remount

  10. FlexRay通信机制

    通信周期是 FlexRay 的基本通信单元[6~7,19].每个通信周期包括四个时间层,如图 2-9 所示.通信周期由静态段(Static Segment).动态段(Dynamic Segment). ...