Design Specification Examples in CS Thinking

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Design Specification.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in CS Thinking.

Concept Recap

A document that describes what a software system should do, how it should behave, and what constraints it must satisfy, before coding begins. A good specification covers functional requirements (what the system does), non-functional requirements (performance, security, usability), and acceptance criteria (how to verify it works).

A spec is a blueprint for software โ€” like an architect's plan before building a house. It answers 'what are we building and why?' before 'how?'

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Good specifications reduce wasted effort. Building the wrong thing is more expensive than spending time on a clear spec.

Common stuck point: A spec describes what the system does, not how it's coded internally. Implementation details come later.

Sense of Study hint: When writing a specification, start by listing what the user needs to accomplish (user stories or use cases). Then define the specific behaviors the system must have (functional requirements). Add constraints like performance targets and supported platforms. Finally, write acceptance criteria that define 'done.'

Worked Examples

Example 1

easy
What is a design specification and what should it include for a simple calculator app?

Answer

A design specification describes purpose, inputs, outputs, UI, functionality, constraints, and success criteria โ€” all defined before coding.

First step

1
Step 1: A design specification is a detailed plan that describes what the software should do, how it should look, and how it should behave โ€” before any coding begins.

Full solution

  1. 2
    Step 2: For a calculator app it should include: purpose (perform basic arithmetic), inputs (numbers and operators), outputs (calculation results), user interface layout (buttons, display), and functionality (add, subtract, multiply, divide).
  2. 3
    Step 3: It should also specify constraints (e.g., handles numbers up to 10 digits, shows error for division by zero) and success criteria (how to verify it works correctly).
Design specifications prevent misunderstandings and scope creep. They serve as a contract between the developer and the client about what will be built.

Example 2

medium
A client asks for a 'fast and user-friendly website'. Explain why this is insufficient as a design specification and suggest specific, measurable criteria to replace these vague terms.

Example 3

hard
Rewrite 'the system must handle many users' into two measurable requirements.

Example 4

hard
Two stakeholders disagree about 'fast': sales wants < 1 s, engineering says < 3 s for 99%. Write a single resolved acceptance criterion.

Example 5

hard
Write a brief functional requirement for 'student can search a library catalog by title or author', including acceptance criteria.

Example 6

challenge
For an online shop, give two functional and two non-functional requirements that are independently testable.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

medium
Write a brief design specification for a school library book search system. Include at least: purpose, inputs, outputs, and three functional requirements.

Example 2

hard
Explain the difference between functional requirements and non-functional requirements. Give two examples of each for an online shopping system.

Example 3

easy
A design spec should describe WHAT the system does. Which question does a spec answer FIRST?

Example 4

easy
Classify: 'Pages must load in under 2 seconds.' Functional or non-functional requirement?

Example 5

easy
Classify: 'Users can reset their password via email.' Functional or non-functional?

Example 6

easy
Which is the BETTER requirement: (a) 'the system should be fast' or (b) 'search returns results within 1 second'?

Example 7

easy
What part of a spec states HOW to verify the system works correctly?

Example 8

easy
Which detail does NOT belong in a 'what, not how' design spec: (a) the feature behavior, (b) which database to use?

Example 9

easy
Why is a clear spec described as cheaper than fixing later? (one phrase)

Example 10

easy
Whose involvement does a good spec require to avoid missing real needs?

Example 11

medium
A spec says 'the app should be secure.' Rewrite it as a measurable non-functional requirement (example).

Example 12

medium
Two requirements conflict: 'show all data instantly' and 'never store user data'. What should the spec process do?

Example 13

medium
Which requirement is properly testable: (a) 'easy to use' (b) 'a new user completes signup in <= 3 steps'?

Example 14

medium
A spec lists features but no performance, security, or usability limits. What category is missing?

Example 15

medium
Order these: (1) gather requirements, (2) write design spec, (3) write code. Which comes BEFORE coding?

Example 16

medium
A spec includes 'use React and PostgreSQL' as a top requirement. What is the flaw?

Example 17

medium
Given acceptance criterion 'checkout completes in <= 4 clicks', a feature takes 6 clicks. Does it pass?

Example 18

medium
Classify: 'The interface must be available in English and Spanish.' Functional or non-functional?

Example 19

medium
A spec mixes 'what' and 'how': 'store users in a MySQL table with an email column.' Rewrite as a pure requirement.

Example 20

challenge
A spec says 'support many users.' Turn this into a verifiable requirement and explain why the original fails.

Example 21

challenge
Spec change mid-project: a new law requires data deletion on request. Which requirement type is this, and where in the SDLC does it force a return?

Example 22

challenge
Two stakeholders give conflicting acceptance criteria for 'fast': < 1s (sales) and < 3s for 99% (engineering). What is the disciplined resolution in the spec?

Example 23

easy
Classify: 'Login completes in under 1 second.' Functional or non-functional?

Example 24

easy
Classify: 'Users can upload a profile photo.' Functional or non-functional?

Example 25

easy
Which is BETTER: (a) 'the app should be reliable', (b) 'the app must have 99.9% monthly uptime'?

Example 26

easy
Which item does NOT belong in a 'what, not how' spec: (a) user flow, (b) which language to code in?

Example 27

easy
What stage of the SDLC produces a design specification?

Example 28

medium
Rewrite 'the page should load fast' into a testable non-functional requirement.

Example 29

medium
Two requirements conflict: 'no data is stored on the server' vs 'users see their history across devices'. What is the disciplined next step?

Example 30

medium
Which requirement is testable: (a) 'intuitive UI', (b) 'a first-time user completes signup with no help in <= 3 minutes'?

Example 31

medium
A spec only lists features but no security, performance, or accessibility limits. What category is missing?

Example 32

medium
Order: (1) gather requirements, (2) write code, (3) write design spec, (4) test acceptance. What is the correct order?

Example 33

medium
A spec says 'use AWS DynamoDB and the React Native framework' as top-level requirements. What is the flaw?

Example 34

medium
Acceptance criterion: 'checkout flow completes in <= 4 clicks'. A user finishes in 5 clicks. Does it pass?

Example 35

medium
Classify: 'The site must comply with WCAG 2.2 AA.' Functional or non-functional?

Example 36

medium
Spec mixes what + how: 'persist users in a Postgres table named users'. Rewrite as pure requirement.

Example 37

medium
A spec is silent about errors. What is one risk?

Example 38

hard
A new privacy law mandates data deletion on request. Which type of requirement is this and where in the SDLC do you revisit?

Example 39

hard
Why is a spec that includes mockups but no acceptance criteria still incomplete?

Example 40

hard
Classify: 'The system must encrypt data at rest using AES-256.' This is both a what and a how. Rewrite as a pure non-functional requirement.

Example 41

challenge
A spec lists 200 requirements with no prioritization. What problem will this cause in execution?

Background Knowledge

These ideas may be useful before you work through the harder examples.

pseudocodeflowchart