MauryaHub PYQ Practice

Software Testing · Quiz 2 · Jan 2026

Software Testing · Quiz 2 · Jan 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

19 / 20 published solutions

Question 2 MCQ · 5.0 marks

Edge-pair coverage is not subsumed by prime path coverage due to which of the following reasons?
6406536642130.
Because prime path coverage does not subsume edge coverage.
6406536642131.
Because all edge-pairs are simple paths.
6406536642132.
Because edge-pair coverage requires self-loops to be visited.
6406536642133.
Edge-pair coverage is subsumed by prime path coverage.

Published solution

**1. Identify the key property:** Prime paths are simple paths. Edge-pair coverage also requires consecutive edges involving self-loops, such as m-n-n and n-n-m, which repeat an internal vertex and are not simple. **Answer: C — Because edge-pair coverage requires self-loops to be visited..** A: **Incorrect:** PPC does subsume ordinary edge coverage. B: **Incorrect:** Some self-loop edge pairs are not simple paths. C: **Correct:** It requires self-loop-related edge pairs that PPC can miss. D: **Incorrect:** Universal subsumption fails for graphs with self-loops.

Report a correction for Q2

Question 3 MCQ · 5.0 marks

Consider four partitions with blocks
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
. If the base choice is
Source diagram or notation
. What is the total number of tests required to satisfy Base Choice Coverage (BCC) criterion?
6406536642134.
10
6406536642135.
11
6406536642136.
12
6406536642137.
14

Published solution

**1. Use the base test:** Start with \((A_2,B_1,w,Z_1)\). **2. Vary one characteristic at a time:** For block counts 4,2,5,3, BCC needs \[1+(4-1)+(2-1)+(5-1)+(3-1)=11.\] **Answer: B — 11.** A: **Incorrect:** The stated structure gives 11, rather than 10. B: **Correct:** This equals the independently counted result 11. C: **Incorrect:** The stated structure gives 11, rather than 12. D: **Incorrect:** The stated structure gives 11, rather than 14.

Report a correction for Q3

Question 4 MCQ · 5.0 marks

Consider the predicate
Source diagram or notation
. Which of the following options represents
Source diagram or notation
, i.e. the conditions under which clause
Source diagram or notation
determines
Source diagram or notation
?
6406536642138.Source diagram or notation
6406536642139.Source diagram or notation
6406536642140.Source diagram or notation
6406536642141.Source diagram or notation

Published solution

**1. Compare c values:** For \(p=(a\lor b)\land\neg c\), c=true makes p=false, while c=false makes \(p=a\lor b\). **2. Require a change:** Flipping c changes p exactly when \(a\lor b=true\). Hence \(p_c=a\lor b\). **Answer: D — \(a\lor b\).** A: **Incorrect:** Both a and b false make c inactive. B: **Incorrect:** Negating a is not the required determination condition. C: **Incorrect:** This is incorrect when a=false,b=false, and misses a=false,b=true. D: **Correct:** At least one of a,b true allows c to determine the predicate.

Report a correction for Q4

Question 5 MCQ · 5.0 marks

A university is designing an online course management system for students and faculty. One requirement of the system is that instructors must be able to create and manage course content, including assignments and quizzes. What type of requirement does this represent?
6406536642142.
Functional requirement
6406536642143.
Non-functional requirement
6406536642144.
Regulatory requirement
6406536642145.
Business requirement

Published solution

**1. Identify the key property:** Creating and managing assignments and quizzes is a specific capability the system must provide, so it is functional. **Answer: A — Functional requirement.** A: **Correct:** It specifies required application behaviour. B: **Incorrect:** It is a capability rather than a quality constraint. C: **Incorrect:** No regulatory obligation is stated. D: **Incorrect:** It describes detailed system functionality rather than a high-level business objective.

Report a correction for Q5

Question 6 MCQ · 5.0 marks

