How to name our Unit Tests
Connection - 10'
Imagine we want to test this method :
Here are the associated requirements
How would you name your first test ?
Ask attendees to note on a Sticky Note what is the name of their first test
Compare the different styles
What do they prefer (Dot voting)
Concepts - 10'
Tests names v1
Is it readable ?
What is the intent ?
Tests names v2
Is it more readable ?
What is the intent ?
Tests names v3
Intent is more clear, isn’t it ?
Tests names v4
Express what the class should be able to do
Read it as a full sentence : express a true business specification
You should avoid technical terms
Concrete Practice - 30'
Choose a Kata on Coding Dojo
Extract the Test Cases you want to write
Define the structure and naming of your tests
Conclusion - 10'
Imagine you use this naming technique during the next 6 months :
What has changed ?
Who else have noticed those changes ?
What are the impacts on your day to day ?
Resources
Last updated