AP® Computer Science Principles · Big Idea 1 · Topic 1.3

Requirements, Specifications, and Interface Design

A requirement states what a program must do; a specification is the complete, checkable list of those behaviors. An interface meets the specification only when every listed behavior actually works, no matter how good it looks.

Before anyone writes code, someone has to decide what the program is actually for. That starts with investigation: talking to the people who will use it, watching how they work now, and figuring out what they need the program to do. Those findings get turned into requirements, plain statements like "the app must let a user reset their password" or "the app must work with one hand." Collect and organize all the requirements together and you get a specification: a complete, checkable list of behaviors the finished program must have. Only once that list exists does it make sense to sketch a screen layout, because the layout's job is to make every required behavior reachable and clear.

Writing the specification first feels slow, but it is cheaper than the alternative. A team that skips it tends to build something, discover it is missing behaviors users actually needed, and rebuild. The hours spent writing a clear specification are almost always smaller than the hours saved by not redoing work.

A requirement like "must work one handed on a phone" changes the interface directly: buttons move within thumb's reach, menus collapse instead of spreading across the screen, and actions that needed two hands, like pinch to zoom, need a one handed substitute. Design choices like these trace back to a specific requirement, which is why the specification comes before the layout and not after it. This connects forward to testing: once a specification exists, you can check a program against it item by item, which is exactly how you catch the gap between an interface that looks finished and a program that actually is.

Key terms

Requirement
A single statement of something a program must be able to do.
Specification
The complete, organized list of a program's requirements, used to check whether it is finished.
Investigation
The process of gathering information from users and context to figure out what a program needs to do.
Interface design
Deciding how a program's required behaviors are laid out and made accessible on screen.

Watch it explained

  1. How it worksHow do investigation results turn into a program specification and then into a screen layout?
  2. Going furtherWhat changes in a design when a requirement says the app must work one handed on a phone?
  3. Common mistakeWhy isn't an attractive interface the same thing as a program that meets its specification?

Check yourself

Your turn1 of 2
Writing a program's specification takes 8 hours, and having it saves 30 hours of rework later that would otherwise have been needed. How many net hours does writing the specification save, compared to skipping it?

End of topic.