Homework2_3015218130_许鹏程

Posted picheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Homework2_3015218130_许鹏程相关的知识,希望对你有一定的参考价值。

program 1 :

Identify the fault.
for (int i=x.length-1; i > 0; i--)
change to:
for (int i=x.length-1; i >= 0; i--)
 
If possible, identify a test case that does not execute the fault. (Reachability)
text: x=[ ]; y=2
Expected: NullPointerException
 
If possible, identify a test case that executes the fault, but does not result in an error state.
text: x=[2,3,5]; y=3
Expected= 1
 
If possible identify a test case that results in an error, but not a failure.
text: x=[2,3,5]; y=6
Expected= -1
 

program 2:

Identify the fault.
for (int i = 0; i < x.length; i++)
change to:
for (int i =x.length-1;i>=0; i--)
 
If possible, identify a test case that does not execute the fault. (Reachability)
text: x=[ ];
Expected: NullPointerException
 
If possible, identify a test case that executes the fault, but does not result in an error state.
text: x=[0,1,1];
Expected= 0
 
If possible identify a test case that results in an error, but not a failure.
text: x=[1,1,1];
Expected= -1

以上是关于Homework2_3015218130_许鹏程的主要内容,如果未能解决你的问题,请参考以下文章

Homework1_3015218130_许鹏程

在 Flask 中允许 CORS

在正则表达式电子邮件中允许 + 验证电子邮件 [重复]

大数据技术之_03_Hadoop学习_02_入门_Hadoop运行模式+本地运行模式+伪分布式运行模式+完全分布式运行模式(开发重点)+Hadoop编译源码(面试重点)+常见错误及解决方案(示例代(代

Java千百问_07JVM架构(010)_什么是老生代的标记算法

undefined reference to symbol '_ZNK11GenICam_3_016GenericException17GetSourceFileNameEv'(示例代