MauryaHub PYQ Practice

Software Testing · Quiz 1 · Jan 2026

Software Testing · Quiz 1 · 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

In an organization, software quality is regarded as an important aspect. Therefore, test engineers carefully measure and improve software quality. Identify the minimum process maturity level of this organization.
6406536378894.
Level 1
6406536378895.
Level 2
6406536378896.
Level 3
6406536378897.
Level 4

Published solution

**1. Identify the distinction:** Quantitative measurement and control of software quality characterize maturity level 4, the quantitatively managed level. **Answer: D — Level 4.** A: **Incorrect:** Level 1 is ad hoc and unpredictable. B: **Incorrect:** Level 2 establishes repeatable or managed project practices. C: **Incorrect:** Level 3 establishes defined organization-wide processes. D: **Correct:** Level 4 adds quantitative quality and process measurement.

Report a correction for Q2

Question 3 MCQ · 5.0 marks

Consider the following statements regarding software design and choose the correct option. i) A module encapsulates functionality and interacts with other modules through well-defined interfaces. ii) Interfaces define the permitted interactions between modules without exposing internal implementation details.
6406536378898.
Statement i) is correct and Statement ii) is incorrect.
6406536378899.
Statement ii) is correct and Statement i) is incorrect.
6406536378900.
Both statements are incorrect.
6406536378901.
Both statements are correct.

Published solution

**1. Identify the distinction:** Modules encapsulate functionality, while interfaces specify allowed interactions without requiring clients to know the implementation. Both statements express modular design. **Answer: D — Both statements are correct..** A: **Incorrect:** The interface statement is also correct. B: **Incorrect:** The module statement is also correct. C: **Incorrect:** Both statements correctly describe modules and interfaces. D: **Correct:** Both encapsulation and interface separation are valid.

Report a correction for Q3

Question 4 MCQ · 5.0 marks

Which of the following options best describes the difference between test requirements and test cases?
6406536378902.
Test requirements define specific input values, while test cases define test objectives.
6406536378903.
Test requirements represent the required coverage criteria, whereas test cases define an execution to satisfy one or more of those requirements.
6406536378904.
Test requirements are created after executing test cases to measure test effectiveness.
6406536378905.
Test cases and test requirements are interchangeable terms used at different stages of the testing process.

Published solution

**1. Identify the distinction:** A test requirement states a coverage obligation or objective. A test case supplies a concrete execution, including inputs and expected results, to satisfy one or more obligations. **Answer: B — Test requirements represent the required coverage criteria, whereas test .** A: **Incorrect:** This swaps objectives and concrete input values. B: **Correct:** Coverage obligations are implemented by concrete test executions. C: **Incorrect:** Coverage objectives are established before selecting or assessing tests. D: **Incorrect:** The terms refer to different levels of abstraction.

Report a correction for Q4

Question 5 MCQ · 5.0 marks

Consider the following statements regarding test automation with JUnit and choose the correct option. i) JUnit does not support test fixtures. ii) In a test class, each test method checks an assertion and reports to the test runner whether the test failed or succeeded.
6406536378906.
Statement i) is correct and Statement ii) is incorrect.
6406536378907.
Statement ii) is correct and Statement i) is incorrect.
6406536378908.
Both statements are incorrect.
6406536378909.
Both statements are correct.

Published solution

**1. Identify the distinction:** JUnit supports fixtures for setup and cleanup. Test methods can use assertions, and failures are reported through the runner. Thus statement (i) is false and (ii) is true in the described testing style. **Answer: B — Statement ii) is correct and Statement i) is incorrect..** A: **Incorrect:** JUnit does support fixtures. B: **Correct:** Fixtures exist, and assertions let tests report failures. C: **Incorrect:** The assertion-and-runner statement is correct. D: **Incorrect:** The claim that fixtures are unsupported is false.

Report a correction for Q5

Question 6 MCQ · 5.0 marks

In the ____________ approach for integration testing, all individually tested modules are put together to construct the entire system which is tested as a whole. Fill in the blank with correct option.
6406536378910.
Top-down
6406536378911.
Bottom-up
6406536378912.
Big bang
6406536378913.
Sandwich

Published solution

**1. Identify the distinction:** Big-bang integration combines all individually tested modules in one step and tests the assembled system. **Answer: C — Big bang.** A: **Incorrect:** Top-down incrementally integrates from higher-level modules. B: **Incorrect:** Bottom-up incrementally integrates lower-level modules first. C: **Correct:** All modules are integrated at once. D: **Incorrect:** Sandwich combines top-down and bottom-up integration.

