Tag: testing

Questions Related to testing

  1. I, II & III

  2. II, III & IV

  3. I, II & IV

  4. I, III & IV


Correct Option: C
Explanation:

The correct answer is C. I, II & IV.

Explanation: I. It strives to ensure that quality is built into software: This statement is true as software verification and validation programs aim to ensure that quality is built into the software development process. II. It provides management with insights into the state of a software project: This statement is true as a software verification and validation program provides management with insights into the progress, quality, and state of a software project. III. It ensures that alpha, beta, and system tests are performed: This statement is not necessarily true for all software verification and validation programs. While these types of tests are commonly performed, it is not a requirement for all programs. IV. It is executed in parallel with software development activities: This statement is true as a software verification and validation program typically runs concurrently with software development activities to ensure that quality is maintained throughout the development process.

Therefore, the correct answer is C. I, II & IV.

  1. 1 test for statement coverage, 3 for branch coverage

  2. 1 test for statement coverage, 2 for branch coverage

  3. 1 test for statement coverage, 1 for branch coverage

  4. 2 tests for statement coverage, 3 for branch coverage

  5. 2 tests for statement coverage, 2 for branch coverage


Correct Option: B
Explanation:

To solve this question, the user needs to know the concepts of statement coverage and branch coverage in software testing.

Statement coverage means that each statement in the code is executed at least once during testing. Branch coverage means that each possible branch or decision point in the code is executed at least once during testing.

In the given code, there are two decision points:

  1. IF P+Q > 100
  2. If P > 50

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

A. 1 test for statement coverage, 3 for branch coverage: This option is incorrect because it requires 3 tests for branch coverage. However, there are only two decision points in the code, so it is not possible to have three branches. Therefore, option A is incorrect.

B. 1 test for statement coverage, 2 for branch coverage: This option is correct. To achieve statement coverage, only one test case is required where P = 50 and Q = 51. This will execute all statements in the code. To achieve branch coverage, two test cases are required: one where P = 50 and Q = 51 (to cover the first decision point) and another where P = 51 and Q = 50 (to cover the second decision point). Therefore, option B is the correct answer.

C. 1 test for statement coverage, 1 for branch coverage: This option is incorrect because there are two decision points in the code that require two test cases for branch coverage. Therefore, option C is incorrect.

D. 2 tests for statement coverage, 3 for branch coverage: This option is incorrect because there are only two decision points in the code that require two test cases for branch coverage. Therefore, option D is incorrect.

E. 2 tests for statement coverage, 2 for branch coverage: This option is incorrect because only one test case is required for statement coverage. Therefore, option E is incorrect.

The Answer is: B. 1 test for statement coverage, 2 for branch coverage.

  1. Requires knowledge on the bug fixes and how it affect the system

  2. Includes the area of frequent defects

  3. Includes the area which has undergone many/recent code changes

  4. All of the above


Correct Option: D

Complete statement and branch coverage means:

  1. That you have tested every statement in the program.

  2. That you have tested every statement and every branch in the program.

  3. That you have tested every IF statement in the program.

  4. That you have tested every combination of values of IF statements in the program


Correct Option: B

AI Explanation

To answer this question, we need to understand the concepts of statement coverage and branch coverage in software testing.

Statement coverage refers to the percentage of statements in a program that have been executed during testing. It ensures that every statement in the program has been executed at least once. This helps in identifying any potential errors or flaws in individual statements.

Branch coverage, on the other hand, refers to the percentage of branches in a program that have been executed during testing. A branch is a decision point in the program, such as an IF statement or a loop. Branch coverage ensures that every possible branch in the program has been taken at least once. This helps in identifying any potential errors or flaws in the decision-making logic of the program.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) That you have tested every statement in the program - This option is incorrect. Statement coverage ensures that every statement has been executed, but it does not guarantee that every branch has been taken.

Option B) That you have tested every statement and every branch in the program - This option is correct. Branch coverage ensures that every branch has been taken, in addition to every statement being executed. Therefore, this option covers both statement coverage and branch coverage.

Option C) That you have tested every IF statement in the program - This option is incorrect. Testing every IF statement does not guarantee that every branch has been taken, as there may be other decision points in the program that are not IF statements.

Option D) That you have tested every combination of values of IF statements in the program - This option is incorrect. While testing every combination of values of IF statements may help achieve branch coverage, it does not guarantee statement coverage or coverage of other decision points in the program.

The correct answer is B) That you have tested every statement and every branch in the program. This option covers both statement coverage and branch coverage, ensuring that every statement and every branch in the program have been executed during testing.

  1. An inspection is lead by the author, whilst a walkthrough is lead by a trained moderator

  2. An inspection has a trained leader, whilst a walkthrough has no leader

  3. Authors are not present during inspections, whilst they are during walkthroughs

  4. A walkthrough is lead by the author, whilst an inspection is lead by a trained moderator


Correct Option: D