Why write test at all ?

Depending on what our ultimate goal for testing our code is, we might need to apply one of the following techniques:

Goal Technique
Designing software components for your application (units) Test Driven Development (with unit-testing)
Finding bugs (usually after our application’s code has been written) Manual Testing
Verifying functionality, performance, reliability as well as detecting regressions Integration Testing