-
-
Notifications
You must be signed in to change notification settings - Fork 5
Todo list TDD tutorial
Greg Bowler edited this page May 9, 2026
·
2 revisions
- Doing the todo list tutorial again, but this time tests are written first.
- The implementation will be skipped over, because it's already shown in the original tutorial.
- Good rule: do not write any code until there's a failing test ready for it.
- Then, write the smallest amount of code possible to satisfy the test.
- Then repeat - trying to cover all edge cases.
- When complete, the software will be bulletproof, new features will be easy to add without regressing functionality.
- No need to test that a
TodoItemclass can be constructed, or that its properties are the correct value - that's pointless. - First test: the todo list should be empty by default - easy to test.
- Next: requesting a todo item by ID should be null.
- Next: after creating a todo item, it should be in the todo list.
- Next: after creating a todo item, it should be retrievable. Then it should be editable, and the next retrieved todo item should have the changed content.
- Next: toggle complete status.
- Next: delete items.
- Next: entire functionality complete, but this time functionality is provable.
- Introduce Behat browser testing.
Move on to the next tutorial: [[address book tutorial]].
- File-based routing
- Page views
- Page logic
- Dynamic URIs
- Headers and footers
- Custom HTML components
- Page partials
- Binding data to the DOM
- DOM manipulation
- Hello You tutorial
- Todo list tutorial
- Address book tutorial WIP
- Blueprints
- Application architecture
- Coding styleguide WIP
- PHP environment setup WIP
- Web servers WIP
- Background cron tasks
- Database setup WIP
- Client-side compilation WIP
- Testing WebEngine applications WIP
- Production checklist WIP
- Security WIP