How unit 5 is examined
This unit covers checking OOA/OOD models, OO testing strategies, test cases and test plans (the highest-weight topic), project management, Rational tool mentors, and design patterns.
Correctness and consistency of OOA & OOD models
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. OOA builds the analysis model (use cases, analysis classes) of what the system must do, and OOD builds the design model (class, interaction and state diagrams) of how it will do it. <mark>Correctness means each model correctly represents the real requirements, and consistency means the models do not contradict one another.</mark>
Key points.
- Errors are cheapest to remove in the models, so the OOA and OOD models are tested before any code exists.
- Correctness is judged against the customer's requirements and the domain, using the syntax and semantics of the notation (UML) as the yardstick.
- Consistency is checked by tracing every use case to classes and every class to the design elements that realise it, using a class-responsibility-collaborator (CRC) model and an object-relationship model.
- Formal technical reviews by analysts, designers and users walk through each model against a checklist.
- Each iteration refines the analysis model into the design model, and both are re-checked after every change.
Asked: [7 marks] (May 2022) How are correctness and consistency of OOA and OOD models made?
Answer frame. Open by defining OOA and OOD models; list points 1-5 in order; close that iterative review keeps the two models aligned.
Testing Strategies and test cases for OO software process
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. OO testing checks classes, their collaboration and the whole system. <mark>OO testing is done at three levels, class (unit), cluster (integration) and system (validation), using fault-based, scenario-based and random test cases.</mark>
Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u5-01" viewBox="0 0 527 130" width="527" height="130" role="img" aria-label="Levels of OO testing: class testing, cluster (integration) testing, system (validation) testing"><style>#dsfig-u5-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u5-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u5-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u5-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u5-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u5-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u5-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u5-01 .t{fill:#16181D;font-weight:500}#dsfig-u5-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u5-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u5-01 .dot{fill:#16181D}#dsfig-u5-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u5-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u5-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u5-01 .ah{fill:#454C5A}#dsfig-u5-01 .ah.hi{fill:#2340B8}#dsfig-u5-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u5-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u5-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u5-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u5-01 .e{stroke:#B1B7C3}html.dark #dsfig-u5-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u5-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u5-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u5-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u5-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u5-01 .t{fill:#E6E8ED}html.dark #dsfig-u5-01 .t.inv{fill:#0F1115}html.dark #dsfig-u5-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u5-01 .dot{fill:#E6E8ED}html.dark #dsfig-u5-01 .ann{fill:#8FA3FF}html.dark #dsfig-u5-01 .lbl{fill:#858D9C}html.dark #dsfig-u5-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u5-01 .ah{fill:#B1B7C3}html.dark #dsfig-u5-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u5-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u5-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u5-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><line class="e" x1="237.8" y1="37" x2="67" y2="101"/><line class="e" x1="237.8" y1="37" x2="224" y2="101"/><line class="e" x1="237.8" y1="37" x2="408.5" y2="101"/><rect class="n" x="188.8" y="22" width="98" height="30" rx="8"/><text class="t" x="237.8" y="37" dy=".35em" text-anchor="middle">OO testing</text><rect class="n" x="14" y="86" width="106" height="30" rx="8"/><text class="t" x="67" y="101" dy=".35em" text-anchor="middle">Unit: class</text><rect class="n" x="136" y="86" width="176" height="30" rx="8"/><text class="t" x="224" y="101" dy=".35em" text-anchor="middle">Integration: cluster</text><rect class="n" x="328" y="86" width="161" height="30" rx="8"/><text class="t" x="408.5" y="101" dy=".35em" text-anchor="middle">Validation: system</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Levels of OO testing: class testing, cluster (integration) testing, system (validation) testing</figcaption></figure>
Key points.
- Unit testing in OO treats the class, not the single function, as the unit, because methods work on shared object state and must be tested together.
- Integration testing checks a cluster of collaborating classes, either thread-based (classes that respond to one input or event) or use-based (independent classes first, then dependent ones).
- Validation testing checks the complete system against user requirements using use cases and scenarios, exactly as in conventional black-box testing.
- Fault-based test cases look for likely faults, such as wrong operation calls, missing initialisation or wrong parameter types.
- Scenario-based test cases derive tests from use cases, so they catch interaction errors between classes and users.
- Random test cases pick random valid orderings of a class's operations (for example open, deposit, withdraw, close) to find sequence-related faults.
- Inheritance needs each subclass retested in its own context, and polymorphic calls need a test for every possible binding.
| Basis | Traditional testing | OO testing |
|---|---|---|
| Unit | Function or module | Class with its state |
| Integration | Top-down or bottom-up by call hierarchy | Cluster of collaborating classes |
| Encapsulation | Data is visible, easy to check | Hidden data makes state checking harder |
| Inheritance | Not present | Inherited methods must be retested |
| Polymorphism | Not present | Every binding needs a test |
| Advantage | Mature and simple | Early defect detection and reusable class tests |
Test plan. <mark>A test plan is a document that states the scope, objectives, approach, resources and schedule of the testing effort.</mark> Guidelines: (1) state clear objectives and scope; (2) choose the strategy and test levels; (3) set entry and exit criteria; (4) list the test items, features and test cases; (5) allocate resources, people, tools and environment; (6) fix the schedule and deliverables; (7) identify risks and contingencies; (8) get the plan reviewed and approved.
Unit testing importance. Testing a class in isolation finds faults early, when they are cheap to fix, and gives a safety net for refactoring. Practices: test every public method, cover boundary and invalid inputs, test state changes, use mocks or stubs for collaborators, measure coverage, and automate with a JUnit-like framework.
Answer frame. For strategies: open with the three levels, draw the diagram, develop points 1-7, then the comparison table, and close with the advantages. For test plan: define it, give the eight guidelines, add a sample structure (introduction, scope, approach, criteria, schedule, risks). For unit testing: define, give the importance, list the practices, name JUnit.
Asked: [7 marks] (May 2022, Jun 2025) What are the different strategies and test cases used for Object Oriented Software process? Discuss OO testing strategies, how they differ from traditional testing and their advantages. Asked: [7 marks] (May 2022) What is a test plan? Explain in detail the guidelines to be followed in developing a test plan. Asked: [7 marks] (Jun 2025) Explain the importance of unit testing in object-oriented programming. What practices ensure comprehensive unit testing of classes and methods?
Pitfall: Do not describe OO unit testing as testing single functions; the unit is the class.
Project Management
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Project management is planning, organising, monitoring and controlling a software project so it is delivered on time, within budget and to quality.</mark>
Key points.
- Planning covers scope, estimation, scheduling and resources.
- Risk management identifies and plans for risks early.
- In OO projects the classes and increments give natural units for tracking progress.
- Progress is tracked by metrics such as number of classes, methods per class and coupling.
Rational Tool Mentors
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Tool mentors in RUP are step-by-step guides that show how to perform an activity using a specific Rational tool.</mark>
Key points.
- Each RUP activity has a tool mentor, for example for Rational Rose in modelling.
- Tools cover requirements (RequisitePro), modelling (Rose), testing (TestManager, Robot) and change control (ClearCase, ClearQuest).
- They link the process description to the tool, so the team learns the tool while following the workflow.
Introduction to Design Patterns
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. <mark>A design pattern is a reusable, proven solution template to a commonly occurring design problem in a given context.</mark>
Key points.
- A pattern has a name, problem, solution, and consequences, so it is a template and not finished code.
- Creational patterns handle object creation, for example Singleton, which allows only one instance of a class.
- Structural patterns handle composition of classes, for example Adapter and Facade.
- Behavioral patterns handle communication between objects, for example Observer, where dependents are notified when a subject changes.
- Patterns give designers a shared vocabulary, so a team understands "use a Singleton" at once.
- They capture best practices, reduce design time, and give loosely coupled designs that are easier to maintain and scale.
| Basis | Design pattern | OO modeling |
|---|---|---|
| Nature | Reusable solution template | Representation of a system |
| Purpose | Solve a recurring design problem | Show structure and behaviour |
| Level | Guideline applied inside a design | Whole-system model (UML) |
| Reuse | Reused across systems | Specific to one system |
Answer frame. Open with the definition; list the three categories with one example each; explain importance (points 5-6); add the table for the difference; close with maintainability and scalability.
Asked: [7 marks] (May 2022) What is meant by design pattern? How is it different from object-oriented modeling? Asked: [7 marks] (Jun 2025) Define design patterns. Why are they important, and how do they contribute to maintainable and scalable software?
Last-minute revision
- OOA models what the system does; OOD models how it does it.
- Correctness means true to requirements; consistency means no contradictions between models.
- OO testing levels are class, cluster and system.
- Strategies are unit, integration (thread-based, use-based) and validation.
- Test cases are fault-based, scenario-based and random.
- The unit of OO testing is the class, not the function.
- A test plan states scope, objectives, approach, resources, schedule, criteria and risks.
- Tool mentors are step-by-step guides for using Rational tools.
- Design pattern categories are creational, structural and behavioral.
- A pattern is a solution template; a model is a representation.
Memory hooks
- CCS: Class, Cluster, System.
- FSR: Fault, Scenario, Random test cases.
- CSB: Creational, Structural, Behavioral patterns.
- Pattern is the recipe, model is the picture.
Coverage checklist
- Correctness and consistency of OOA & OOD models: how correctness and consistency are made (May 2022).
- Testing Strategies and test cases for OO software process: strategies and test cases; test plan; unit testing importance.
- Project Management: no past questions.
- Rational Tool Mentors: no past questions.
- Introduction to Design Patterns: meaning and difference from modeling; importance and maintainability.