Today, I am here to talk about what test driven development is and why it’s important along with the related concepts.

Let’s start by putting some questions to understand the concepts.

What Test Driven Development is

Why Test Driven Development is important

Unit Test cases

Unit Test cases are coded to test specific aspects of a functionality. They are created to test positive, negative and exception scenarios. They are independent with other tests in terms of scenario and execution order.

Real-world scenario

TDD is critical especially if the working team is on several modules in tandem and there is a dependency of one module on another.

The image given below depicts why TDD is important when any developer removes the code and realizes later that it broke something else. In this case, if we have TDD, after any change and build, test cases would be examined to make sure that nothing is broken.


Source: Internet

The images given below illustrate how early detection of the issues are important as far as cost is concerned to fix the issues at later stages.


Source: Internet

Now, let’s talk about why, if TDD is so great and awesome, all of us are not using it. Some possible reasons are given below.

Lifecycle of TDD

The images given below depicts the lifecycle; TDD goes through. Typically, it starts with writing negative test cases, then it keeps refining and refactoring the code until it passes.


Unit Test Frameworks

There are several frameworks available, however following are popular.

Conclusion

In this article, i.e. the first part of TDD, we have looked at what Test Driven Development is and why it’s important. In the end, we have also looked at its lifecycle and available Frameworks. In the next part, we will look at how to use TDD with Visual Studio.

Next >> Test Driven Development: Part 2

I hope you liked the article. I look forward to your comments/suggestions.