Challenge 01 - Spec-Driven Development

< Previous Challenge - Home - Next Challenge >

Introduction

In this challenge, you will build the same application twice with GitHub Copilot:

  1. Using only a direct prompt
  2. Using a structured specification in a Markdown file

The goal is not to prove in advance that one approach is always better. The goal is to observe how the level of detail in the context affects time, credit consumption, the number of interruptions, and the delivered result.

This activity uses Spec-Driven Development (SDD). The specification will be provided in a single sdd.md file, without a constitution, special commands, a separate plan, or a task list.

Key concept: in SDD, the specification becomes the source of context for implementation.

Experiment Objective

Both approaches must build the same application with the same technology, model, and scope.

Application

A simple notes application built with React and TypeScript.

Requirements:

  1. Create, read, update, and delete notes (CRUD)
  2. Each note must have a required title and optional content
  3. Notes must exist only in the application’s in-memory state
  4. Do not use a backend, database, persistent storage, or automated tests
  5. The application must be implemented and run locally

Preparation

To make the comparison more consistent:

Also record the time and cost required to prepare the specification. They will be analyzed separately from implementation time.


Part 1 - Implementation with a Direct Prompt

Step 1 - Create an Empty Folder

mkdir notes-app-prompt
cd notes-app-prompt
code .

Step 2 - Start a New Conversation

Select the model chosen for the experiment and send only the prompt below:

Build a simple notes application using React and TypeScript.

Requirements:

1. Create, read, update, and delete notes.
2. Each note must have a required title and optional content.
3. Store notes only in the application's in-memory state.
4. Do not use a backend, database, persistent storage, or automated tests.

Implement the complete application on the local machine.

Step 3 - Record the Run

Record the start and end times, credits consumed, questions asked by Copilot, dependency decisions requested, required interventions, and any errors or rework.

Answer the questions required to allow the process to continue, but record each interruption.

Step 4 - Verify Manually

Confirm that you can:

Keep the project for the final comparison.


Part 2 - Implementation with SDD

In this part, the same application will be built from a previously prepared specification.

Step 1 - Create a New Empty Folder

mkdir notes-app-sdd
cd notes-app-sdd
code .

Step 2 - Create the Specification File

In the root of the folder, create a file named sdd.md with the following content:

# Specification: Simple Notes Application

## Objective

Build a complete notes application using React and TypeScript that runs
on the local machine. The application must allow users to create, read,
update, and delete notes.

## Technology

- React
- TypeScript
- Local development environment

## Note Data Model

Each note must contain:

| Field | Type | Required | Description |
|---|---|---|---|
| id | string or number | Yes | Unique identifier generated by the application |
| title | string | Yes | Title of the note |
| content | string | No | Optional content of the note |

## Functional Requirements

### REQ-001: Create notes

The user must be able to create a note with a required title and optional
content. A valid note must be added to the in-memory state and displayed.

### REQ-002: Read notes

The application must display the notes created during the current session,
including each note's title and its content when present.

### REQ-003: Update notes

The user must be able to update the title and content of an existing note.
The update must replace the existing note without creating a duplicate.

### REQ-004: Delete notes

The user must be able to delete an existing note. The deleted note must be
removed from memory and no longer displayed.

### REQ-005: Required title

The application must not create or update a note with an empty title. The
content may be empty.

### REQ-006: In-memory state

Notes must be managed only in client-side application state. Notes may be
lost when the page is refreshed or the application is restarted.

## Constraints

- Use React and TypeScript
- Run on the local machine
- Do not use a backend
- Do not use a database
- Do not use localStorage, IndexedDB, files, or other persistent storage
- Do not include automated tests

## Definition of Done

The application is complete when it runs locally and the user can create,
read, update, and delete notes while all constraints above are respected.

Step 3 - Start a New Conversation

Select the same model used in Part 1 and send:

Read the sdd.md file in this project and implement the complete application
described in it on the local machine.

Follow the specification exactly. Do not add requirements or functionality
outside the defined scope.

Step 4 - Record and Verify

Record the same measurements as in Part 1 and use exactly the same manual checklist. Do not give SDD an advantage for features that were not included in the specification.


Part 3 - Compare the Results

Complete the table with data from both runs:

Aspect Direct prompt SDD with a ready specification
Model used    
Implementation time    
Credits consumed during implementation    
Questions during the run    
User interventions    
Requirements met    
Errors or rework    
Qualitative UX assessment    

Three Dimensions of Analysis

  1. Effectiveness: did both applications meet the same requirements?
  2. Implementation efficiency: which approach required less time, fewer credits, and fewer interventions after its input was ready?
  3. Full-cycle efficiency: does the result change when the cost of preparing the specification is included?

The total SDD time and cost must be calculated as:

\[T_{SDD\ total} = T_{specification} + T_{implementation}\] \[C_{SDD\ total} = C_{specification} + C_{implementation}\]

Do not mix these two perspectives. A ready specification may speed up implementation, but preparing it also has a cost.

Success Criteria

After completing the challenge, you should be able to:

Reflection Questions

  1. Did both approaches meet the same functional requirements?
  2. Which approach required more decisions during implementation?
  3. Did the specification reduce ambiguity, or did it only move decisions to an earlier stage?
  4. How much time and how many credits were used to prepare the specification?
  5. Does the result change when that cost is included?
  6. In which situations could the specification be reused and offset its initial cost?
  7. Would a larger application or a later requirements change produce the same result?

Experiment Limitations