Explaining requirements and design
The user asked about the relationship between requirements and design in software engineering, which is a common topic in courses like requirements engineering or architecture.
Requirements explain what the system should do, focusing on stakeholder needs and remaining technology-agnostic. Design, on the other hand, details how to fulfill those requirements, highlighting specific structures and components.
Their relationship involves layered traceability, where design choices stem from requirements, with various categories like functional, non-functional, and constraints influencing decisions. The distinction isn’t always clear; it often feels like a gradient rather than a bright line.Clarifying requirements and design
I have a rule of thumb: requirements outline observable behaviors or effects, while design focuses on internal structures and choices.
There are techniques like use cases and user stories, which can fall near requirements, and UI mockups, that straddle both sides.
For example, a requirement might state that the "system shall authenticate users," while the design could specify using OAuth 2.0 with JWT tokens.
It’s important to avoid overly specific requirements that constrain design choices too early, as this can limit potential solutions, although sometimes it’s unavoidable due to constraints. The distinction between requirements and design can shift based on context, especially in agile settings.Identifying requirement versus design decisions
I see that some requirements can also be considered design decisions, often referred to as design or implementation constraints.
To determine where to draw the line, I need some heuristics.
First, if it reflects a stakeholder need or external obligation, it’s a requirement. If it details specific technology or components, it's design. If I can frame it in business language, it’s likely a requirement; if only developers understand it, it’s design.
Requirements showcase the system’s external behavior, while design focuses on its internal workings. Lastly, we stabilize requirements before diving into detailed design, but it remains an iterative process.Clarifying design and requirements
Design encompasses both architecture (logical and physical) and detailed design. I can visualize the V-model diagram, where the left side includes requirements, system design, architecture, and module design, while the right side focuses on testing.
I need to address non-functional requirements and environment as a bridging layer that architecture meets. There are grey areas, like UX wireframes that can fall under both design and requirements.
When writing requirements, I should focus on outcomes and testable constraints, avoiding specifics about technologies. I’ll mark true constraints clearly and utilize a traceability matrix to connect requirements to design decisions, as misinterpretations can lead to rigidity or ambiguity.Preparing an exam response
I’m considering whether the user is asking this in the context of an exam, possibly about separation of concerns. I think it's useful to reference IEEE Std 29148 and Jackson's "problem vs machine world" in my answer.
First, I need to define requirements and design clearly and succinctly. Then, I'll explain their relationship. Finally, I should discuss where the line between requirements and design is, using heuristics and examples to clarify the distinctions. Let's put that together! Requirements and design are two views of the same thing—the system you’re building—but they live on opposite sides of a boundary:
- Requirements: Describe the problem and the outcomes the system must achieve.
- Design: Describes the solution—how the system will be structured and behave internally to meet those requirements.
1. What are “requirements”?
Requirements are statements of what the system must do and under which constraints, expressed from an external point of view.
They should:
- Be about externally observable behavior and effects.
- Example: “The system shall allow a user to reset their forgotten password via email.”
- Capture quality attributes and constraints.
- Example: “The system shall process 95% of payment transactions within 2 seconds.”
- Example (constraint): “The system shall operate on existing Windows 11 workstations.”
- Use language that stakeholders (not just developers) can understand.
- Be (at least in principle) technology-agnostic.
Think “black box”: If someone interacts with the system only through its interfaces (UI, API, devices), requirements say what they see, what they can do, and what guarantees they get.
2. What is “design”?
Design is about how the system will satisfy those requirements.
It describes:
- Structure: components, modules, layers, data structures.
- Example: “Use a three-layer architecture with presentation, application, and data layers.”
- Behavior and algorithms: protocols, workflows, state machines, algorithms.
- Example: “Use a two-phase commit protocol to ensure transactional integrity across services.”
- Technology choices: frameworks, products, databases, patterns.
- Example: “Implement authentication using OAuth 2.0 with JWT tokens backed by PostgreSQL.”
Think “white box”: Design opens up the box and explains the internals.
3. Relationship between requirements and design
You can think of it as a chain:
- Requirements define success: What must be true in the real world for the system to be acceptable.
- Design proposes a solution: A specific structure and approach that, if implemented correctly, will make those requirements true.
- Traceability:
- Every design element should trace back to one or more requirements (“Why does this exist?”).
- Every requirement should be covered by some part of the design (“How will we satisfy this?”).
Mathematically: requirements define the constraints on acceptable solutions; design is one particular solution that satisfies those constraints.
4. Where do we draw the line?
There is no perfectly sharp line, but there are good rules of thumb.
Rule 1: External vs internal perspective
- Requirement if it describes:
- What external actors can observe or do.
- Properties measurable at the system boundary.
- Design if it describes:
- Internal structure, decomposition, data models, algorithms, technology.
Example:
- Requirement: “A user shall receive a confirmation email within 5 minutes after completing a purchase.”
- Design: “Use an asynchronous message queue to trigger an email service that sends confirmation emails.”
Rule 2: Outcome vs mechanism
Try to phrase statements in terms of outcomes, not mechanisms.
- Requirement (good):
“The system shall persist all orders so they are not lost in case of power failure.”
- Design:
“Store orders in a replicated relational database with write-ahead logging.”
If you name a specific product, pattern, or algorithm, you’re probably in design territory unless it's a mandated constraint.
Rule 3: Stakeholder language vs implementer language
- If business users, regulators, or domain experts can understand and validate it, it’s likely a requirement.
- If it only makes sense to developers or architects, it’s likely design.
Example:
- Requirement: “Only authorized medical staff may view a patient’s full record.”
- Design: “Use role-based access control with roles DOCTOR, NURSE, and ADMIN assigned at login.”
Rule 4: Black-box testability
Ask: Can I test this from outside, without knowing how it’s built?
- If yes → it can be a requirement.
- If it can only be tested by inspecting internals (code structure, DB schema, component boundaries) → that’s design.
Example:
- Requirement: “The system shall support at least 1,000 concurrent users without degrading average response time beyond 1 second.”
- Design: “Deploy three load-balanced application servers in front of a shared database.”
Rule 5: Constraints vs design freedom
Some things look like design but are actually constraints imposed by the environment, contract, or regulation.
- True external constraint (still a requirement, but note it restricts design):
“The solution shall use the organization’s existing Oracle database cluster.”
- Pure design decision (not a requirement):
“The solution shall be built with a microservices architecture.”
A useful practice: explicitly label things like this as implementation constraints in the requirements, and keep them separate from functional/quality requirements. That makes clear where design freedom is being removed.
5. Why it matters to keep them distinct
6. Practical guidance
When you’re writing or reviewing requirements:
- Phrase as behavior or outcome:
- “The system shall … so that …”
- Avoid embedding the solution unless it’s a real constraint:
- Prefer: “The system shall store documents for at least 7 years.”
- Avoid: “The system shall store documents in MongoDB for at least 7 years.” (MongoDB is a design decision, unless mandated.)
- Separate sections:
- Requirements Specification (what & constraints).
- Architecture/Design Specification (how).
- Use traceability:
- For each design element, be able to point to the requirement(s) it satisfies.
- For each requirement, be able to point to where the design addresses it.
In one sentence:
- Requirements define the problem and the externally visible success criteria; design defines the internal solution that will satisfy those requirements. The “line” is at the system boundary: outside is requirements (what must be true when interacting with the system), inside is design (how we make it true).