Program1:

The fault is : for(int i=x.length-1;i>0;i--)        border question

We should change i>0 into i>=0

identify a test case that does not execute the fault:x=null throw exception

identify a test case that executes the fault, but does not result in an error state: x[3]={2,3,5}  y=5

identify a test case that results in an error, but not a failure: x[3]={2,3,5} y=6

program2:

The fault is : for(int i=0;i<x.length;i++)   it is a logic error, searching order is wrong

We should change it into for(int i=x.length-1; i>=0;i--)

identify a test case that does not execute the fault: x=null throw exception

identify a test case that executes the fault, but does not result in an error state: x[1]={0}

identify a test case that results in an error, but not a failure: x[3]={2,3,5}

test homework2 ~ faulty program的更多相关文章

  1. Reading List on Automated Program Repair

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

  2. 【BFS】Tester Program

    [poj1024]Tester Program Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2760   Accepted ...

  3. URAL 2081 Faulty dial

    题目: Faulty dial Pavel has not played ACM for ages, nor does he train teams, nor prepare problems. Th ...

  4. [project euler] program 4

    上一次接触 project euler 还是2011年的事情,做了前三道题,后来被第四题卡住了,前面几题的代码也没有保留下来. 今天试着暴力破解了一下,代码如下: (我大概是第 172,719 个解出 ...

  5. Solved: “Cannot execute a program. The command being executed was \roslyn\csc.exe”

    When you publish your ASP.NET project to a hosting account such as GoDaddy, you may run into the iss ...

  6. 关于The C compiler "arm-none-eabi-gcc" is not able to compile a simple test program. 的错误自省...

    在 GCC ARM Embedded https://launchpad.net/gcc-arm-embedded/ 上面下载了个arm-none-eabi-gcc 用cmake 编译时 #指定C交叉 ...

  7. c中使用gets() 提示warning: this program uses gets(), which is unsafe.

    今天在C代码中使用gets()时提示“warning: this program uses gets(), which is unsafe.”,然后这个程序还能运行,无聊的我开始查阅资料,为啥gets ...

  8. Unable to load R3 module D:\Program Files\Oracle\VirtualBox/VBoxDD.DLL (VBoxDD): GetLastError=1790 (VERR_UNRESOLVED_ERROR).

    Unable to load R3 module D:\Program Files\Oracle\VirtualBox/VBoxDD.DLL (VBoxDD): GetLastError=1790 ( ...

  9. Git for Windows - The Program can't start because libiconv2.dll is missing

    今天在新装的win10 预览版上面,发现git不能启动了,提示信息主要是: The Program can't start because libiconv2.dll is missing 于是我在网 ...

随机推荐

  1. Windows Server 2008 R2安装子域控制器

    一.实验网络拓扑图: 二.实验说明: 子域控制器安装前需要先把主域控制器安装好,然后子域控制器的DNS先指向主域控制器的IP地址 192.168.10.30,主域控制器委派DNS给子域控制器后再把子域 ...

  2. Python常见的运行错误

    (1)忘记在 if , elif , else , for , while , class ,def 声明末尾添加 :(导致 "SyntaxError :invalid syntax&quo ...

  3. 九十分钟极速入门Linux——Linux Guide for Developments 学习笔记

    系统信息:CentOS 64位. 一张图了解命令提示符和命令行 一些实用小命令 mkdir(make directory,创建目录).ls(list,列出当前目录下的内容).rm(remove,删除文 ...

  4. Centos 7 mysql Buffered warning: Changed limits: max_connections: 214 解决方法

    Everytime I restart MySQL I have this warning: [Warning] Buffered warning: Changed limits: max_conne ...

  5. 旅游行业的手机App Top5

    旅游类app分为很多种类,有我们大众认知的典型旅游app像携程旅行,途牛旅游:也有短程的提供代步功能的app,比如滴滴出行,快的打车:还包括我们的火车票,机票的预订app.所以旅游类app是一个很宽阔 ...

  6. c++减法高精度算法

    c++高精度算法,对于新手来说还是一大挑战,只要克服它,你就开启了编程的新篇章,算法. 我发的这个代码并不是很好,占用内存很多而且运行时间很长(不超过0.02秒),但是很好理解,很适合新手 高精算法的 ...

  7. com.caucho.hessian.io.HessianProtocolException: is unknown code 解决方案

    问题: Cannot access Hessian remote service at [http://....../remote/syllabusService]; nested exception ...

  8. Hotelling T2检验和多元方差分析

    1.1 Hotelling T2检验 Hotelling T2检验是一种常用多变量检验方法,是单变量检验的自然推广,常用于两组均向量的比较. 设两个含量分析为n,m的样本来自具有公共协方差阵的q维正态 ...

  9. ExtJs combobox模糊匹配

    下拉列表模糊查询(重要代码): listeners : { beforequery : function(e) { var combo = e.combo; if(!e.forceAll){ var ...

  10. 镁光c400-MTFDDAK064M固态硬盘更新固件

    前段时间笔记本不停地假死机,就是那种系统停止响应,但鼠标依然有动作的死机,各种烦人,后来检测了下系统的温度,发现cpu轻易地上了75度,甚至会到94度,以为风扇该清理了,硅胶该换了,回想了一下,离上次 ...