optional · CSS study notes
Software Testing (2016-17)
CSS CS Optional — Paper-I, Section-B, Topic V.
🔥 Frequency: appeared in 4 of last 7 papers (2020, 2021, 2022, 2024, 2025).
🔑 Black-Box vs White-Box
| Black-Box | White-Box (glass-box) |
|---|---|
| Tests against spec | Tests internal logic paths |
| No knowledge of code | Full knowledge of code |
| Equivalence partitioning, boundary value analysis | Statement/branch/path coverage |
| Catches missing-functionality/spec-mismatch | Catches logic/path errors |
- Neither is "better" — depends on defect type.
📌 Testing Levels (in order)
- Unit → individual components in isolation
- Integration → interactions between combined modules
- System → complete system vs overall requirements
- Acceptance → validates against customer's requirements (not the spec)
📌 Other Named Testing Types
- Regression — re-run tests after a change.
- Performance — speed, responsiveness, load stability.
- Web application testing — functional + usability + cross-browser + load + security.
📌 Test Design Techniques
- Black-box: equivalence partitioning, boundary value analysis, decision tables, state transition.
- White-box: statement/branch/path coverage.
🔥 Past Papers
- 2022 Q7(b) — black-box vs white-box
- 2022 Q8(a) — web application testing
- 2024 Q7(b)&(c) — test design techniques
- 2025 MCQ — acceptance testing confirms customer requirements
⚠️ MCQ Trap
- Acceptance = matches customer's requirements.
- System = matches written spec.
📜 Past-Paper Questions & MCQs (CSS 2016–2026)
2018 · Paper-I · Q7(b) · 4 marks
Q. Give an outline of the unit testing process for verification.
Ans.
- Unit testing tests the smallest parts (functions, methods or classes) in isolation, usually by the developer.
- Process:
- plan and design test cases from the specification (inputs and expected outputs)
- write a test driver, and stubs for the modules it calls
- run each test and compare actual with expected results
- record and fix failures, then retest (regression)
- measure coverage (statements, branches)
- Tools: JUnit, NUnit, pytest, Google Test.
2018 · Paper-I · Q7(e) and 2022 · Paper-I · Q7(b) · 4 and 6 marks
Q. Outline the difference between black-box and white-box testing. Which finds more errors?
Ans.
| Basis | Black-box testing | White-box (glass-box) testing |
|---|---|---|
| Knowledge of code | Not needed (tests inputs and outputs) | Needed (tests internal logic) |
| Based on | Requirements and specification | Code structure: statements, branches, paths |
| Techniques | Equivalence partitioning, boundary value analysis | Statement, branch and path coverage, cyclomatic complexity |
| Done by | Testers and users | Developers |
| Finds | Missing or wrong functions and interface errors | Logic errors, dead code and untested paths |
- Which finds more errors? Neither alone. They find different kinds of defects, so use both together (grey-box). White-box testing finds more internal logic errors, and black-box finds requirement-level errors.
2022 · Paper-I · Q7(a) · 8 marks
Q. Draw the control flow graph for the binarySearch function and find its cyclomatic complexity.
Ans.
- Nodes: N1
low=0; high=n-1· N2while (low <= high)· N3mid=...; if (x < v[mid])· N4high = mid-1· N5else if (x > v[mid])· N6low = mid+1· N7return mid· N8return -1· N9 exit. - Edges: N1→N2, N2→N3 (true), N2→N8 (false), N3→N4, N3→N5, N4→N2, N5→N6, N5→N7, N6→N2, N7→N9, N8→N9.
N1 → N2 ─true→ N3 ─x<v→ N4 ─┐
│ └─else→ N5 ─x>v→ N6 ─┐
│ └─equal→ N7 → exit
└─false→ N8 → exit (N4 and N6 loop back to N2)
- V(G) = E − N + 2 = 11 − 9 + 2 = 4. Check: decision nodes (while, if, else-if) = 3, and 3 + 1 = 4.
- Four independent paths: (1) N1-N2-N8 (empty range); (2) N1-N2-N3-N5-N7 (found); (3) N1-N2-N3-N4-N2-N8 (go left, then end); (4) N1-N2-N3-N5-N6-N2-N8 (go right, then end).
2024 · Paper-I · Q7(b) · 6 marks
Q. What are the different types of test design techniques? When would you use them?
Ans.
- Black-box (specification-based):
- Equivalence partitioning: group inputs into classes and test one from each. Use for input validation.
- Boundary value analysis: test at the edges (min, max, just outside). Use for numeric ranges.
- Decision tables and state transition: use for complex rules and workflows.
- White-box (structure-based): statement, branch and path coverage. Use in unit testing of critical logic.
- Experience-based: error guessing and exploratory testing. Use when time is short or specifications are poor.
2017 · Paper-I · Q6(c) · 6 marks (testing part)
Q. Explain software testing and the different methodologies.
Ans. Software testing runs a program to find defects and confirm it meets requirements. Levels: unit, integration, system and acceptance testing. Approaches: black-box, white-box, and grey-box. Types: functional, performance, regression, security and usability testing. Design patterns in Agile are on Software Design Strategies.
MCQs
2025 P-I · Q3. Which type of software testing is used to confirm whether the software is according to the customer's requirements?
- (A) Performance testing
- (B) Acceptance testing ✅
- (C) Regression testing
- (D) None of these
- Answer: (B) Acceptance testing.
- Why: acceptance testing (UAT) is done by or for the customer to decide whether the system meets the agreed requirements. Performance testing checks speed and load, and regression testing checks that new changes have not broken old features.