I believe all code written via TDD should be the best code that I'm able to write. There's really no excuse other than laziness for leaving your code sloppy or hard to understand when it is written using TDD.
One of my students used the phrase Refrigerator Code to describe what I was talking about. What's that' It's code that you're so proud of that you want to take it home and hang it on the refrigerator, right alongside of your children's drawings.
I like this idea from ArticleS.BobKoss.RefrigeratorCode. With my latest work on ScoreboardFeed, I've really tried to start adoption all of these new ideas. At work, I preach them but I don't get a chance to practice them so this project has been a great chance for me to get back into coding.
I like that TDD is integrated into the rules for Simple Design:
- All the tests pass.
- There is no duplication in either the code or in the tests.
- It expresses my intent.
- It minimizes the number of methods and classes.
TDD is still tough to do. But I'm trying.