MauryaHub PYQ Practice

Software Testing · Quiz 1 · Jan 2025

Software Testing · Quiz 1 · Jan 2025

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

18 / 19 published solutions

Question 17 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q17

Question 19 MCQ · 5.0 marks

Consider the following statements and select the correct option. i) The interior vertices in a chain can have in-degree and/or out-degree greater than 1. ii) A maximal chain is a chain that is not a part of any other chain.
6406533822296.
Statement (i) is true but statement (ii) is false
6406533822297.
Statement (i) is false but statement (ii) is true
6406533822298.
Both statements are true
6406533822299.
Both statements are false

Published solution

**1. Identify the concept:** Every interior vertex of a chain has in-degree and out-degree one. A maximal chain cannot be extended into a larger chain. Thus i is false and ii is true. **Answer: B — Statement (i) is false but statement (ii) is true.** A: **Incorrect:** This reverses the two truth values. B: **Correct:** Interior degrees are one and maximality prevents extension. C: **Incorrect:** The first statement is false. D: **Incorrect:** The second statement is true.

Report a correction for Q19

Question 20 MCQ · 5.0 marks

Source diagram or notation
6406533822300.
(i) - 1, (ii) - 2, (iii) - 3
6406533822301.
(i) - 2, (ii) - 3, (iii) - 1
6406533822302.
(i) - 1, (ii) - 3, (iii) - 2
6406533822303.
(i) - 3, (ii) - 2, (iii) - 1

Published solution

**1. Identify the concept:** A fault is a static defect; an error is the resulting incorrect internal state; a failure is externally visible incorrect behaviour. The mapping is fault→2, error→3, failure→1. **Answer: B — Fault→2, Error→3, Failure→1.** A: **Incorrect:** This swaps fault and failure meanings. B: **Correct:** All three definitions are correctly matched. C: **Incorrect:** A fault is a static defect, not an external failure. D: **Incorrect:** This swaps the static defect and internal state.

Report a correction for Q20

Question 21 MCQ · 5.0 marks

Edge coverage on graphs is equivalent to which of the following coverage criteria on finite state machines (FSM)?
6406533822304.
State coverage
6406533822305.
Transition coverage
6406533822306.
Transition-pair coverage
6406533822307.
None of these

Published solution

**1. Identify the concept:** An FSM transition is an edge between states. Covering every graph edge therefore means covering every transition. **Answer: B — Transition coverage.** A: **Incorrect:** State coverage corresponds to node coverage. B: **Correct:** Transitions are graph edges. C: **Incorrect:** Transition-pair coverage corresponds to consecutive pairs of edges. D: **Incorrect:** Transition coverage is the direct equivalent.

Report a correction for Q21

Question 22 MCQ · 5.0 marks

Source diagram or notation
6406533822308.
3
6406533822309.
4
6406533822310.
5
6406533822311.
6

Published solution

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

Report a correction for Q22

Question 23 MCQ · 5.0 marks

Suppose an organization that is developing an automated hydroponic system. The main objective of testing in the organization is to show the presence of failures. Testers and developers cooperate to reduce the risks associated with using the system, which can have different levels of consequences. Choose the minimum process maturity level of the organization, considering its testing goals.
6406533822312.
Level 1
6406533822313.
Level 2
6406533822314.
Level 3
6406533822315.
Level 4

Published solution

**1. Identify the concept:** Detecting failures alone corresponds to Level 2, but cooperative reduction of software-usage risk raises the minimum to Level 3 in the testing-maturity model. **Answer: C — Level 3.** A: **Incorrect:** Demonstrating correct operation alone is a lower goal. B: **Incorrect:** The cooperative risk-reduction objective exceeds Level 2. C: **Correct:** Risk reduction with tester–developer cooperation defines Level 3. D: **Incorrect:** The scenario does not require Level 4’s broader quality discipline.

Report a correction for Q23

Question 24 MSQ · 5.0 marks

