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. RabbitMQ学习总结 第七篇:RCP(远程过程调用协议)

    在http://www.cnblogs.com/leocook/p/mq_rabbitmq_2.html 这篇博文中我们实现了怎么去使用work queue来把比较耗时的任务分散给多个worker. ...

  2. hive 搭建

    Hive hive是简历再hadoop上的数据库仓库基础架构,它提供了一系列的工具,可以用来进行数据提取转化加载(ETL),这是一种可以存储,查询和分析存储再hadoop种的大规模数据机制,hive定 ...

  3. java环境变量的设置

    java安装好后需要配置一下环境变量,配置方法如下: 1.在系统变量里添加两条记录: 1)变量名:JAVA_HOME,变量值为java安装路径,如:C:\Program Files\Java\jdk1 ...

  4. Android四大组件之Activity

    实验内容 了解Activity的四个状态 Activity的生命周期 启动另外一个Activity 实验要求 编码实现观察Activity的生命周期函数执行过程 编码实现启动另外一个Activity ...

  5. SSIS2012 项目部署模型

    SSIS 2012 支持两种部署模型:项目部署模型和包部署模型. 使用项目部署模型可以将项目部署到 Integration Services 服务器,使用包部署模型可以将单独的包部署到Integrat ...

  6. react 调用 native 的callShareAllFunc()方法,实现分享

    let shareName = { '0': '微信', '1': '朋友圈', '2': '新浪微博', '3': ' QQ', '4': 'QQ空间'};render(){ //分享YztApp. ...

  7. charles抓包工具的中文乱码解决方法

    charles是 MAC上最好用的抓包工具.charles 网上的参考文档已经很多,我就不再赘述啦.只是说说我在安装过程遇到的问题和解决方法,仅供参考. charles抓包的数据中的中文内容显示乱码, ...

  8. Leetcode: Convex Polygon

    Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...

  9. html radio check

    {% if classes|count > 1 %} <div class="class_checkbox" id="class_checkbox" ...

  10. CAS学习笔记(二)—— cas server端的login-webflow详细流程

    一.配置文件介绍 关于spring的配置信息只需放入WEB-INF/spring-configuration目录即可,cas启动时会自动加载.这个目录下的spring配置文件几乎不需要改动. 在web ...