MauryaHub PYQ Practice

Software Testing · Quiz 1 · Sep 2024

Software Testing · Quiz 1 · Sep 2024

← 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.

17 / 18 published solutions

Question 2 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
How many prime paths are present in the given CFG?
6406533355093.
6
6406533355094.
7
6406533355095.
8
6406533355096.
9

Published solution

**1. Enumerate prime paths:** [1,2,3,4], [1,2,6,7], [1,5,7], [2,3,4,2], [3,4,2,3], [3,4,2,6,7], [4,2,3,4], [5,5]. **2. Count:** Three cycle rotations, one self-loop, and four maximal noncyclic paths give eight requirements. **Answer: C — 8.** A: **Incorrect:** The derived count is 8, not 6. B: **Incorrect:** The derived count is 8, not 7. C: **Correct:** The derived count is 8, which matches this option. D: **Incorrect:** The derived count is 8, not 9.

Report a correction for Q2

Question 3 MSQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
From the following options, identify the set(s) of test paths that provide edge-pair coverage.
6406533355097.
{[1, 5, 7], [1, 2, 3, 4, 2, 3, 4, 2, 6, 7], [1, 5, 5, 5, 7]}
6406533355098.
{[1, 2, 6, 7], [1, 2, 3, 4, 2, 3, 4, 2, 6, 7], [1, 5, 5, 5, 7]}
6406533355099.
{[1, 2, 6, 7], [1, 5, 7], [1, 2, 3, 4, 2, 3, 4, 2, 6, 7], [1, 5, 5, 5, 7]}
6406533355100.
{[1, 2, 6, 7], [1, 5, 7], [1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 6, 7], [1, 5, 5, 5, 7]}

Published solution

**1. Check short-branch requirements:** Edge-pair coverage requires both [1,2,6] and [1,5,7]. A looping path cannot replace these consecutive edge pairs. **2. Check loop requirements:** The longer cycle tests cover [2,3,4], [3,4,2], [4,2,3], [4,2,6]; the self-loop test covers [1,5,5], [5,5,5], [5,5,7]. Both C and D cover all requirements. **Answer: C, D — Sets C and D.** A: **Incorrect:** It lacks consecutive pair [1,2,6]. B: **Incorrect:** It lacks consecutive pair [1,5,7]. C: **Correct:** It includes both nonloop branch pairs and all loop pairs. D: **Correct:** The extra loop iteration preserves complete edge-pair coverage.

Report a correction for Q3

Question 4 MCQ · 6.0 marks

Source diagram or notation
6406533355101.
3
6406533355102.
4
6406533355103.
5
6406533355104.
6

Published solution

**1. Count decisions:** Bubble sort contains two for-loop conditions and one if comparison: three decisions. **2. Add the base path:** \(V=3+1=4\). **Answer: B — 4.** A: **Incorrect:** The derived count is 4, not 3. B: **Correct:** The derived count is 4, which matches this option. C: **Incorrect:** The derived count is 4, not 5. D: **Incorrect:** The derived count is 4, not 6.

Report a correction for Q4

Question 5 MCQ · 6.0 marks

Consider a prime path [1, 2, 5, 6] and a test path P=[1, 2, 3, 4, 2, 3, 4, 5, 6]. Which of the following sub-paths is toured by P with a side-trip but not a detour?
6406533355105.
[3, 4, 2, 3]
6406533355106.
[3, 4, 5, 6]
6406533355107.
[1, 2, 3, 4]
6406533355108.
[2, 3, 4, 5]

Published solution

**1. Identify the closed excursion:** In P, the segment [3,4,2,3] leaves node 3 and returns to node 3. It is a closed side excursion, while the other listed segments do not return to their starting node. **2. Interpret the intended question:** A is the listed segment having the shape of a sidetrip, rather than an excursion returning at a different successor node. **Answer: A — [3,4,2,3].** **Convention note:** The wording is imprecise: the stated prime path [1,2,5,6] is not toured with sidetrips because P never traverses edge 2→5. Also, formal sidetrip touring implies the weaker node-order detour criterion. A is the intended closed-excursion answer, not proof of the literal “sidetrip but not detour” claim. A: **Correct:** It is a closed excursion returning to its start. B: **Incorrect:** It ends at 6 rather than returning to 3. C: **Incorrect:** It ends at 4 rather than returning to 1. D: **Incorrect:** It ends at 5 rather than returning to 2.

