- start by writing a test for new functionality
- see it fail
- make it pass
- refactor
- round and round you go
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMnyMwj5CpOGRPNEKHdOnps2ScaD45rHez8lxUsBukE-KSuymZNDjV61bMXik8gaf5F1vsqD4IX244y4u2tGHb5SNQDdovbzAz2eUs6EBTWq2LTP9qklOdrbnlSZXcz2YVj_k/s640/Screen+Shot+2014-10-24+at+08.04.11.png)
But there's something not right!
There's no red-to-red self-transition.
My animal is missing an ear!
I'll add the missing ear.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGivaFLCV0b4ZoqXKQybpdpX6xH74ZqOvZtjJLus5sWlZ1yTuJzH-U94biN7iP9b42fvYeqJdUBlttjgcBRsiRnns_rzbbFDszNplxK_WT7Kc7x1K4eagFeOwt6JpHWeq1CLYA/s640/Screen+Shot+2014-10-24+at+08.04.28.png)
What is this new ear?
It's for changes made at red.
I see the test fail.
I read the diagnostic.
Then I stay at red and improve the diagnostic.
When I'm happy with diagnostic I get rid of it by making the test pass.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQScfmYzNtAFlbi2KyvEtcY96fBITAGIMN-o9_u7tF8HIKc6_1QbW4Kw_zrdm8iVVJ_d75CjyzApGg_jUcwATmTmnr4JKavSOPE7YLTHMxAkErrdBGrCO9QCnMZdx_aKRH2ml4/s640/Screen+Shot+2014-10-24+at+08.04.38.png)
This was part of my lessons from testing presentation which reviews common test anti-patterns I see on cyber-dojo.
Note: I'm being careful not to call this red-to-red transition a refactoring since refactoring is for changes made at green.
I suppose the "smiling" arrow in the middle should say "see it fail"...
ReplyDelete