Question: Software Testing [please use Java] * The following exercise is intended to encourage you to think of testing in a more rigorous way than you

Software Testing [please use Java]

* The following exercise is intended to encourage you to think of testing in a more rigorous way than you may be used to. The exercise also hints at the strong relationship between specification clarity, faults, and test cases1 .

(a) Write a Java method with the signature

public static Vector union (Vector a, Vector b)

The method should return a Vector of objects that are in either of the two argument vectors.

(b) Upon reflection, you may discover a variety of defects and ambiguities in the given assignment. In other words, ample opportunities for fault exist. Describe as many possible faults as you can. (Note: Vector is a Java collection class. If you are using another language, interpret Vector as a list.)

(c) Create a set of test cases that you think would have a reasonable chance of revealing the faults you identified above. Document a rationale for each test in your test set. If possible, characterize all of your rationales in some concise summary. Run your tests against your implementation.

(d) Rewrite the method signature to be precise enough to clarify the defects and ambiguities identified earlier. You might wish to illustrate your specification with examples drawn from your test cases.

I found the other answer of the same question here, but they haven't met all the assignment requirement, so please do not post the same answer.

Thanks!

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!