Report a correction for Q5

Question 6 MCQ · 6.0 marks

Source diagram or notation
6406533355109.
It accepts all strings that have odd number of 0s and odd number of 1s.
6406533355110.
It accepts all strings that have even number of 0s and even number of 1s.
6406533355111.
It accepts all strings that have odd number of 0s and even number of 1s.
6406533355112.
It accepts all strings that have even number of 0s and odd number of 1s.

Published solution

**1. Assign parity states:** State 1 is (even zeros, even ones); state 2 is (odd, even); state 4 is (even, odd); state 3 is (odd, odd). Reading 0 toggles zero parity, while reading 1 toggles one parity. **2. Identify acceptance:** Only state 1 is accepting, so both symbol counts must be even. **Answer: B — It accepts all strings that have even number of 0s and even number of 1s..** A: **Incorrect:** This ends in nonaccepting state 3. B: **Correct:** Both even counts return to accepting state 1. C: **Incorrect:** This ends in nonaccepting state 2. D: **Incorrect:** This ends in nonaccepting state 4.

Report a correction for Q6

Question 7 MCQ · 6.0 marks

At which process maturity level is the objective of testing to reduce the risk associated with software usage, wherein testers and developers collaborate to reduce risk?
6406533355118.
Level-0
6406533355119.
Level-1
6406533355120.
Level-2
6406533355121.
Level-3
6406533355122.
Level-4

Published solution

**1. Identify the concept:** Level 3 in the testing-maturity model focuses on reducing software-usage risk through cooperation between developers and testers. **Answer: D — Level-3.** A: **Incorrect:** Level 0 equates testing with debugging. B: **Incorrect:** Level 1 emphasizes demonstrating that the program works. C: **Incorrect:** Level 2 emphasizes showing failures. D: **Correct:** Level 3 introduces the stated cooperative risk-reduction objective. E: **Incorrect:** Level 4 is a broader quality discipline; Level 3 is the minimum here.

Report a correction for Q7

Question 8 MCQ · 6.0 marks

Source diagram or notation
6406533355127.
b > 100
6406533355128.
a - b < 0 && b > 100
6406533355129.
a - b < 0 && a*b > 100
6406533355130.
a - b < 0 && a*b <= 100

Published solution

**1. Enter the outer branch:** The initial values x=a and y=b require \(a-b<0\). **2. Substitute the assignment:** Inside that branch y becomes \(ab\). Reaching the error then requires \(ab>100\), so both conditions are needed. **Answer: C — \(a-b<0\land ab>100\).** A: **Incorrect:** It ignores the outer branch and the changed value of y. B: **Incorrect:** The inner condition uses updated y=ab, not original b. C: **Correct:** It combines the outer condition with the correct updated inner condition. D: **Incorrect:** This negates the required inner condition.

Report a correction for Q8

Question 9 MCQ · 5.0 marks

Consider using a memory block to interface between two modules, where the modules can read from or write to, while a third module can create the memory block. Identify the interface between the modules.
6406533355135.
Procedure call interface
6406533355136.
Shared memory interface
6406533355137.
Message-passing interface
6406533355138.
None of these

Published solution

**1. Identify the concept:** Both modules exchange information by reading and writing the same memory block. This is a shared-memory interface. **Answer: B — Shared memory interface.** A: **Incorrect:** The scenario does not describe invoking the other module’s procedure. B: **Correct:** The common readable/writable memory block is shared memory. C: **Incorrect:** No exchange of discrete messages is described. D: **Incorrect:** Shared memory directly matches the mechanism.

Report a correction for Q9

Question 10 MCQ · 5.0 marks