Report a correction for Q6

Question 7 MCQ · 5.0 marks

Consider an email client application that sends a request to a mail server, the mail server then responds with new email messages for a user. Which type of interface does this scenario represent?
6406536378914.
External file interface
6406536378915.
Message passing interface
6406536378916.
Procedure call interface
6406536378917.
Shared memory interface

Published solution

**1. Identify the distinction:** The email client and mail server exchange request and response messages rather than sharing a memory region or invoking a local procedure directly. **Answer: B — Message passing interface.** A: **Incorrect:** The interaction is not exchange through a shared external file. B: **Correct:** Network requests and responses are messages. C: **Incorrect:** The description is a message exchange, not a direct local procedure call. D: **Incorrect:** The client and server do not share the described memory area.

Report a correction for Q7

Question 8 MCQ · 5.0 marks

Consider the following statements regarding structural graph coverage criteria, and choose the correct option. i) Prime paths are maximal simple paths. ii) Edge-pair coverage does not require self-loops to be visited. iii) Test paths to achieve node and edge coverage can be obtained by simple modifications to BFS algorithm over graphs.
6406536378918.
Statement i) and iii) are correct. Statement ii) is incorrect.
6406536378919.
Statement i) is correct. Statement ii) and iii) are incorrect.
6406536378920.
Statement ii) and iii) are correct. Statement i) is incorrect.
6406536378921.
Statement i) and ii) are correct. Statement iii) is incorrect.

Published solution

**1. Identify the distinction:** A prime path is a simple path that is not a proper subpath of any longer simple path. Edge-pair coverage includes consecutive edges involving self-loops. Graph traversal algorithms can be adapted to construct node- and edge-covering test paths. **Answer: A — Statement i) and iii) are correct. Statement ii) is incorrect..** A: **Correct:** The maximal-simple-path and graph-traversal statements are true; excluding self-loops is false. B: **Incorrect:** The graph-traversal statement is also true. C: **Incorrect:** The self-loop statement is false and the prime-path statement is true. D: **Incorrect:** The self-loop statement is false and the traversal statement is true.

Report a correction for Q8

Question 9 MCQ · 5.0 marks

Which of the following types of testing is done by end customer to ensure that the delivered products meets the committed requirements?
6406536378922.
Unit Testing
6406536378923.
Integration Testing
6406536378924.
Acceptance Testing
6406536378925.
System Testing

Published solution

**1. Identify the distinction:** Acceptance testing checks that the delivered product satisfies the customer’s agreed requirements, typically with customer participation. **Answer: C — Acceptance Testing.** A: **Incorrect:** Unit testing isolates code units. B: **Incorrect:** Integration testing checks interactions between components. C: **Correct:** The customer checks the committed product requirements. D: **Incorrect:** System testing is broader whole-system verification but does not specifically mean customer acceptance.

Report a correction for Q9

Question 10 MCQ · 5.0 marks

The ___________ in a control flow graph (CFG) represents the minimum number of paths required for basis path testing. Fill in the blank with the appropriate option.
6406536378926.
number of prime paths
6406536378927.
number of linearly independent paths
6406536378928.
number of DD-paths
6406536378929.
number of edges

Published solution

**1. Identify the distinction:** Basis-path testing chooses a set of linearly independent control-flow paths. The number needed is the graph’s cyclomatic complexity. **Answer: B — number of linearly independent paths.** A: **Incorrect:** Prime paths serve a different, potentially larger coverage criterion. B: **Correct:** A basis consists of linearly independent paths. C: **Incorrect:** DD-paths are decision-to-decision chains, not a path-basis count. D: **Incorrect:** The number of edges alone does not determine the required basis size.

Report a correction for Q10

Question 11 MCQ · 5.0 marks

Which of the following graph coverage criteria is equivalent to transition coverage on a finite state machine (FSM)?
6406536378930.
Node coverage
6406536378931.
Edge coverage
6406536378932.
Edge-pair coverage
6406536378933.
Prime path coverage

Published solution

**1. Identify the distinction:** FSM transitions are graph edges. Visiting every transition is therefore edge coverage. **Answer: B — Edge coverage.** A: **Incorrect:** Node coverage checks states rather than every transition. B: **Correct:** Each transition corresponds to an edge. C: **Incorrect:** Edge-pair coverage additionally checks adjacent transition pairs. D: **Incorrect:** Prime-path coverage additionally checks maximal simple transition sequences.

Report a correction for Q11

Question 12 MCQ · 5.0 marks

