HagiCode Fullstack

寫需求說明

Draft: this lesson is an outline and will be expanded.

A spec is a written description of what your app must do. It is the brief you learned to write earlier, plus a done-checklist: a list of statements that are either true or false when you test the app. You finish with a spec your assistant can build from and a checklist you can use to decide that you are finished.

What you will do

  1. Create a file named spec in your project.
  2. Write Who and why: the person who uses the app and the problem it solves, in two or three sentences.
  3. Write What it does: a short list of things a person can do in the app, each as one sentence that starts with “A person can”. Keep it to the smallest useful set.
  4. Write What it does not do in the first version. This is the list from the previous lesson.
  5. Write What it must never do. Think about private data, deleting things by accident and spending money. For example: never delete a note without asking first; never show one person’s data to another.
  6. Write the done-checklist. Turn each item in “What it does” into a test you can run, in the form “I do this and I see that”. Add one item for the plain message the app shows when something fails.
  7. Ask your assistant: “Read my spec. Point out anything unclear, anything missing and anything that conflicts.” Fix the spec where the points are fair. Do not accept extra features you did not ask for.
  8. Save the spec as a checkpoint with a message such as “Add the first spec”.

Check yourself

  • The spec has who and why, what it does, what it does not do and what it must never do.
  • Every item of “What it does” has a matching line in the done-checklist.
  • You asked your assistant to review the spec and you fixed what was fair.
  • The spec is saved in your project.