Test-Driven Development (TDD) involves writing a failing automated test to specify what is to be built. The test is then made to pass by writing code which satisfies the tested condition. Finally, the code is refactored.
Test-Driven Development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to remove duplication and to improve its design.
TDD tends to lead to low-coupled, highly-cohesive designs, with no more functionality than necessary to satisfy requirements. The test serves as the first consumer of the new interface, and provides immediate feedback on its clarity and usability. Developers give themselves an incentive to write easily testable, stateless, simple modules; all hallmarks of good design according to the SOLID design principles.
It is one of the practices of Extreme Programming. It is often said that TDD is not about testing, but rather about design.
Hello World:
def test_hello_world
assert.are_equal "hello world", hello_world
end