Edge coverage on a CFG is equivalent to which of the following classical coverage criteria?
6406536378934.
Loop coverage
6406536378935.
Branch coverage
6406536378936.
Decision coverage
6406536378937.
Statement coverage

Published solution

**1. Identify the distinction:** Every outgoing control-flow edge must be traversed, including alternative branch outcomes. In the conventional CFG interpretation, this is branch coverage. **Answer: B — Branch coverage.** A: **Incorrect:** Loop coverage imposes loop-iteration requirements. B: **Correct:** Branch coverage checks each outgoing branch edge. C: **Incorrect:** Decision coverage often coincides for simple binary decisions, but branch coverage is the direct graph-edge correspondence. D: **Incorrect:** Statement coverage corresponds to visiting program statements or nodes.

Report a correction for Q12

Question 13 MSQ · 5.0 marks

Which of the following options represent a valid condition for a DD-path in a control flow graph (CFG)?
6406536378938.
It consists of a single vertex with in-degree
Source diagram or notation
(initial vertex).
6406536378939.
It consists of a single vertex with in-degree
Source diagram or notation
or out-degree
Source diagram or notation
.
6406536378940.
It consists of a single vertex with in-degree and out-degree as 1.
6406536378941.
It is a maximal chain of length
Source diagram or notation
.

Published solution

**1. Use the course’s complete DD-path definitions:** An initial node with in-degree zero forms a singleton DD-path. A singleton having both degrees one is also one listed DD-path case. **2. Compare the threshold wording:** Branch/merge singleton definitions use degree≥2 rather than degree≥3, and the maximal-chain case includes length≥1 rather than the narrower ≥2 threshold in D. **Answer: A, C — Initial singleton and the listed degree-one singleton case.** **Convention note:** This follows the intended exact-definition reading. If B and D are read merely as sufficient special cases rather than complete definitions, their narrower thresholds can also describe valid DD-paths; the question’s wording is therefore imprecise. A: **Correct:** A graph entry node forms a singleton DD-path. B: **Incorrect:** The standard threshold is ≥2; using ≥3 misses binary branches and merges. C: **Correct:** This is a listed singleton case in the DD-path convention. D: **Incorrect:** The standard chain definition also allows length 1; this is not the complete condition.

Report a correction for Q13

Question 14 MSQ · 5.0 marks

Prime path coverage subsumes which of the following coverage criteria for control and data flow graphs?
6406536378942.
Edge-pair coverage
6406536378943.
All Uses Coverage
6406536378944.
Edge coverage
6406536378945.
Complete path coverage

Published solution

**1. Compare contained subpaths:** Prime paths contain the simple node, edge and definition-clear use-path obligations under the standard direct-touring definitions, so PPC subsumes edge coverage and all-uses coverage. **2. Check the exceptions:** Edge-pair coverage can require repeated self-loop sequences that are not simple paths. Complete path coverage additionally requires arbitrarily many loop repetitions, so it is stronger than PPC. **Answer: B, C — All-uses coverage and edge coverage.** **Convention note:** Subsumption is evaluated on the graph-level criteria with feasible obligations and direct touring; allowing arbitrary sidetrips can weaken data-flow guarantees. A: **Incorrect:** Not universally: repeated self-edge pairs need not be contained in simple prime paths. B: **Correct:** Definition-clear simple paths are toured within the prime-path obligations under the stated standard touring convention. C: **Correct:** Every edge is contained in a prime path. D: **Incorrect:** PPC does not demand every possible full execution path with arbitrary repetitions.

Report a correction for Q14

Question 15 MSQ · 5.0 marks

Consider the following Java code for
Source diagram or notation
class, there are some faults in the implementation. The method
Source diagram or notation
needs to be tested using the JUnit test class
Source diagram or notation
.
Source diagram or notation
Identify which of the test cases would be able to uncover the faults in the program.
6406536378946.Source diagram or notation
6406536378947.Source diagram or notation
6406536378948.Source diagram or notation
6406536378949.Source diagram or notation

Published solution

**1. Identify the two code faults:** The loop stops before the final element, and the test values[i]%2==1 checks positive odd numbers rather than even numbers. **2. Evaluate the tests:** Tests 1 and 2 return true upon seeing an earlier positive odd number, coincidentally matching their assertions. Test 3 wrongly returns true for an all-odd array, while Test 4 returns false without entering the loop for the single even element. **3. Select failing assertions:** testCase3() and testCase4() uncover faults. **Answer: C, D — testCase3() and testCase4().** A: **Incorrect:** An earlier positive odd number returns true, so this assertion passes despite the defective algorithm. B: **Incorrect:** After skipping the first even value, the following odd value returns true, so the assertion passes. C: **Correct:** The all-odd array incorrectly returns true, violating assertFalse. D: **Correct:** A one-element array is never inspected and returns false, violating assertTrue.

