2 ms·
TDD is applicable to anything. C, C++, Java, Rust, ... If you're touching the code in any way, there must be a way of writing a test which fails if you don't t
by kazinator 2y ago
TDD is applicable to anything. C, C++, Java, Rust, ...
If you're touching the code in any way, there must be a way of writing a test which fails if you don't touch it in that way and then passes if you do.
It's not necessarily just about ensuring correctness of new changes.
What if you're wasting your time with that change? I.e. the test you want to pass after your change, maybe it passes already, so the change is useless. If you write it first, you will know.
The TDD test is itself compiled, and so the language features/checks help write the test. Then, if the proposed change doesn't compile, that's a fail? The compiler is helping again.