Better cycle time with Unit tests
What is cycle time: It is time needed to complete a function/task from start to finish. If some one tells you "you can complete the feature faster by writing unit tests" what will be your reaction. Probably you won't agree to it. It is counter intuitive for someone not initiated into TDD. How come writing more code, reduces total time for development? Let me start with the cycle of TDD. Write a test first. It will/should fail since there is no code which will make it work. Write code to make the test pass. Refactor to make the code readable. Repeat the process till you complete the feature. If you have observed a brick layer laying bricks. He will put little cement. Then he will lay the brick. Then he will adjust the brick to make sure it is laid right. This process is repeated till the wall is complete. If you take the parallel to software development then you should make sure each line performs as it is intended in the overall feature. As a brick layer will not put a...