SPEC INDIA Implemented Test Driven Development(TDD)

What is TDD?

TDD means Test Driven Development. It is a test first development where developer writes a test before writing actual code. It is a development methodology where developers create software by first writing a unit test, then writing the actual system code.

Why TDD?

A) TDD is focusing on the specification and not on the validation. It ensures that what you code actually going to do. So you are focusing on specification.
B) As developer point of view testing is always a boring task.
C) It is a programing technique. So developers can easily write tests in various languages like C# .NET, VB.NET, JAVA
D) Decrease debugging time.

Structure of TDD

TDD follows a cadence of “Red, Green, Re-factor.”. Red-Green-Refactor implies less time spent on debugging.

a) Red refers to a failing test – the test you write first will not pass because you have not yet written any code for it.

b) Green refers to the step of writing just enough code in your system to make your unit test pass.

c) Re-factor refers to the step of refactoring your code so it is tighter, cleaner, and more flexible.

This cycle is repeated constantly until it passes the test.

Test Driven Development
Test Driven Development

Work flow of TDD

The following are the work flow of TDD.

1. Requirement identified.
2. Write an automated test.
3. Run tests and make sure new one FAILS (RED).
4. Write some code.
5. Run tests to make sure all PASS (GREEN).
6. Refactor.
7. Repeat.

Pros – Advantages

1. Tested Code is written and test automation is easily achievable from the beginning of project.
2. Less time spend on debugging.
3. Improve Code quality.
4. Reduce number of bugs.
5. No additional time for regression testing.
6. Decreases maintenance costs because the code is easier to follow.
7. Writing tests first makes developers to think more about value before starting to code.
8. Breaking changes in business rules easily detected without doing any regression testing.

Corns – Disadvantages

1. Tests can’t be tested! so review is essential for the tests.
2. A large project may include a lot of tests that take considerable time to execute.
3. When modifying any business logic, the related test cases have to be maintained.
4. Designing test cases in a mulch-threaded environment is very difficult.

SPEC INDIA is an ISO 9001:2015 global outsourcing software development company based in Ahmedabad, India, which is having 26 years of vast experience in providing custom IT solutions. We have more than a decade of experience in application development. Domains of expertise to develop custom software application, database services, legacy application migration, application interface development using various technologies.


Leave a Reply

Your email address will not be published. Required fields are marked *

Guest Contribution

We are looking for industry experts to contribute to our blog section through fresh and innovative content.

Write For Us

Our Portfolio

Proven Solutions Across Industries
Technology for Real-Life

Visit Our Portfolio

Scroll Up