> Is unit testing or test-driven development worthwhile?
Is unit testing or test-driven development worthwhile?
Definitely yes (see the other answers)
> [Is it] really a good idea and worth the effort and time?
[Is it] really a good idea and worth the effort and time?
- Yes if you start something new (add a new module or a completely new application)
- No if there is already a lot of existing code that was not developped testdrivendeveloped test-driven and that must be extended (legacy).
In my opinion test-driven development is most effective if you write the unittestsunit tests before the actual code. this way the code that fullfillsfulfills the tests becomes clearly seperatedseparated with a minimum of external references that is easy testable.
If the code already exists without the unittestsunit tests there it is usallyusually a lot of extra work to write the unittestsunit tests afterwards because the code was not written for easy testing.
If you do tddTDD the code automatically is easy testable.