2 ms·
I've done TDD-like changes (not full blown TDD methodology) on legacy code bases. The main idea of writing a test which fails and then fixing it with the code
by kazinator 2y ago
I've done TDD-like changes (not full blown TDD methodology) on legacy code bases.
The main idea of writing a test which fails and then fixing it with the code change applies almost anywhere.
E.g. when fixing a bug, write a test case that fails because of the bug, and passes due to the bugfix.
You don't necessarily need the refactor step, though. The continuous refactoring is the greenfield aspect, perhaps.
Refactoring can leave a trail of TDD tests that used to be independent, but are now tied together and redundant.