Skip to content

Module 20 · Building Real Python Applications — topic 1 of 13

Application planning

Planning before coding: defining the problem and users, writing requirements and user stories, prioritising features into a minimum viable product, sketching the data model and commands, and planning milestones.

Beginner 10 min read·Lesson 294 of 306 in Python Programming

Learning objectives

  • Turn an idea into requirements and user stories
  • Prioritise features into a minimum viable product
  • Sketch the data model and commands before coding

Definition

Application planning is deciding what an application must do, for whom, and in what order it will be built, before writing most of the code. A plan covers requirements, priorities, a data model, the user interface and milestones.

Introduction

'Build an expense tracker' could mean a five-line script or a banking app. Planning decides which, and saves you from building the wrong thing.

Why it matters

A short plan prevents scope creep, makes progress measurable and gives you a clear first version to finish and show.

Detailed explanation

Start with a one-sentence problem statement: 'Students lose track of small daily expenses and want a quick way to record and review them.'

Identify the users and write user stories: 'As a student, I want to add an expense in one command so that recording is quick.'

Turn stories into concrete requirements, including limits: amounts are positive, categories come from a fixed list, data survives restarts.

Prioritise with MoSCoW: Must have, Should have, Could have, Won't have (this time). The Must items form the minimum viable product (MVP).

Sketch the data model: what records exist and which fields each has (an Expense has an amount, category, date and note).

Sketch the interface: for a command-line app, list the commands and their arguments; for a GUI, draw the screens.

Plan milestones that each produce something working: store and list expenses, then reports, then export.

Keep the plan short and revisit it — plans change as you learn, but having one keeps decisions deliberate.

Syntax

Text
Problem: students lose track of daily expenses
Users: students, one person per installation
Must: add expense, list expenses, save between runs
Should: monthly report by category
Could: export to CSV
Won't: cloud sync, multiple users
Data: Expense(amount, category, spent_on, note)
Commands: add, list, report, quit
  • Problem, users, priorities.
  • Data model and commands.
  • Milestones that each work.

Code examples

Prioritising features

Python
features = [("add expense", "must"), ("list expenses", "must"), ("monthly report", "should"),
("export CSV", "could"), ("cloud sync", "won't")]
for priority in ["must", "should", "could"]:
print(priority, [name for name, p in features if p == priority])
Output
must ['add expense', 'list expenses']
should ['monthly report']
could ['export CSV']

Sketching the data model

Python
from dataclasses import dataclass
from datetime import date
@dataclass
class Expense:
amount: float
category: str
spent_on: date
note: str = ""
print(Expense(250.0, "food", date(2026, 11, 27), "lunch"))
Output
Expense(amount=250.0, category='food', spent_on=datetime.date(2026, 11, 27), note='lunch')

More examples

A command skeleton from the plan

Python
def add(args):
return f"would add {args}"
def report(args):
return "would show report"
COMMANDS = {"add": add, "report": report}
def handle(line):
name, *args = line.split()
if name not in COMMANDS:
return f"unknown command {name!r}; try: {', '.join(COMMANDS)}"
return COMMANDS[name](args)
for line in ["add 250 food lunch", "report", "delete 3"]:
print(handle(line))
Output
would add ['250', 'food', 'lunch']
would show report
unknown command 'delete'; try: add, report

Step-by-step explanation

  • The commands planned on paper become entries in a dispatch table.
  • Each command starts as a stub that only reports what it would do, so the overall flow can be tried immediately.
  • Unknown commands already produce a helpful message listing the valid ones.

Expected output

Running “A command skeleton from the plan” prints exactly:

TextOutput
would add ['250', 'food', 'lunch']
would show report
unknown command 'delete'; try: add, report

Practical applications

  • Product teams writing user stories before each sprint.
  • Hackathon teams agreeing an MVP in the first hour.

Best practices

  • Write the problem statement and MVP first.
  • Prioritise with MoSCoW.
  • Plan milestones that each work end to end.

Common mistakes

Building everything at once

Avoid

# start with cloud sync, charts and multi-user support

Prefer

# finish add, list and save first, then extend

A complete small app beats a half-finished big one.

Important notes

  • A plan of half a page is usually enough for a personal project.

Key takeaways

  • Plan problem, users, requirements and priorities.
  • Sketch the data model and interface.
  • Build in working milestones.

Try it yourself

  1. 1
    Write a one-page plan for a library book-lending app, including MoSCoW priorities.
  2. 2
    Sketch the data model for a quiz app as dataclasses.

Finished reading? Mark it complete to update your dashboard.

Suggested practice

1 question test this exact topic. Answers and explanations are revealed after you submit.

  • AdvancedWhat does MVP stand for when planning an application?
Practise this topic