TDD and professionalism

Common questions: until when do I refactor ? When do I stop refactoring ?

mmm…

TDD

First, I design/write a test, then I green it as fast as possible, then I refactor my code. When I make the code pass, I’m “authorized” to write any crapy code I need to green the test (yes even copy/paste code).

When I refactor I make the code ready so that I can green the next test very fast. In real life, I might not even know what the next test will be. Remember that coding-dojos are about practicing to take advantage of this practice in the “real world” where uncertainty is the rule. Ideally, I refactor to be ready to welcome …anything. “Welcome change even late in the development” should remind you something. Gosh, this seems hard. Yes it is, we are professionals, our art is difficult. Stop refactoring when you are ready to welcome change, when you trust that your velocity will stay stable.

When I design/write test, I’m identifying what I need from that software. In real life, I might have to collaborate with a customer (!) to identify what we need to build. He/She might be very unclear about what he needs. When we know in our brain what we need, we identify maybe a list of tests, we write a test, designing at the same time the architecture that we need. Gosh, this seems hard too. Yes it is, we are professionals, our art is difficult.

When I code, I can write crappy code. It does not seem very professional.

We probably act more like a Professional during the Test and Refactor steps than in the Code step.

What if software developers were hired for their ability to write tests and refactor code, rather then for their ability to write code ?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.