软件测试: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. WEEX入坑指南(1)

    weex create newtest 然后在某个阶段卡死, 解决方案: 在路径下创建新建文件夹,并命名为项目的名称.

  2. 团队合作one

    一.项目介绍 为生活在长大的学生提供方快捷的生活服务,通过帖子发现自己志同道合的朋友,记录自己在长大点滴.本项目的意义在于锻炼团队的scrum能力,加强团队合作能力.确定本项目采用的技术方向:本项目整 ...

  3. rm: cannot remove ' xxx': Permission denied

    一般出现这个问题的原因是权限被改变了,使用chown 修改即可 可参考:chmod.chgrp.chown详解 linux chmod命令和chown命令

  4. Springboot,SSM框架比较,区别

    百度搜 Springboot,SSM框架区别,大多说的都是 1.springboot一个应用是一个可执行jar 2.将原有的xml配置,简化为java配置 他们说的确实没错,可是根本没有说到本质,百度 ...

  5. html中头meta信息

    一.页面关键字 网站关键字:用户通过搜索引擎能搜到该网站的词汇.最好控制在10个以内. 基本语法: <meta name="keywords" content="具 ...

  6. ubuntu18安装微信

    1.从git下载tar包 wget http://github.com/geeeeeeeeek/electronic-wechat/releases/download/V2.0/linux-x64.t ...

  7. CMDB-(paramiko模块 -- 实现ssh连接)

    import paramiko # 实现ssh功能的模块 ssh = paramiko.SSHClient() # 实例化对象 ssh.set_missing_host_key_policy(para ...

  8. sklearn learn preprocessing

    train_test_split sklearn.model_selection.train_test_split(*arrays, test_size(float,int/None),#defaul ...

  9. hibernate二级缓存整合

    <?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http:// ...

  10. PY序

    Python实现机器学习依赖于两个类库——SciPy和scikit-learn 一)SciPy SciPy是数学运算的基本类库,在机器学习的过程中,主要运用NumPy.Matplotlib和Panda ...