NivaarExam PrepOfficial exam papers ↗

19-Soft-A6 Software Quality Assurance · May 2015

Question 5 of 8

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

04-Soft-A6, Software Quality Assurance — National Exams, May 2015 (3 hours, open book, 8 questions of equal value; the first FIVE as they appear in the answer book are marked — all eight are solved here as a study resource).

Reference texts: Pressman, Software Engineering: A Practitioner's Approach, 9th ed. (SQA planning, review, testing strategies/techniques, cyclomatic complexity, basis path testing); Sommerville, Software Engineering, 10th ed. (software process, configuration management); ISO/IEC 25010 SQuaRE (software quality characteristics); ISO/IEC 12207 (life-cycle/configuration-management processes).

Question 5 (10 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Part (a) — white-box vs. black-box testing. White-box (structural/glass-box) testing derives test cases from knowledge of the program's internal structure — its control flow, logic, loops and conditions — with the goal of exercising every independent path, every logical decision on both its true/false branches, and every loop at its boundaries (basis path testing, Q8, is a white-box technique). Black-box (behavioural/functional) testing derives test cases purely from the specified functional requirements/interface, with no knowledge of internal implementation, focusing on inputs and expected outputs (equivalence partitioning, boundary value analysis — Q7 — are black-box techniques). White-box asks "is every internal path correct?"; black-box asks "does the observable behaviour match the specification?" — the two are complementary, not competing.

Part (b) — cyclomatic complexity. Cyclomatic complexity, V(G), is a software metric that provides a quantitative measure of the logical complexity of a program by counting the number of linearly independent paths through its control-flow graph; it also equals the number of test cases needed to achieve basis-path coverage (execute every statement at least once). Three ways to compute it:

  1. V(G) = E − N + 2, where E is the number of edges and N the number of nodes in the flow graph.
  2. V(G) = P + 1, where P is the number of predicate (decision) nodes in the flow graph.
  3. Count the number of enclosed (bounded) regions of the flow graph and add 1 — the number of regions corresponds directly to the complexity.

Part (c) — two black-box techniques.