3 ms·
A couple of things to mind when talking about TDD. 1. Tests can be unit-test, integration-test, e2e tests. Don't limit yourself. 2. TDD is a technique. Depend
by je42 7y ago
A couple of things to mind when talking about TDD.
1. Tests can be unit-test, integration-test, e2e tests. Don't limit yourself.
2. TDD is a technique. Depending on the problem and your experience it might not be the right one to efficiently get you a working program and a good test suite.
Remember there is no free lunch.
3. Also, if you have never successfully applied TDD: Please stand stil for a moment. Some techniques require practice and TDD is one of those.
You need to invest time in order to use it efficiently. Once you do it, you will be faster and deliver higher quality code for a large set of programming tasks.
4. There are tasks where i don't use TDD. However, I usually go back to it as soon as I can. You can switch between the two techniques. There is not one way that is most correct.
5. Also, note: if you don't write tests first. Writing tests after the code is complete is more difficult. You might need to adapt your code to make it testable.
6. If you write tests afterwards, usually you will accidentally omit tests for crucial cases if you are not careful. I use line coverage and branch coverage tools to help me when I don't develop test driven.