Exercises: Software Development Lifecycle
These exercises focus on thinking about software rather than writing code. That's deliberate — the skills practiced here (writing specifications, conducting reviews, evaluating trade-offs) are what separate someone who can program from someone who can build software professionally.
Difficulty Guide: - ⭐ Foundational (5-10 min each) - ⭐⭐ Intermediate (10-20 min each) - ⭐⭐⭐ Challenging (20-40 min each) - ⭐⭐⭐⭐ Advanced/Research (40+ min each)
Part A: SDLC and Methodology Concepts ⭐
A.1. List the six phases of the SDLC in order. For each phase, write one sentence explaining what happens during that phase.
A.2. A government agency needs software to calculate tax refunds. The tax code is published and changes only once a year. Requirements are well-defined and must be audited. Would you recommend Waterfall or Agile? Explain your reasoning in 3-4 sentences.
A.3. A startup is building a new social media app. They're not sure what features users will want, and they need to ship something within 8 weeks to attract investors. Would you recommend Waterfall or Agile? Explain your reasoning in 3-4 sentences.
A.4. Explain the difference between a Product Owner and a Scrum Master. Why are these separate roles?
A.5. What is an MVP? Give an example of an MVP for a ride-sharing app (like Uber). What's the absolute minimum set of features you'd need to test whether the concept works?
A.6. In your own words, explain why the Agile Manifesto says "working software over comprehensive documentation" rather than "working software instead of documentation."
Part B: User Stories and Specifications ⭐⭐
B.1. Write three user stories for a library book checkout system using the standard format:
As a [type of user], I want to [do something] so that [reason/benefit].
Each story should be for a different type of user (e.g., library patron, librarian, administrator).
B.2. Take one of your user stories from B.1 and write 4-5 acceptance criteria for it. Each criterion should be testable — you should be able to write a pytest test for it.
B.3. Write a mini-specification for a "Study Timer" application. Include: - Project overview (2-3 sentences) - Three goals - Three non-goals - Five user stories with acceptance criteria - Two open questions
B.4. A team writes this user story:
As a user, I want the app to be fast and easy to use.
Explain why this is a poorly written user story. Rewrite it as 2-3 well-formed user stories with specific, testable acceptance criteria.
B.5. You're planning a sprint for TaskFlow. Estimate the relative size of each user story below using T-shirt sizes (XS, S, M, L, XL). Justify each estimate in one sentence.
- a) Add a "tag" field to tasks (users can add multiple tags)
- b) Implement task search by tag
- c) Add a dashboard showing task completion statistics
- d) Export tasks as a formatted PDF
- e) Add keyboard shortcuts to the CLI menu
Part C: Code Review ⭐⭐-⭐⭐⭐
C.1. Review the following function as if you were a teammate. Write at least four specific review comments covering correctness, readability, design, and testing.
def p(d, k):
r = []
for i in d:
if k in i["name"] or k in i["desc"]:
r.append(i)
return r
C.2. Rewrite the function from C.1 based on your own review comments. Include a docstring, descriptive names, and any design improvements you suggested.
C.3. Review the following class. Identify at least three issues (design, correctness, or style) and explain how you'd fix each one.
class TaskManager:
tasks = []
def __init__(self):
self.file = "tasks.json"
self.load()
def load(self):
import json
try:
f = open(self.file)
TaskManager.tasks = json.load(f)
except:
pass
def add(self, name):
TaskManager.tasks.append({"name": name, "done": False})
self.save()
def save(self):
import json
f = open(self.file, "w")
json.dump(TaskManager.tasks, f)
def delete(self, i):
del TaskManager.tasks[i]
self.save()
C.4. You receive this review comment on your pull request: "This is wrong. Rewrite it." How would you respond? Then write a version of the same feedback that follows code review best practices.
C.5. Write a code review checklist of 8-10 items that your team could use when reviewing pull requests. Organize the items into categories (e.g., Correctness, Design, Testing, Style).
Part D: Technical Debt and Documentation ⭐⭐⭐
D.1. Look at a project you've written (TaskFlow or any other project from this course). Identify three examples of technical debt. For each one, classify it using the four-quadrant model (deliberate/inadvertent, prudent/reckless) and describe how you would pay it down.
D.2. Write a complete README for a hypothetical "Weather Dashboard" Python CLI application. Include all sections from the template in Section 26.8: project name and description, installation instructions, usage examples, how to run tests, and license.
D.3. The following function has no documentation. Write a comprehensive docstring for it, then add one inline comment that explains a non-obvious design choice.
def archive_completed(tasks, cutoff_days=30):
cutoff = datetime.now() - timedelta(days=cutoff_days)
archived = []
remaining = []
for task in tasks:
completed = task.get("completed_at")
if completed and datetime.fromisoformat(completed) < cutoff:
task["archived"] = True
archived.append(task)
else:
remaining.append(task)
return remaining, archived
D.4. A teammate argues: "We don't need documentation — the code is the documentation. If you write clean code, you don't need comments." Write a 4-5 sentence response explaining what's right and what's wrong about this position.
Part E: CI/CD and Process ⭐⭐⭐-⭐⭐⭐⭐
E.1. Explain in your own words what would happen if a team practiced Continuous Integration but had no automated tests. Why would CI be less valuable without tests?
E.2. A developer pushes code that passes all local tests, but the CI pipeline fails. List three possible reasons for the discrepancy between local and CI results.
E.3. Design a CI pipeline for TaskFlow. List the steps in order (e.g., "checkout code," "install dependencies") and explain what each step checks. Your pipeline should have at least five steps.
E.4. (Research) Look up GitHub Actions, GitLab CI, or another CI/CD platform. Write a short summary (5-8 sentences) of how it works, what it costs, and what kinds of projects use it.
E.5. (Synthesis) You're the Scrum Master for a three-person team building a command-line expense tracker. Write a plan for your first sprint: - Define the sprint goal (one sentence) - Write 5 user stories from the backlog - Select 3 for the sprint and justify your choices - Describe what the daily standup would look like on Day 3 - Describe what you'd demo at the sprint review
Reflection Exercise
R.1. Think about a group project you've worked on (school, work, or personal). What SDLC phase was most neglected? What went wrong as a result? What would you do differently knowing what you know now? Write a paragraph.