Now that we've built our To-Do List application, it's crucial to test it thoroughly. Testing ensures that our code behaves as expected and catches any bugs before our users do. We'll approach this by manually testing each core functionality and considering edge cases.
Our To-Do List application has several key functions we need to verify:
graph TD
A[Start Testing]
B{Add a Task}
C{View Tasks}
D{Mark Task as Complete}
E{Remove a Task}
F{Empty List Scenario}
G{Duplicate Task Scenario}
H[End Testing]
A --> B
A --> C
B --> C
C --> D
C --> E
D --> C
E --> C
C --> F
C --> G
F --> H
G --> H
Let's walk through the testing steps:
- Adding Tasks: Start by adding a few tasks. Check if they appear correctly in the list. Try adding tasks with different lengths and characters to ensure flexibility.
add_task('Buy groceries')
add_task('Schedule dentist appointment')
add_task('Read Python book chapter')
view_tasks()- Viewing Tasks: After adding tasks, use the
view_tasks()function. Ensure all added tasks are displayed with their correct indices and completion status (initially 'incomplete').
- Marking Tasks as Complete: Try marking a few tasks as complete. Use their corresponding indices. Then, call
view_tasks()again to verify that their status has changed to 'complete'.
mark_complete(1)
mark_complete(3)
view_tasks()- Removing Tasks: Remove some tasks using their indices. After removal, call
view_tasks()to confirm they are no longer in the list. Try removing a task that doesn't exist to see how the application handles it.