Test Case

Who can tell me the difference between TDD and traditonal test case? I want to know why TDD can drive development, but test case can not. Thanks.

When a Unit Test fails, it implicates only one unit of the code. When a TDD Developer Test case fails unexpectedly, it implicates the most recent edit. This gives you the option to Undo that edit, and revert the code back to the last state where all tests passed.

Replacing hours of debugging with briefly hitting the Undo button is priceless. And it is just one of Test Driven Development's many efficiencies.


A test case is a series of tests used to determine whether one particular thing works properly. Often, that means trying the same operation over and over again with little in the procedure.

Each test case (one member of a Test Suite) follows the pattern Arrange Act Assert/Assemble Activate Assert.


A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of an application is working correctly. A test case should contain particulars such as test case identifier, test case name, objective, test conditions/setup, input data requirements, steps, and expected results.


Note that the process of developing test cases can help find problems in the requirements or design of an application, since it requires completely thinking through the operation of the application. For this reason, it's useful to prepare test cases early in the development cycle if possible. -- shyam

A test case document is also a Living Document. It is true that there is a benefit from developing test cases early in the design and development cycle; however, a test engineer can find more ways to produce bugs in software once he has a product in front of him. -- Meteorman

It will be better if test cases are prepared based on the design. -- Manoj Kr. Sheoran

Test Case is also the name of the primary interface to the Star Unit series of unit Testing Frameworks. It contains methods to set up and tear down a test fixture, and a list of tests to be run, each from within a pristine fixture. A Test Suite can be used to run all of the tests in a Test Case. Due to the Interpreter Pattern, each Test Suite in *Unit is itself a Test Case, while the terminal test cases are the testing functions themselves.

(This leads to a peculiar confusion, endemic to all the *Unit communities, that "test case" means a list of test methods. It does not. It means the single method in a Test Suite class - the one named "test_*".)


See original on c2.com