Archive

Posts Tagged ‘NUnit’

Test-Driven Devlopment (TDD)

April 12, 2010 Leave a comment

Please don’t think that Test-Driven development(TDD) is relevent to Testing. Because the name suggest you to think like that. It’s absolutely far away from testing. Okay, keep reading and you will have an idea on TDD. Here i just describing it on the basis of some documents got from BASIS OOP training programs. i am lucky because i completed that course. Now i am going to explain

what is Test-Driven Development :

Is a Test-First approach (Write the test-code first and then write the dev-code)
It leads to think about ‘How to use a component’ first and then about ‘How to implement’.
As much about design technique as testing TDD technique.
As much about (executable) documentation as testing

so, that’s the summary of TDD. TDD is about writing the development code through test code. At the very beginning we there are some story(User Story) and depending on those story we  will implement. So from the story we should find out the components and then implement the application on those components. please don’t write any code by thinking  what will happen in future? Then you are not in TDD. Because TDD insists to write exactly what we need not what we will need.Thsee are almost the principle of TDD.

Principles of TDD

Kent Beck defines:

• Never write a single line of code unless youhave a failing automated test.
• Eliminate duplication.

Red (Automated test fail)

Green (Automated test pass because dev code has been written)

Refactor (Eliminate duplication, Clean the code)

well  those are the principles of TDD. Think, you are yet confused. Trying to make it clear.

Actually  Red/Green/Refactor defines the process for implementing each test in the test list. The goal of this process is to work in small, verifiable steps that provide immediate feedback. William Wake, in his book Extreme Programming Explored (Addison-Wesley, 2001), details the programming tasks as follows: Read more…

Categories: Software Crafting Tags: , ,
Follow

Get every new post delivered to your Inbox.