For a very long time I was told that tests should not influence the production code. By this I mean, that we should not change our design only in order to be able to test it. That was quite OK for me, since - you know - test are only tests - the production code is what matters and what drives the design. Tests should just shut up and follow. Right?
Lastly I am flipping the bit
and diving into TDD and I must say - this is quite an adventure. At the
beginning I was like a babe in the woods. It was not easy to start.
Everything was harder - writing code, designing, thinking... I had to
firstly write a test, and then the code - everything was upside down - I
didn't even have the code to test. Damn! I started to think about
basics again, and that... was really refreshing!
day I was given a task to figure out changes in history lines of some
objects and update the meta-data for each line accordingly - with ids of
objects that were changed. For the simplicity of the example let's
assume, that those objects were rectangles and I was interested only in
Let's use an example:
The task was not that hard and my very
first thought was to create some meta-data generator that would accept a
list of Lines and update each of them. Sounds easy, doesn't it?