The Pomodoro Technique and TDD
If you are a programmer you know time management issues are an inherent part of the job. Programming requires creativity. However, to tap into this creativity most programmers strive for a state of flow to help them get ‘in the zone’. This feels like the most productive time. Inconveniently, a good programmer is often involved in many other tasks:
- Meetings
- Support Issues
- Pre-sales
- Interviews
- Timekeeping
- More Meetings
The Pomodoro Technique.
The Pomodoro Technique is a time management technique that is especially useful for busy people. Here is a breakdown:- Do 25 minutes of focused work. This time period is called a 'Pomodoro', named after the kitchen timer shaped like a tomato.
- Take a 5 minute break.
- Repeat
- After every 4 Pomodoros – take a longer break.
TDD and Baby Steps
Time-boxing a coding session into 25 minutes can be difficult. This is where using Test Driven Development can help you get real code written in a short length of time. In short, TDD follows a very simple cycle known as the 'Red-Green-Refactor' cycle. After deciding on what test you would like to write do the following:- Write a failing test (Red)
- Write the implementation to make that test pass (Green)
- Refactor the code, for simplicity (Refactor)
- Repeat
Pomodoros and TDD Together
The Pomodoro Technique and Test Driven Development pair together well for programming efficiency. Test Driven Development using Baby Steps allows a programmer to code small chunks of releasable code within a short time period. The Pomodoro Technique allows for frequent, but structured, interruptions throughout your day. When you learn to plan your coding effort in terms of Pomodoros, you can maintain your focus during each Pomodoro. You create the illusion of successful multi-tasking, when in reality you are focusing on only one task at a time.For More Information
- Pomodoro Technique: http://pomodorotechnique.com/
- Test Driven Development: http://en.wikipedia.org/wiki/Test-driven_development\
- Code Retreat: http://coderetreat.org/
- Clean Code: http://www.cleancoders.com