Md. Adil Akhter's Weblogs

Me, My Thoughts and My Journey ....

TDD - In a Nutshell

"One Picture's  Worth Thousands Words"

 image

 Benefits( from my personal experience):
1. Development can be done much quicker. You already jot down all the test cases before writing codes. By that way, you are giving much time in thinking how to solve problem. Codes become much more standard and organized because of the brainstorming.
2. Quality of code is far better and deterministic.
3. Tests are the first class document for how your code will eventually work. Any developer/tester can go through the test cases you covered and get the idea how the system should work in different cases. J Isn’t it too cool ?
4. Easier and risk free to change the code - you just need to run the tests, you will get to know where there might be some problem. 


And so on...

 

Comments

Webdiyer said:

Is there a large image?

# April 19, 2008 8:14 AM

Adil Akhter said:

Check out the attachment.

/Adil

# April 19, 2008 3:31 PM

Jacques Marques said:

Hello,

Is the "New test is Failing?" flow correct?

When the answer is no its return to "Write a Test..." and if yes its follow to "Add/Update Code".

It should not be the opposite?

Thanks,

# April 23, 2008 1:12 PM

Adil Akhter said:

Hi Jacques Marques,

Thanks for visiting the Blog.

Actually in TDD, the basic idea is to Add a test (actual codes might not be  there) and run the automated test and to see whether its failing. If it’s failing then write codes to make it pass. This way, incrementally, development is being done. That’s what I tried to map in the diagram.:)

One point is to be noted – If a new test is added and by itself it’s passing without changing any codes, then there might be something wrong with the unit test or that test is already covered by the code.

I hope that answer your queries.If you have any comments, please feel free to give me a buzz.

/Adil

# April 23, 2008 3:19 PM

Md. Adil Akhter's Weblogs said:

I n Test Driven Development  as a developer we spend significant amount of time in writing unit

# May 4, 2008 6:24 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)