Rearrange these story beats to see how Audrey learned that writing examples & tests early can prevent major headaches.
Audrey writes a function count_words with no examples or tests.
---
She notices weird results when the input string is empty or contains extra
spaces.
---
After hours of debugging, she realizes she never defined how the function
should handle those edge cases.
---
She decides to write clear examples first, then turn them into automated tests
using assert.
---
Now she can quickly catch mistakes for inputs like "" or "Hello world"
without guesswork.