0% found this document useful (0 votes)
115 views5 pages

SE - 2024 - Assignment 12

NPTEL software engineering 2024 week 12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views5 pages

SE - 2024 - Assignment 12

NPTEL software engineering 2024 week 12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

Software Engineering
Assignment-12
TYPE OF QUESTION: MCQ/MSQ
Number of questions: 10 Total mark: 10 X 1 = 10
For each of the following questions one or more of the given options are correct. Choose the
correct options.

QUESTION 1:
Which one of the following statements concerning mutation testing is correct?
a. Mutation testing is used to test if a program has bugs
b. Mutation testing is used to test if it is possible to mutate the program
c. Mutation testing is used to optimize the designed suite
d. Mutation testing is used to test if the test suite is adequate
e. Mutation testing is used to count the number of mutants of the program
Correct Answer: d. Mutation testing is used to test if the test suite is adequate
Detailed Solution:

Main idea of mutation testing is:


Check whether the test suite is able to detect these. This either validates or invalidates the test suite. So,
option d. is correct.
QUESTION 2:
Which one of the following mutants are considered as equivalent mutants?
a. Mutants which arise from the same change to the code
b. Mutants which fail with the same set test cases
c. Mutants which cannot be killed by any test case
d. Mutants which are not detected by any of the test cases
e. Mutants which are designed using equivalence class testing
Correct Answer: c. Mutants which cannot be killed by any test case
Detailed Solution:

The mutant whose introduced change does not modify the meaning of the original program are equivalent
mutant. So, equivalent mutant cannot be killed by test cases.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 3:
Which of the following is not a major shortcoming of the mutation testing technique?
a. Hard to automate mutant generation
b. Certain types of mutants are hard to generate
c. Presence of equivalent mutants make it difficult to automate the entire mutation
testing process
d. Mutation testing is computationally very expensive, as a large number of possible
mutants can be generated.
e. Multiple mutants may get killed by the same test case
Correct Answer: a. Hard to automate mutant generation

Detailed Solution:
The process of generation and killing of mutants:
–Can be automated by predefining a set of primitive changes that can be applied to the program. So,
option a. is correct.

QUESTION 4:
In the context of mutation testing, suppose to create a mutant you replace the instruction y=2*x
in your program by y=x+x. What kind of mutant have you created?
a. Trivial mutant
b. Stillborn mutant
c. Higher-order mutant
d. Equivalent mutant
e. Erroneous mutant

Correct Answer: d. Equivalent mutant

Detailed Solution:
The mutant whose introduced change does not modify the meaning of the original program are equivalent mutant.
Here y=2*x and y = x+x are giving same results. So, option d. is correct.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 5:
At least how many test cases are required to achieve MC/DC coverage of the following code
segment:

If((a>5) or (b<100)) x=x+1;


a. 1
b. 2
c. 3
d. 4
e. 6

Correct Answer: c. 3
Detailed Solution:

In MC/DC, for n basic condition n+1 test cases required. Here n=2, so test cases required =3.

QUESTION 6:
If MC/DC coverage has been achieved on a unit under test, which of the following test coverage
are implicitly implied?

a. Path coverage
b. Multiple condition coverage
c. Condition/decision coverage
d. Statement coverage
e. Data flow coverage

Correct Answer: c. Condition/decision coverage d. Statement coverage


Detailed Solution:

MC/DC subsumes statement coverage and Condition/decision coverage. Please refer slide no. 14 to 15
of week 12 lecture material.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 7:
What is the McCabe’s Cyclomatic complexity measure for the following code segment?

void try(int a[], int b[], int m, int n){


int i, j, k;
j = k = 0;
for (i = 0; i < m + n;) {
if (j < m && k < n) {
if (a[j] < b[k]) {
b[i] = a[j];
j++;
}
}}}

a. 2
b. 3
c. 4
d. 5
e. 6

Correct Answer: c. 4
Detailed Solution:
If we represent a control flow graph of the program we will find, number of edges=10, number of
vertices = 8. So, E-N+2=4.

QUESTION 8:
Which one of the following can be considered as a fault-based testing technique?
a. Cause-effect graphing
b. Data flow testing
c. Orthogonal array testing
d. Mutation testing
e. Pair-wise testing
Correct Answer: d. Mutation testing

Detailed Solution:

Fault-based testing techniques is basically mutation testing.


So, option d. is correct.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 9:
Among the following testing techniques, which one of the following is the strongest?
a. All path coverage testing

b. Basis path coverage testing

c. Decision coverage testing

d. Basic condition coverage testing

e. MC/DC testing

Correct Answer: a. All path coverage testing


Detailed Solution:
All path coverage testing is the strongest testing.

Please refer slide no. 48 of week 12 lecture material.

QUESTION 10:
Which of the following attributes of a program can be inferred from its Cyclomatic complexity?

a. Computational complexity
b. Lines of code (LoC)
c. Understandability
d. Executable code size
e. Testability

Correct Answer: c. Understandability


e. Testability
Detailed Solution:
Cyclomatic complexity infer understandability, testability, psychological complexity of programs.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy