Just like you mentioned, I use TDD only when I know every possible outcome before hand. Eg. in domain logic.
With integration or UI/end-to-end tests, my goal is generally to avoid regression, so I write few broad tests after the code has been written. The tricky part however is ensuring that these tests fail when they should -- I find it hard to tell if there are false positives without TDD.
Like you write application code and need to refactore it if requirements change, you need to redactore unit tests too. However I you have good unit test suite and you realize that part of code can be refactored to something better, with unit tests you will quickly figure out if you broke something during refactoring, or everything works as it should and all of that without manual clicking and "quickly testing" by hand.
Just like you mentioned, I use TDD only when I know every possible outcome before hand. Eg. in domain logic.
With integration or UI/end-to-end tests, my goal is generally to avoid regression, so I write few broad tests after the code has been written. The tricky part however is ensuring that these tests fail when they should -- I find it hard to tell if there are false positives without TDD.
Exactly... the worst part is that you never know in future whether new requirements are gonna make them red or not.
I'll discuss those in the coming article and what approach is actually suitable for such cases.
Like you write application code and need to refactore it if requirements change, you need to redactore unit tests too. However I you have good unit test suite and you realize that part of code can be refactored to something better, with unit tests you will quickly figure out if you broke something during refactoring, or everything works as it should and all of that without manual clicking and "quickly testing" by hand.
Yep but TDD isn't the answer for quick refactor, maybe something else can be better, more descriptive, and more time-saving.
actually it is... ¯\(ツ)/¯
I know how it feels @vbjelak
Have a look at this great video: youtube.com/watch?v=qkblc5WRn-U
It's a good start ;)