Which of the following integration testing approaches does not require **scaffolding**?
6406533355139.
Top-down
6406533355140.
Bottom-up
6406533355141.
Sandwich
6406533355142.
Big bang

Published solution

**1. Identify the concept:** Big-bang integration combines the available real components at once, avoiding the temporary drivers and stubs needed to replace missing components during incremental integration. **Answer: D — Big bang.** A: **Incorrect:** Missing lower-level components normally require stubs. B: **Incorrect:** Missing higher-level callers normally require drivers. C: **Incorrect:** It combines approaches that use drivers and stubs. D: **Correct:** Real components are integrated together rather than replaced by integration scaffolding.

Report a correction for Q10

Question 11 MCQ · 5.0 marks

Any single vertex with out-degree _____________, which is a decision vertex, is a DD-path. Fill in the blank with appropriate option.
6406533355143.
= 0
6406533355144.
< 2
6406533355145.
= 1
6406533355146.
≥ 2

Published solution

**1. Identify the concept:** A decision vertex has at least two outgoing alternatives. Such a branching singleton qualifies as a DD-path. **Answer: D — ≥ 2.** A: **Incorrect:** Out-degree zero identifies an exit, not a decision. B: **Incorrect:** Fewer than two outgoing edges do not form a branch. C: **Incorrect:** One outgoing edge provides no choice. D: **Correct:** At least two outgoing edges make it a decision vertex.

Report a correction for Q11

Question 12 MCQ · 5.0 marks

The inter-procedural DU pairs are defined by the ______(1)_____ of variables before calls to and returns from the called units and the______(2)______ inside modules and after calls. Fill in the blanks with the appropriate option.
6406533355147.
(1) first definitions, (2) first uses
6406533355148.
(1) first definitions, (2) last uses
6406533355149.
(1) last definitions, (2) first uses
6406533355150.
(1) last definitions, (2) last uses

Published solution

**1. Identify the concept:** A value crossing a call boundary comes from the last definition before the call or return and reaches its first relevant use in the receiving module or after the call. **Answer: C — (1) last definitions, (2) first uses.** A: **Incorrect:** An earlier definition may already have been overwritten. B: **Incorrect:** Neither the earliest definition nor the last use identifies the boundary transfer. C: **Correct:** Last definitions and first uses identify the inter-procedural transfer. D: **Incorrect:** The first use is the receiving boundary event, not the last use.

Report a correction for Q12

Question 13 MSQ · 5.0 marks

Which of the following can be white-box testing?
6406533355113.
Unit testing
6406533355114.
Integration testing
6406533355115.
System testing
6406533355116.
Acceptance testing
6406533355117.
Beta testing

Published solution

**1. Identify the concept:** White-box testing derives tests from internal code or structure. That approach can be used at unit, integration and system levels; acceptance and beta testing are normally driven by external requirements and user behaviour. **Answer: A, B, C — Unit testing; Integration testing; System testing.** A: **Correct:** Individual units can be tested using internal branches and paths. B: **Correct:** Interactions can be tested using internal call and data-flow structure. C: **Correct:** Whole-system tests can also target internal structure. D: **Incorrect:** Acceptance testing normally verifies externally specified user requirements. E: **Incorrect:** Beta testing normally relies on user operation rather than source-code analysis.

Report a correction for Q13

Question 14 MSQ · 5.0 marks

Source diagram or notation
6406533355131.
Only node coverage.
6406533355132.
Node coverage and edge coverage.
6406533355133.
Edge coverage but not edge-pair coverage.
6406533355134.
Edge-pair coverage.

Published solution

**1. Check edge coverage:** The paths [1,2,5,6] and [1,2,3,4,3,5,6] collectively traverse every edge and visit every node. **2. Identify missing pairs:** [2,3,5] and [4,3,4] are valid consecutive edge pairs but occur in neither test. Hence edge-pair coverage is not achieved. **Answer: B, C — Node and edge coverage; no edge-pair coverage.** A: **Incorrect:** Edge coverage is achieved as well. B: **Correct:** Both nodes and edges are covered. C: **Correct:** Every edge is covered but some consecutive pairs are missing. D: **Incorrect:** The valid pairs [2,3,5] and [4,3,4] are absent.

