Making friends with TDD!

What is TDD, btw?

*Drumroll*- TDD stands for Test Driven Development! TDD is a development approach which uses test-first development. When you follow TDD as a programming technique, you need to write a test before you write just enough production code to fulfill the test and its refactoring.

This was me a few years back! I mean seriously, who writes test-cases! Why do we have testers in the first place then!

But that’s not how the world seems to work 🙁

When you dwell further into the aspects of programming you realize that how important the test cases really are. Testing or Unit Testing is an integral part of any development cycle. Simple as it sounds, TDD is writing a test case and then writing as little code as possible to make the test pass, followed by some refactoring if needed. See! How simple it is.

So, someone might ponder, what is a test or a test case! Let’s discuss it then!

All Hail the “Test Case”

test case is a set of test inputs, execution conditions, and expected results developed for a particular objective, such as to exercise a particular program path or to verify compliance with a specific requirement. A test case could simply be a question that you ask of the program. The point of running the test is to gain information, for example whether the program will pass or fail the test. Test cases are the cornerstone of Quality Assurance where they are developed to verify the quality and behavior of a product. (Source: Wikipedia)

Do you feel betrayed, don’t you? Worry not!

Allow me.

Putting it in simple words, a test case can be considered as the smallest and the simplest form of requirement. Let say you have an application to develop. So every application will have numerous requirements. For example, the application has a sign-up page and for sign-up, you need to a have an email and a password field. Now for the password field, you’ll need to have some validations. One of the validations is the length of the text. So what would your test case be? Any guesses? Yes, you’ll check whether the length is more than or equal to the required length. Simple right? We’ll that’s your first test case.

Now, you might see that are a lot of things happening, worry not. We’ll discuss this in detail. Follow me!

The post, in order to make it more readable, has been further divided into two parts.

See you there then!

Peace ✌

Please follow and like us:

Leave a Reply

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