Importance Of Test Driven Development

770 Words2 Pages

Kushagra Sharma, 1206289184, Ksharma9@asu.edu
Assignment 4
Test Driven Development
The Test first development technique where the test is written before the code. One view of the technique is that it helps understand the requirement better and is not so much about validating the requirements. The basic idea is that the code once written should validate all the requirements which is achieved by a process just reverse to the conventional approach. This section covers the importance of TDD, how to put TDD in practice and the references which provide standard view of the approach.
Importance of TDD
1. The final or resulting functionalities can be delivered with ease since the code is being developed with smaller fragments and thoroughly tested. So the resulting implementation does not tend to be complex. [1]
2. The time required for product development is significantly reduced as well. One need not wait for the end to test the whole functionality. The same has been tested in bits and pieces all the way.
3. Since after every set of tests the code is being developed to pass them, the regression [1] tests actually are conducted on that piece of code. The code is written in such a way so that it can be delivered as is, so the reviews at the end tend to be a lot easier. The approach gives the code a modular view and the final code reviewer can make a sense of each module being developed.
Training Objectives/How to go about TDD
1. The initial step is to make a test and add it to the test suite. The primary motto is to make the code fail and pass after making certain changes to it. After the case has passed, another set of tests are being added and dealt in the same fashion one at a time. So one requires basic understanding of ...

... middle of paper ...

...ex methods with a large pool of data which would be nothing but the stress testing of the application developed.
9. The best practices for developing such test methods should be strictly followed for eg. in [4] it is clearly mentioned that methods should not accept any arguments and should not be committing changes to any attribute in the database.
10. JUnit test cases which use methods like assertEquals(), assertSame() makes use of the objects and not the parameters in function to determine the value being returned. So the basic framework of how JUnit test cases work should be part of the training program.
References
[1] "The advantages of test-driven development", Kevin McConnell
[2] "Driving Development with Tests: ATDD and TDD" Elisabeth Hendrickson
[3] "Test Driven Development – Part I: TFC", Venkat Subramaniam
[4] “How to Write Good Unit Tests”, Force.com

More about Importance Of Test Driven Development

Open Document