Consider a program that calculates a fixed shipping cost for online orders based on package weight (in kilograms) using these rules: • If weight is between 0.5 to 1.4 kg, shipping cost is Rs. 5.00. • If weight is between 1.5 to 4.9 kg, shipping cost is Rs. 10.00. • If weight is between 5.0 to 9.9 kg, shipping cost is Rs. 20.00. • If weight is 10.0 kg or above, shipping cost is Rs. 50.00. Assume weight is measured and recorded rounded to one decimal place. How many equivalence class partitions can be identified for this input domain?
6406536642146.
3
6406536642147.
4
6406536642148.
5
6406536642149.
6

Published solution

**1. Identify valid price classes:** 0.5–1.4, 1.5–4.9, 5.0–9.9, and 10.0 or higher have four different charges. **2. Add invalid weights:** Values below 0.5 form one additional invalid class. One-decimal rounding removes gaps between the stated valid ranges. Thus there are five classes. **Answer: C — 5.** A: **Incorrect:** The stated structure gives 5, rather than 3. B: **Incorrect:** The stated structure gives 5, rather than 4. C: **Correct:** This equals the independently counted result 5. D: **Incorrect:** The stated structure gives 5, rather than 6.

Report a correction for Q6

Question 7 MCQ · 5.0 marks

Cyclomatic complexity represents the number of _____________ in the control flow graph of a program.
6406536642150.
prime paths
6406536642151.
loops
6406536642152.
test paths
6406536642153.
linearly independent paths

Published solution

**1. Identify the key property:** Cyclomatic complexity is the size of a basis of linearly independent control-flow paths. **Answer: D — linearly independent paths.** A: **Incorrect:** Prime paths belong to a different coverage criterion. B: **Incorrect:** The number of loops alone does not determine complexity. C: **Incorrect:** All test paths can be far more numerous or infinite. D: **Correct:** The path-basis size equals cyclomatic complexity.

Report a correction for Q7

Question 8 MCQ · 5.0 marks

Consider the following range for a thermostat's allowable temperature setting (in degrees Celsius).
Source diagram or notation
Which of the following test input sets would satisfy maximal Boundary Value Analysis (BVA) for the given partition?
6406536642154.Source diagram or notation
6406536642155.Source diagram or notation
6406536642156.Source diagram or notation
6406536642157.Source diagram or notation

Published solution

**1. Identify limits:** For \(-10\le temp\le40\), test immediately below, at, and above each endpoint. **2. Collect boundary neighbourhoods:** \(\{-11,-10,-9\}\) and \(\{39,40,41\}\) together give the maximal set offered. **Answer: B — \(\{-11,-10,-9,39,40,41\}\).** A: **Incorrect:** It misses the just-inside values −9 and 39. B: **Correct:** It covers below/at/above both endpoints. C: **Incorrect:** It only checks the endpoints. D: **Incorrect:** It omits out-of-range values on both sides.

Report a correction for Q8

Question 9 MCQ · 5.0 marks

Consider the following code segment for symbolic testing.
Source diagram or notation
Choose the appropriate path constraint (PC) for the
Source diagram or notation
loop with a sequence of
Source diagram or notation
Source diagram or notation
outcomes followed by a
Source diagram or notation
. Consider each
Source diagram or notation
as a fresh symbolic value.
6406536642158.Source diagram or notation
6406536642159.Source diagram or notation
6406536642160.Source diagram or notation
6406536642161.Source diagram or notation

Published solution

**1. Read the continuation condition:** Each positive input is added. Zero or negative input triggers break. **2. Express n continuing inputs and a stop:** \[PC=\left(\bigwedge_{i=0}^{n-1}r_i>0\right)\land r_n\le0.\] The initial accumulator a does not affect input numbering. **Answer: A — \((\bigwedge_{i=0}^{n-1}r_i>0)\land r_n\le0\).** **Convention note:** The literal while(true) guard never becomes false. The question’s outcomes refer to continuing versus breaking after reading a fresh input. A: **Correct:** It gives n positive inputs followed by a nonpositive input. B: **Incorrect:** Zero cannot continue, and input numbering does not start at a. C: **Incorrect:** This encodes n+1 continuing inputs. D: **Incorrect:** It has incorrect bounds, continuation inequality and exit index.

Report a correction for Q9

Question 10 MSQ · 5.0 marks

Consider the predicate
Source diagram or notation
. Which of the following options are true?
6406536642162.
The predicate is in DNF.
6406536642163.
The predicate is in CNF.
6406536642164.
There are
Source diagram or notation
possible valuations for this predicate
6406536642165.
There are
Source diagram or notation
possible valuations for this predicate

Published solution

**1. Read the form:** \((x\land y\land z)\lor(\neg a\land\neg b)\lor(\neg p\land q)\) is a disjunction of conjunctions: DNF. **2. Count independent Boolean inputs:** There are seven distinct variables x,y,z,a,b,p,q, hence \(2^7=128\) valuations. **Answer: A, D — DNF and 2^7 valuations.** A: **Correct:** The top-level connective joins conjunctions by OR. B: **Incorrect:** The displayed expression is not a conjunction of disjunctions. C: **Incorrect:** Three counts conjunction groups rather than seven independent Boolean variables. D: **Correct:** Seven independent variables give 2^7 valuations.

Report a correction for Q10

Question 11 MCQ · 5.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Considering the row numbers (#) given in the truth table, which of the following is a CACC pair for clause
Source diagram or notation
?
6406536642166.
(3,7)
6406536642167.
(3,8)
6406536642168.
(3,6)
6406536642169.
(2,5)

Published solution

**1. Activate a:** In \(p=\neg c\lor(a\land\neg b)\), a determines p only if c=true and b=false. **2. Choose opposite a values with opposite p outcomes:** Row 3 is (T,F,T), giving p=true. Row 7 is (F,F,T), giving p=false. Both make a active, satisfying CACC. **Answer: A — (3,7).** A: **Correct:** Both rows make a active and switch both a and p. B: **Incorrect:** Row 8 has c=false, which masks a and makes p=true. C: **Incorrect:** Row 6 has b=true,c=false and masks a. D: **Incorrect:** Neither pair member makes a active under the required b,c setting.

Report a correction for Q11

Question 12 MCQ · 5.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Considering the row numbers (#) given in the truth table, which of the following is a RICC pair for clause
Source diagram or notation
?
6406536642170.
(2, 4) for
Source diagram or notation
, no feasible pair for
Source diagram or notation
6406536642171.
(3, 4) for
Source diagram or notation
, no feasible pair for
Source diagram or notation
6406536642172.
(1, 3) for
Source diagram or notation
, no feasible pair for
Source diagram or notation
6406536642173.
(1, 4) for
Source diagram or notation
, no feasible pair for
Source diagram or notation

Published solution

**1. Make c inactive:** For \(p=\neg c\lor(a\land\neg b)\), a=true,b=false force p=true regardless of c. **2. Hold a,b fixed:** Rows 3 and 4 differ only in c and both keep p=true. An inactive c cannot keep p=false because setting c=false always makes p=true. **Answer: B — (3,4) for p=true; no pair for p=false.** A: **Incorrect:** Rows 2 and 4 change b rather than c. B: **Correct:** Rows 3 and 4 change only c and keep p=true. C: **Incorrect:** Rows 1 and 3 change b and do not keep p unchanged. D: **Incorrect:** Rows 1 and 4 change more than c.

Report a correction for Q12

Question 13 MCQ · 5.0 marks

Consider the control flow graph (CFG),
Source diagram or notation
, where • Set of vertices
Source diagram or notation
• Set of edges
Source diagram or notation
• Initial vertex
Source diagram or notation
• Final vertex
Source diagram or notation
Based on the above data, answer the given subquestions.
What is the cyclomatic complexity of
Source diagram or notation
?
6406536642174.
5
6406536642175.
6
6406536642176.
3
6406536642177.
4

Published solution

**1. Count the connected graph:** \(N=6\), \(E=7\). **2. Calculate:** \(V=E-N+2=7-6+2=3\). **Answer: C — 3.** A: **Incorrect:** The stated structure gives 3, rather than 5. B: **Incorrect:** The stated structure gives 3, rather than 6. C: **Correct:** This equals the independently counted result 3. D: **Incorrect:** The stated structure gives 3, rather than 4.

Report a correction for Q13

Question 14 MCQ · 5.0 marks

Consider the control flow graph (CFG),
Source diagram or notation
, where • Set of vertices
Source diagram or notation
• Set of edges
Source diagram or notation
• Initial vertex
Source diagram or notation
• Final vertex
Source diagram or notation
Based on the above data, answer the given subquestions.
How many test requirements are there for edge-pair coverage on
Source diagram or notation
?
6406536642178.
8
6406536642179.
7
6406536642180.
9
6406536642181.
10

Published solution

**1. Enumerate length-two paths:** 1-2-3, 1-2-6, 2-3-4, 3-4-5, 4-5-4, 4-5-6, 5-4-5. **2. Count each distinct adjacent-edge combination:** These are seven edge-pair requirements. **Answer: B — 7.** A: **Incorrect:** The stated structure gives 7, rather than 8. B: **Correct:** This equals the independently counted result 7. C: **Incorrect:** The stated structure gives 7, rather than 9. D: **Incorrect:** The stated structure gives 7, rather than 10.

Report a correction for Q14

Question 15 MCQ · 5.0 marks

Consider the control flow graph (CFG),
Source diagram or notation
, where • Set of vertices
Source diagram or notation
• Set of edges
Source diagram or notation
• Initial vertex
Source diagram or notation
• Final vertex
Source diagram or notation
Based on the above data, answer the given subquestions.
What is the minimum number of test paths needed to acheive edge coverage on
Source diagram or notation
.
6406536642182.
3
6406536642183.
2
6406536642184.
1
6406536642185.
4

Published solution

**1. Supply two covering paths:** 1-2-6 covers the early exit; 1-2-3-4-5-4-5-6 covers the longer branch and both loop directions. **2. Prove minimality:** Once an execution takes 2→6 it terminates, so no single path can cover that edge and 2→3. Two paths are necessary and sufficient. **Answer: B — 2.** A: **Incorrect:** The stated structure gives 2, rather than 3. B: **Correct:** This equals the independently counted result 2. C: **Incorrect:** The stated structure gives 2, rather than 1. D: **Incorrect:** The stated structure gives 2, rather than 4.

Report a correction for Q15

Question 16 MCQ · 5.0 marks

Consider the following data flow graph and answer the subsequent questions.
Source diagram or notation
How many test requirements are there to satisfy All-Defs Coverage for variable
Source diagram or notation
?
6406536642186.
1
6406536642187.
2
6406536642188.
3
6406536642189.
4

Published solution

**1. Locate definitions:** x is defined at node 1 and redefined at node 4. **2. Cover each definition:** Both have reachable print(x) uses, so each requires at least one definition-clear use path: two obligations. **Answer: B — 2.** A: **Incorrect:** The stated structure gives 2, rather than 1. B: **Correct:** This equals the independently counted result 2. C: **Incorrect:** The stated structure gives 2, rather than 3. D: **Incorrect:** The stated structure gives 2, rather than 4.

Report a correction for Q16

Question 17 MCQ · 5.0 marks

Consider the following data flow graph and answer the subsequent questions.
Source diagram or notation
How many test requirements are there to satisfy All-Uses Coverage for variable
Source diagram or notation
?
6406536642190.
5
6406536642191.
4
6406536642192.
3
6406536642193.
2

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 MCQ · 5.0 marks

Consider the following data flow graph and answer the subsequent questions.
Source diagram or notation
How many test requirements are there to satisfy All DU-Paths Coverage for variable
Source diagram or notation
?
6406536642194.
5
6406536642195.
4
6406536642196.
3
6406536642197.
2

Published solution

**1. Enumerate distinct def-clear paths:** From definition 1, the paths are 1-2 (predicate use), 1-5 (predicate and print use), and 1-2-5 (print use). **2. Include the second definition:** Definition 4 has path 4-5 to print(x). There are four distinct graph-path sequences; 1-2-3-4-5 cannot carry the original x through its redefinition. **Answer: B — 4.** A: **Incorrect:** The stated structure gives 4, rather than 5. B: **Correct:** This equals the independently counted result 4. C: **Incorrect:** The stated structure gives 4, rather than 3. D: **Incorrect:** The stated structure gives 4, rather than 2.

Report a correction for Q18

Question 19 MCQ · 5.0 marks

Consider that concolic testing technique (DART) is used to test the following code segment.
Source diagram or notation
Assume that
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respresent the symbolic values for the variables
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respectively, in the method
Source diagram or notation
. Answer the subsequent questions.
Source diagram or notation
6406536642198.Source diagram or notation
6406536642199.Source diagram or notation
6406536642200.Source diagram or notation
6406536642201.Source diagram or notation

Published solution

**1. Symbolically execute assignments:** \(t_1=y_0^3\) and \(t_2=3x_0z_0\). **2. Conjoin the two taken branches:** Abort requires the outer \(x_0>z_0\) and inner \(t_1-t_2<0\), giving \[x_0>z_0\land(y_0^3-3x_0z_0<0).\] **Answer: C — \(x_0>z_0\land y_0^3-3x_0z_0<0\).** A: **Incorrect:** The nonstrict outer comparison includes inputs that do not enter the branch. B: **Incorrect:** A positive difference does not execute abort. C: **Correct:** Both strict branch conditions match the code. D: **Incorrect:** Both nonstrict comparisons admit equality cases not reaching abort.

Report a correction for Q19

Question 20 MCQ · 5.0 marks

Consider that concolic testing technique (DART) is used to test the following code segment.
Source diagram or notation
Assume that
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respresent the symbolic values for the variables
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respectively, in the method
Source diagram or notation
. Answer the subsequent questions.
Consider that DART generates a random input:
Source diagram or notation
. Which path constraint (PC) is generated for the next execution at
Source diagram or notation
? Hint: DART negates the path constraint in the current execution to get the path constraint for the next execution.
6406536642202.Source diagram or notation
6406536642203.Source diagram or notation
6406536642204.Source diagram or notation
6406536642205.Source diagram or notation

Published solution

**1. Evaluate the initial run:** At (5,2,3), x>z and \(2^3-3(5)(3)=8-45=-37<0\), so abort occurs. **2. Flip the target inner branch:** Keep \(x_0>z_0\), but negate the strict inner test to \(\ge0\). Thus the next constraint is \[x_0>z_0\land(y_0^3-3x_0z_0\ge0).\] **Answer: B — \(x_0>z_0\land y_0^3-3x_0z_0\ge0\).** A: **Incorrect:** It reverses the preceding outer branch instead of the target inner branch. B: **Correct:** It preserves the prefix and includes equality in the negated inner test. C: **Incorrect:** It does not correctly flip the inner branch and changes the outer condition. D: **Incorrect:** Negating <0 gives ≥0, not >0.

Report a correction for Q20

Question 21 MCQ · 5.0 marks

Consider that concolic testing technique (DART) is used to test the following code segment.
Source diagram or notation
Assume that
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respresent the symbolic values for the variables
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
respectively, in the method
Source diagram or notation
. Answer the subsequent questions.
Which of the following sets of concrete test inputs execute all instances of symbolic execution for the method
Source diagram or notation
?
6406536642206.
{x = 5, y = 2, z = 3}, {x = 4, y = 8, z = 2}
6406536642207.
{x = 5, y = 2, z = 3}, {x = 4, y = 8, z = 2}, {x = 5, y = 8, z = 10}
6406536642208.
{x = 5, y = 3, z = 5}, {x = 4, y = 8, z = 2}, {x = 5, y = 8, z = 10}
6406536642209.
{x = 5, y = 2, z = 3}, {x = 4, y = 8, z = 2}, {x = 5, y = 8, z = 4}

Published solution

**1. Identify three path classes:** Outer false; outer true with inner true (abort); outer true with inner false. **2. Evaluate B’s triples:** (5,2,3) aborts because 8−45<0; (4,8,2) enters the outer branch without abort because 512−24>0; (5,8,10) skips the outer branch. **3. Compare candidates:** B includes a representative of every class. **Answer: B — {(5,2,3),(4,8,2),(5,8,10)}.** A: **Incorrect:** It omits the outer-false class. B: **Correct:** All three feasible execution classes are represented. C: **Incorrect:** The first triple has x=z and does not abort, so the abort class is missing. D: **Incorrect:** All three inputs enter the outer branch, so its false outcome is missing.

Report a correction for Q21