Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shift your paradigm to test-driven development

Tags:

tdd

I've had been hearing about test driven development for a couple years now, and I never really paid too much attention to it from a practical level until recently when I started getting more interested in the .NET MVC. I've been playing around a lot with the MVC Storefront Sample, and I am realizing just how cool and helpful that the test driven approach can be. However, I've been programming using a "test last" approach for a long time now, and when it comes down to business, I can always best estimate my effort with the approach that I am most familiar with.

I'm guessing that learning how to use the test driven approach is less like learning another programming language, but more of a change in how you approach laying the framework for, and planning the requirements for building an application. I don't think I could just pick up a book and start a project for one of my clients using TDD, I'm guessing my introduction to it need to be more methodical.

What is the best way for me to shift my mind-set of planning to build an application so I can become effective with test-driven development in the shortest amount of time?

like image 555
matt_dev Avatar asked Nov 25 '08 17:11

matt_dev


1 Answers

You can still test last. It's okay. We'll forgive you.

Learn how the unit test tools work in your current language.

Start writing unit tests for whatever you're working on now.

Eventually, you can move to code-a-little-test-a-little. Then test-a-little-code-a-little.

Pure test driven development is an ideal. Pragmatically, most folks test-a-little-code-a-little. More like test-steering or test-guided, rather than test-driven.

Start now. Test anything you have at hand.

like image 105
S.Lott Avatar answered Sep 19 '22 20:09

S.Lott