Which of the following integration testing techniques require the use of test drivers?
6406533822316.
Big bang
6406533822317.
Top-down
6406533822318.
Sandwich
6406533822319.
Bottom-up

Published solution

**1. Identify the concept:** Bottom-up integration tests lower-level clusters before their real callers exist, requiring drivers. Sandwich integration includes a bottom-up portion, so it also uses drivers. **Answer: C, D — Sandwich; Bottom-up.** A: **Incorrect:** The actual components are combined together rather than replaced by missing callers. B: **Incorrect:** Top-down integration generally uses stubs for missing callees. C: **Correct:** Its bottom-up portion needs caller replacements. D: **Correct:** Drivers invoke the lower-level components under test.

Report a correction for Q24

Question 25 MSQ · 5.0 marks

Source diagram or notation
6406533822320.
[1, 2, 5, 3]
6406533822321.
[1, 2, 5, 6]
6406533822322.
[1, 4, 5, 3, 6]
6406533822323.
[1, 2, 4, 5, 3, 6]

Published solution

**1. Check test-path endpoints:** A complete test path must start at initial node 1, end at final node 6, and follow every listed edge. **2. Check each candidate:** [1,2,5,6] and [1,4,5,3,6] follow valid edges. The first candidate stops prematurely at 3, and the last requires nonexistent edge 2→4. **Answer: B, C — [1,2,5,6] and [1,4,5,3,6].** A: **Incorrect:** It ends at nonfinal node 3. B: **Correct:** It follows 1→2→5→6 and reaches the final node. C: **Correct:** Every edge exists and the path reaches node 6. D: **Incorrect:** There is no edge 2→4.

Report a correction for Q25

Question 26 MSQ · 5.0 marks

Which of the following types of testing may require knowledge of the internal structure and the source code under test?
6406533822324.
Unit testing
6406533822325.
Performance testing
6406533822326.
Acceptance testing
6406533822327.
Integration and system testing

Published solution

**1. Match the testing basis:** Unit tests and integration/system tests can derive cases from internal code, branches and interactions. The course classifies these as testing scopes that may use structural knowledge. **Answer: A, D — Unit testing; integration and system testing.** **Convention note:** Testing scope and white-box technique are independent. Profiling-based performance tests can also inspect internals in practice; A and D are the course’s intended classification. A: **Correct:** Unit tests can inspect internal logic. B: **Incorrect:** Performance tests primarily measure timing, throughput and resource use. C: **Incorrect:** Acceptance tests primarily check external user requirements. D: **Correct:** These scopes can use structural and source-code knowledge.

Report a correction for Q26

Question 27 MSQ · 6.0 marks

Source diagram or notation
6406533822328.
testCase1()
6406533822329.
testCase2()
6406533822330.
testCase3()
6406533822331.
testCase4()

Published solution

**1. Identify the faults:** allPrimes checks indices length−1 down to 1, skipping index 0. It also accepts numbers less than 2 because their divisor loop is empty. **2. Trace the tests:** Test 3 skips the initial composite 6 and accepts the checked −4, returning true. Test 4 skips its only composite 6 and returns true. Both assertFalse calls fail; tests 1 and 2 return the expected results. **Answer: C, D — testCase3() and testCase4().** A: **Incorrect:** All checked entries are prime, so assertTrue passes. B: **Incorrect:** The last element 12 is composite and returns false as expected. C: **Correct:** The skipped 6 and unchecked negative-number case cause an incorrect true return. D: **Correct:** Its only composite is skipped at index 0.

Report a correction for Q27

Question 28 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
What is the number of states in the **FSM**?
6406533822332.
4
6406533822333.
5
6406533822334.
6
6406533822335.
8

Published solution

