How to name our Unit Tests
Last updated
Was this helpful?
Last updated
Was this helpful?
Imagine we want to test this method :
Here are the
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)
Is it readable ?
What is the intent ?
Is it more readable ?
What is the intent ?
Intent is more clear, isn’t it ?
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
Extract the Test Cases you want to write
Define the structure and naming of your tests
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 ?
Choose a Kata on