CampusLearn
← BIT 302 Software Engineering

Requirements Specification and Design Patterns

Notes

Specifying observable needs A requirement states a capability or constraint that a system must satisfy. Functional requirements describe behaviour, such as recording a sale; non-functional requirements describe qualities or limits, such as response time, security and availability. Elicitation gathers needs through interviews, observation, workshops and document analysis. Requirements should be clear, feasible and testable, with sources and priorities recorded. A statement such as fast processing is ambiguous until it specifies workload and a measurable threshold. Traceability links each requirement to its design, implementation and tests so that changes can be assessed systematically. Designing maintainable solutions A design pattern is a reusable approach to a recurring design problem, not finished code to copy blindly. The Strategy pattern allows interchangeable algorithms behind a common interface, while Observer distributes notifications when a subject changes. Model-View-Controller separates application data and rules, presentation, and input coordination. These separations can reduce coupling, meaning dependence between components, and improve cohesion, meaning how closely responsibilities belong together. Patterns introduce interfaces and complexity, so use them where genuine variation or coordination exists. A simple stable calculation may need a function rather than an elaborate class hierarchy. Practical example A Thika wholesale shop charges delivery at KES 100 within town and KES 30 per kilometre outside town, with a KES 150 minimum for outside trips. For an outside delivery of four kilometres, the distance charge is 4 times 30, or KES 120, so the minimum raises it to KES 150. A Strategy interface can separate town and distance pricing rules. Acceptance tests should check four kilometres at KES 150 and eight kilometres at KES 240. A performance requirement might demand that 95 percent of price quotations complete within two seconds under 50 concurrent users.

Quiz

1. Which pattern best supports interchangeable delivery pricing algorithms?

2. Which requirement is most directly testable?

3. At KES 30 per kilometre with a KES 150 minimum, what should an outside trip of four kilometres cost?

Sign in to submit and securely grade your quiz.