软件测试: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. oracle 数据库中某个字段逗号分隔,得到对应列中的个数(列转行)实现方法

    由于各种原因,数据的原则问题,导致某个字段上出现多个数据(依据分隔符隔开),比如 name 字段为 张三;李四;王五等等 需求:求一张表中name字段中出现的个数: 想要得到的结果为: 对应的sql语 ...

  2. java数组的for遍历

    class ArrayDome { public static void main(String[] args) { int[] arr = {12,51,12,11}; //顺序遍历 for(int ...

  3. Django_ORM字段_字段参数

    Object Relational Mapping (ORM) ORM:对象关系映射模式是一种为解决面向对象与关系数据库存在的互补匹配的现象技术.简单说就是通过使用描述对象和数据库之间的映射的元数据, ...

  4. 部署springboot工程到linux上及遇到的坑

    一.步骤 1.将工程打成jar包 IDEA中点击file-project structure,如下图: 选择Artifacts-JAR-From modules,选择入口类Main Class,如下图 ...

  5. 准备学习wrf

    namelist.wps 中的 geog_data_path=后面的文件夹的文件即土地覆被资料:(看下图) 推荐中科院地理所承担的地球系统科学数据共享平台上共享的100m分辨率资料,官网  http: ...

  6. 基于webpack的react开发环境搭建新手教程

    最近学习react-webpack项目搭建,找到一篇我认为不错的博客,跟着学习了一番,写得很详细很好,本篇博客纯属记录总结,要看更详细的搭建过程及解析,请戳: 基于webpack的React项目搭建( ...

  7. 1ubuntu安装虚拟机

    安装相关打软件:(qemu-kvm qemu-system是kvm和qemu的核心包,libvirt-bin用于管理kvm,virt-manager图形管理工具,bridge-utils vlan,主 ...

  8. Maven配置pom.xml,正在下载时网络不佳下载失败的解决方案

    环境:jdk1.7.0_17,Myeclipse 10,apache-maven-3.2.5 配置项目中pom.xml的dependencies时 ,如果本地仓库没有的话,就会自动下载.找不到仓库位置 ...

  9. Spring MVC中一般类使用service

    在Spring MVC中,Controller中使用service只需使用注解@Resource就行,但是一般类(即不使用@Controller注解的类)要用到service时,可用如下方法: 1.S ...

  10. ODS ,EDW,DM

    ODS: 操作数据存储ODS(Operational Data Store),操作型数据仓库,最早的数据仓库模型,是数据仓库体系结构中的一个可选部分,ODS具备数据仓库的部分特征和OLTP系统的部分特 ...