Why test driven development rocks
All projects in Canonical have a strong focus on testing. From all of them, I think Bazaar ranks the highest on obsesiveness on testing. As a drive-by contributor, it always felt like a very high entry barrier, and deterred me from getting into complicated changes. It was only after I bit the bullet and got into more complicated changes (in Launchpad, actually) that I understood that tests where my best friends ever. It's a safety net against myself, and actually lowers the barrier, because I don't need to know about the rest of the code base to make a change, tests will tell me if I break something (seemingly) unrelated.
On the more extreme side, there is test driven development (TDD). You write the tests first, watch them fail, and then start producing the code that will get them to pass. Having co-authored bzr-upload with the TDD-obsessed bzr developer, Vincent Ladeuil, I thought that if I was going to add a new feature, I may just as well try it (again).
It rocked.
I set up the test, my carrot, and the task went from "start poking around code" to "fix this problem". With the test written, it became very clear what parts of the code I needed to change, and how the feature had to work.
The results? in one hour, I implemented a feature that lets you ignore specific files on upload. With tests.
Pages
Categories
Blogroll
Archive
- March 2013
- February 2013
- October 2012
- June 2012
- May 2012
- April 2012
- February 2012
- December 2011
- November 2011
- October 2011
- June 2011
- May 2011
- April 2011
- March 2011
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- February 2010
- November 2009
- October 2009
- July 2009
- June 2009
- May 2009
- February 2009
- January 2009
- December 2008
- November 2008
- September 2008
- August 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007