Report a correction for Q14

Question 15 MSQ · 5.0 marks

Source diagram or notation
6406533355163.Source diagram or notation
6406533355164.Source diagram or notation
6406533355165.Source diagram or notation
6406533355166.Source diagram or notation

Published solution

**1. Apply subsumption:** C2 subsumes C1, so satisfying the stronger criterion C2 implies C1. C3 subsumes C2 and therefore C1 by transitivity. **2. Apply to the test sets:** T2 and T3 necessarily satisfy the weaker C1 requirements represented by T1; the reverse implications are not guaranteed. **Answer: B, D — T2 satisfies C1; T3 satisfies C1.** **Convention note:** The question loosely says one test set “satisfies” another; the precise implication concerns the coverage criteria those sets satisfy. A: **Incorrect:** Satisfying weaker C1 does not imply stronger C2. B: **Correct:** C2 subsumes C1. C: **Incorrect:** Satisfying C2 does not imply stronger C3. D: **Correct:** C3 subsumes C2, which subsumes C1.

Report a correction for Q15

Question 16 MSQ · 6.0 marks

Source diagram or notation
6406533355123.
testCase1()
6406533355124.
testCase2()
6406533355125.
testCase3()
6406533355126.
testCase4()

Published solution

**1. Trace search:** The loop starts at index 1, so it skips the 20 at index 0. Searching for 20 returns −1, making test 3’s equality-to-zero assertion fail. **2. Check the absent key:** Searching for 100 returns the integer −1, boxed as a non-null Integer for assertNull. Thus test 4 fails. Searches for 10 and 50 return the expected indices 1 and 4. **Answer: C, D — testCase3() and testCase4().** A: **Incorrect:** The method finds 10 at index 1. B: **Incorrect:** The method finds 50 at index 4. C: **Correct:** The skipped index 0 makes search(20) return −1. D: **Correct:** The integer result −1 is not null.

Report a correction for Q16

Question 17 MSQ · 6.0 marks

Source diagram or notation
6406533355159.
{x = 10, y = 10, z = 10}
6406533355160.
{x = 20, y = 20, z = 30}
6406533355161.
{x = 20, y = 10, z = 30}
6406533355162.
{x = 30, y = 20, z = 30}

Published solution

**1. Read the path guards:** Taking a→b requires \(x\ge y\); taking b→e requires \(x<z\). Hence the path condition is \(y\le x<z\). **2. Evaluate inputs:** (20,20,30) and (20,10,30) satisfy both guards. (10,10,10) and (30,20,30) fail the strict x<z guard. **Answer: B, C — (20,20,30) and (20,10,30).** A: **Incorrect:** 10<10 is false. B: **Correct:** 20≥20 and 20<30 are both true. C: **Correct:** 20≥10 and 20<30 are both true. D: **Incorrect:** 30<30 is false.

Report a correction for Q17

Question 18 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
How many **du-pairs** are there for the variable x?
6406533355151.
2
6406533355152.
3
6406533355153.
4
6406533355154.
5

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 MCQ · 5.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
How many unique **du-paths** are there for the variable x?
6406533355155.
2
6406533355156.
3
6406533355157.
4
6406533355158.
5       **Deep Learning** **Section Id :** 64065369311 **Section Number :** 2 **Section type :** Online **Mandatory or Optional :** Mandatory

Published solution

**1. Enumerate definition-clear simple paths:** From node 1’s definition to the two predicate-use edges: [1,2,3] and [1,2,4]. From node 4’s definition to print(x): [4,5]. **2. Count:** There are three distinct DU-path sequences. Paths from node 1 through node 4 to node 5 are not definition-clear for x. **Answer: B — 3.** A: **Incorrect:** The derived count is 3, not 2. B: **Correct:** The derived count is 3, which matches this option. C: **Incorrect:** The derived count is 3, not 4. D: **Incorrect:** The derived count is 3, not 5.

Report a correction for Q19