Ask HN: What resource do you recommend to start with Test Driven Development?
I&#x27;ve never been able to get my head round the concept of Test Driven Development.  Maybe it&#x27;s because, every time I&#x27;ve seen an example of it [which, like the one you linked to] are usually aimed at explaining the concept, they seem like a lot of extra work for questionable benefit.<p>For example: I&#x27;ve got some &#x27;multiplying&#x27; code that should return 4 when passed 2 and 2 so I&#x27;m advised to write an &quot;assert&quot; test that returns 4 when I send it 2 and 2. But what happens if I send it just 2?... or 2 and 2 and 2?... or 2 and 3?... or 2 and W? None of the examples of why it&#x27;s so vital to write tests ever seem to cover this kind of thing? They just seem to show a test which returns the correct answer when given the correct data. But aren&#x27;t many of the problems with software caused when a piece of code receives the wrong data in the first place?<p>Genuine question. I&#x27;ve read so many times about why I should practice TDD that I believe it in theory. But I&#x27;ve never seen a beginner&#x27;s example that has actually seemed like it would provide the claimed benefits.  Why is writing a test that takes one single specified input and checks for one single specified output &quot;better&quot; than just writing my code and then trying to break it by [metaphorically] hitting the &quot;Do Not Press!&quot; button, by throwing as much incorrect, malformed or otherwise &quot;wrong&quot; data at it, as possible.