TDD Legacy Code

Learning to TDD Legacy Code

Many people have "Legacy" code bases... What does that mean... Legacy code is any code written that is NOT tested - automaticly upon check-in. So let's face it - we've all written some legacy (untested) code.

Learning to correct this deficite is a process in TDD.

This episode of TDD Academy will dive deep into the legacy code of InspireMe! Cards App and test the randomCard method of the Deck.

Lancer Kind walks me through his process - and introduces the Reverse TDD method. Leaving me with homework to continue the learning. We test a RANDOM method! Which is mind-blowing... for a simple pig like myself.

He helps me create a DeckPartialMock internal class to a test method... that returns 23 for the randomCardIndex() - finaly control over the random nature of the universe.