**1. Identify the concept:** The queue state is its occupancy. A capacity-three FIFO queue has occupancies 0,1,2,3, so there are four abstract states. **Answer: A — 4.** A: **Correct:** The four occupancies define the states. B: **Incorrect:** There is no separate fifth occupancy state. C: **Incorrect:** Errors do not add two stored queue occupancies. D: **Incorrect:** FIFO packing does not permit eight independent occupied/empty slot patterns.

Report a correction for Q28

Question 29 MSQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Identify the statement(s) that is/are true about the **FSM**?
6406533822336.Source diagram or notation
6406533822337.Source diagram or notation
6406533822338.Source diagram or notation
6406533822339.Source diagram or notation

Published solution

**1. Distinguish queries and transitions:** isEmpty only reads occupancy. enqueue adds an element when !isFull, while dequeue removes an element when !isEmpty. **2. Apply the occupancy model:** Adding to an empty queue changes zero occupied positions to one; adding to a two-element queue fills it. **Answer: A, D — isEmpty leaves state unchanged; enqueue takes empty to one element.** A: **Correct:** isEmpty is a query and does not mutate the queue. B: **Incorrect:** The enqueue guard is !isFull, not !isEmpty. C: **Incorrect:** dequeue reduces occupancy rather than changing two elements to three. D: **Correct:** enqueue adds the first element to an empty queue.

Report a correction for Q29

Question 30 NAT · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Source diagram or notation

Published solution

**1. Locate x’s definition:** x=a at node 1 is the only definition of x. **2. Count reachable uses:** x is read on predicate edges (1,2), (1,3), (1,4), in z=x at node 3, and in print(x) at node 4. Each is reached without redefining x, giving five DU-pairs. **Answer: 5.**

Report a correction for Q30

Question 31 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Source diagram or notation
6406533822341.
[1, 4]
6406533822342.
[2, 3, 4]
6406533822343.
[1, 2, 3, 4]
6406533822344.
[1, 3, 4]

Published solution

**1. Track y’s definitions:** y=b at node 1, while y=z at node 2 overwrites it. **2. Inspect the candidate:** [1,2,3,4] has an interior redefinition at node 2, so it is not a definition-clear DU-path carrying node 1’s y to print(y). **Answer: C — [1,2,3,4].** A: **Incorrect:** Node 1’s y reaches its predicate and print uses without redefinition. B: **Incorrect:** It starts at the new definition at node 2 and reaches print(y). C: **Correct:** Its interior node 2 kills the starting definition of y. D: **Incorrect:** Node 3 redefines z, not y.

Report a correction for Q31

Question 32 NAT · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Source diagram or notation

Published solution

**1. Locate reads of z:** Node 2 reads z in y=z. Node 4 reads z in print(z). **2. Exclude definitions:** z=c at node 1 and z=x at node 3 write z rather than read it. Hence z has two uses. **Answer: 2.**

Report a correction for Q32

Question 33 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Source diagram or notation
6406533822346.
{[1, 3, 4]}
6406533822347.
{[2, 2, 3, 4]}
6406533822348.
{[1, 3, 4], [1, 2, 3, 4]}
6406533822349.
{[1, 4], [1, 3, 4], [1, 2, 3, 4]}

Published solution

**1. Find DU-path obligations for z:** Definition 1 reaches print(z) directly on [1,4], and reaches the read at node 2 on [1,2]. Definition 3 reaches print(z) on [3,4]. **2. Embed them in complete tests:** The offered set {[1,4],[1,3,4],[1,2,3,4]} covers all three obligations; none of the smaller offered sets includes the direct [1,4] obligation. **Answer: D — {[1,4],[1,3,4],[1,2,3,4]}.** **Convention note:** Two tests, [1,4] and [1,2,3,4], would already suffice; D is the only sufficient set among the offered options. A: **Incorrect:** It omits definition 1’s direct print use and its use at node 2. B: **Incorrect:** It does not start at initial node 1 and requires a nonexistent self-loop. C: **Incorrect:** It omits the DU-path [1,4]. D: **Correct:** It contains complete tests covering every z DU-path.

Report a correction for Q33

Question 34 MSQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
We have computed some of the prime paths, which are as follows: 1. [1, 2, 4, 6], 2. [1, 3, 4, 6], 3. [1, 3, 5], 4. [5, 3, 5], Identify the missing prime path(s).
6406533822350.
[3, 5, 3]
6406533822351.
[1, 3, 5, 3, 4]
6406533822352.
[5, 3, 4, 6]
6406533822353.
[1, 3, 5, 3, 4, 6]

Published solution

**1. Check the cycle:** [3,5,3] is a simple cycle and a distinct rotation from the already listed [5,3,5]. **2. Check the exit path:** [5,3,4,6] is a maximal simple path. The other candidates repeat node 3 internally and cannot be prime paths. **Answer: A, C — [3,5,3] and [5,3,4,6].** A: **Correct:** This is the missing cycle rotation. B: **Incorrect:** Node 3 repeats internally, so the path is not simple. C: **Correct:** It is simple and cannot be extended while staying simple. D: **Incorrect:** Node 3 repeats internally, so the path is not simple.

Report a correction for Q34

Question 35 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Identify the minimum number of test paths required to satisfy node coverage and edge coverage.
6406533822354.
1 for node coverage and 2 for edge coverage.
6406533822355.
2 for both node coverage and edge coverage.
6406533822356.
2 for node coverage and 3 for edge coverage.
6406533822357.
3 for both node coverage and edge coverage.

Published solution

**1. Establish the lower bound:** A test choosing 1→2 reaches 4→6 and cannot also visit node 3 or 5. At least two tests are needed even for node coverage. **2. Construct two sufficient tests:** [1,2,4,6] and [1,3,5,3,4,6] together cover all six nodes and all seven edges. Both minima are two. **Answer: B — 2 for both node and edge coverage.** A: **Incorrect:** One test cannot visit both mutually exclusive initial branches. B: **Correct:** Two tests are necessary and sufficient for both criteria. C: **Incorrect:** The displayed two-path construction already covers all edges. D: **Incorrect:** Three are unnecessary.

Report a correction for Q35

Question 36 MCQ · 6.0 marks

Source diagram or notation
Based on the above data, answer the given subquestions.
Consider the following set of test paths. {[1, 2, 4, 6], [1, 3, 5, 3, 4, 6]}. Identify the correct statement from the following options.
6406533822358.
It satisfies node coverage, but not edge coverage.
6406533822359.
It satisfies node coverage and edge coverage, but not edge-pair coverage.
6406533822360.
It satisfies node edge-pair coverage, but not prime path coverage.
6406533822361.
It satisfies prime path coverage.       **AI** **Section Id :** 64065379950 **Section Number :** 3 **Section type :** Online **Mandatory or Optional :** Mandatory **Number of Questions :** 8 **Number of Questions to be attempted :** 8 **Section Marks :** 25 **Display Number Panel :** Yes **Section Negative Marks :** 0 **Group All Questions :** No **Enable Mark as Answered Mark for Review and** No **Clear Response :** **Section Maximum Duration :** 0 **Section Minimum Duration :** 0 **Section Time In :** Minutes **Maximum Instruction Time :** 0

Published solution

**1. Check nodes and edges:** The two tests together visit every node and traverse all seven edges. **2. Find missing edge pairs:** Neither test contains [1,3,4] or [3,5,3]. Thus edge-pair coverage fails, and direct prime-path coverage also fails. **Answer: B — Node and edge coverage, without edge-pair coverage.** A: **Incorrect:** All edges are covered, not just nodes. B: **Correct:** All nodes and edges are covered, but required consecutive edge pairs are missing. C: **Incorrect:** The pairs [1,3,4] and [3,5,3] are absent. D: **Incorrect:** The prime paths [1,3,4,6] and [3,5,3] are not directly toured.

Report a correction for Q36