Report a correction for Q15

Question 16 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?
6406536378950.
9
6406536378951.
10
6406536378952.
11
6406536378953.
8

Published solution

**1. Enumerate adjacent edges:** 1-2-3, 1-2-4, 2-3-5, 2-4-5, 3-5-2, 3-5-6, 4-5-2, 4-5-6, 5-2-3, 5-2-4. **2. Count at intermediate nodes:** Nodes 2,3,4,5 contribute \(2\cdot2+1+1+2\cdot2=10\) pairs. **Answer: B — 10.** A: **Incorrect:** The enumeration contains ten rather than nine pairs. B: **Correct:** All ten listed length-two graph paths are required. C: **Incorrect:** No eleventh adjacent pair exists in the edge set. D: **Incorrect:** This misses two adjacent edge combinations.

Report a correction for Q16

Question 17 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 prime path coverage?
6406536378954.
11
6406536378955.
12
6406536378956.
10
6406536378957.
13

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 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 the given CFG?
6406536378958.
3
6406536378959.
4
6406536378960.
5
6406536378961.
6

Published solution

**1. Count elements:** The graph has \(N=6\) vertices and \(E=7\) edges. **2. Calculate cyclomatic complexity:** \(V(G)=7-6+2=3\). Equivalently, there are two binary branching nodes plus one base path. **Answer: A — 3.** A: **Correct:** The connected CFG has complexity 3. B: **Incorrect:** Four exceeds E−N+2 for this graph. C: **Incorrect:** Five exceeds E−N+2 for this graph. D: **Incorrect:** Six is the node count, not complexity.

Report a correction for Q18

Question 19 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 for All-Defs-Coverage for variable
Source diagram or notation
?
6406536378962.
1
6406536378963.
2
6406536378964.
3
6406536378965.
4

Published solution

**1. Locate x definitions:** x=a defines x at node 1; x=z redefines it at node 4. **2. Require a reached use for each definition:** Both definitions have reachable uses, so all-defs requires one def-clear path from each: two requirements. **Answer: B — 2.** A: **Incorrect:** There are two definitions of x. B: **Correct:** Each of the two definitions requires a reached use. C: **Incorrect:** The graph has only two x definitions. D: **Incorrect:** Uses are not additional definitions.

Report a correction for Q19

Question 20 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 for All-Uses-Coverage for variable
Source diagram or notation
?
6406536378966.
3
6406536378967.
4
6406536378968.
5
6406536378969.
6

Published solution

**1. Locate predicate and computation uses:** Definition 1 reaches the x predicate uses on edges (2,3) and (2,5), the RHS x in y=x at node 4, and print(x) at node 6 on paths avoiding the redefinition. These are four pairs. **2. Count the second definition separately:** The x=z definition at node 4 reaches print(x) at node 6, adding one pair. **3. Sum:** \(4+1=5\) all-uses requirements. **Answer: C — 5.** A: **Incorrect:** This omits reachable predicate or computation uses. B: **Incorrect:** Four omits the definition-4-to-use-6 pair. C: **Correct:** There are five distinct reachable definition-use pairs. D: **Incorrect:** Six counts alternate paths to one pair separately rather than pairs.

Report a correction for Q20

Question 21 MCQ · 5.0 marks

Consider the following data flow graph, and answer the subsequent questions.
Source diagram or notation
How many unique du-paths are there for variable
Source diagram or notation
? Note: Do not consider subsumption for the du-paths.
6406536378970.
3
6406536378971.
4
6406536378972.
5
6406536378973.
6

Published solution

**1. Enumerate paths from definition 1:** To the predicate-use edges: 1-2-3 and 1-2-5. To the RHS use at node 4: 1-2-3-4. To print(x) without redefinition: 1-6 and 1-2-5-6. **2. Add the path from definition 4:** The path to print(x) is 4-5-6. Paths from definition 1 through the new x definition at node 4 cannot carry the old definition to node 6. **3. Count without removing prefix paths:** These are six distinct def-clear du-paths. **Answer: D — 6.** A: **Incorrect:** This omits multiple predicate or computation-use paths. B: **Incorrect:** All six explicit paths are requested without subsumption. C: **Incorrect:** Five counts definition-use pairs rather than every distinct path. D: **Correct:** The five definition-1 paths and one definition-4 path give six.

Report a correction for Q21