A test case has which of the following elements?

  1. A test environment description and test instructions

  2. A set of inputs, execution preconditions, and expected outcomes

  3. A test plan, test inputs, and logging instructions.

  4. Execution instructions and a function description to determine correct outcome


Correct Option: B
Explanation:

To answer this question, the user needs to know what a test case is and its elements. A test case is a set of steps or conditions that are used to test a specific aspect of a software program. It includes a set of inputs, execution preconditions, and expected outcomes.

Now, let's go through each option and explain why it is right or wrong:

A. A test environment description and test instructions: This option is incorrect. While a test case may include test instructions, it is not limited to only that. A test environment description is not an essential element of a test case.

B. A set of inputs, execution preconditions, and expected outcomes: This option is correct. A test case includes a set of inputs, execution preconditions, and expected outcomes. Inputs are the data that is entered into the system as part of the test case, execution preconditions are the conditions that must be met before the test case can be run, and expected outcomes are the results that are expected from the test case.

C. A test plan, test inputs, and logging instructions: This option is incorrect. A test case is a part of a test plan, but it is not the test plan itself. The test inputs are an essential element of a test case, but logging instructions are not necessary.

D. Execution instructions and a function description to determine correct outcome: This option is incorrect. While execution instructions are a part of a test case, they are not the only element. A function description to determine the correct outcome is not a necessary part of a test case.

Therefore, the answer is: B. A set of inputs, execution preconditions, and expected outcomes.

Find more quizzes: