Question: Question Number 5. Answer questions below for findLast() and countPositive() only. When you write a test case, write it in terms of (a) input, (b)

Question Number 5. Answer questions below for findLast() and countPositive() only. When you write a test case, write it in terms of (a) input, (b) expected output and (c) actual output.

1.Explain what is wrong with the given code. Describe the fault precisely by referring to the line with the fault.

2.If possible, give a test case that does not execute the fault. Explain it. If not, briefly explain why not.

3.If possible, give a test case that executes the fault, but does not result in a failure. Explain it. If not, briefly explain why not.

4.The test given with the code is a test case that results in a failure. Write a different test that results in the failure and explain why it fails.

5. Question Number 5. Answer questions below for findLast() and countPositive() only. WhenRewrite the code with the fault fixed.

Below are four faulty programs. Each includes test inputs that result in failure. Answer the following questions about each program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!