DEV Community

Discussion on: When TDD doesn't click, something else should click "harder"!

 
mike_christian profile image
Mike Christian

It is also red when the test simply fails.

Thread Thread
 
vdedodev profile image
Vincent Dedo

Oh, that changes everything. I understood TDD as starting with a test case that fails its assertions only and getting the function set up properly beforehand (mocks, injected dependencies, etc.) was the difficult part. If it's just getting the task requirements in as test cases at the start, that's what every single TDD explanation is missing.

Thread Thread
 
mike_christian profile image
Mike Christian • Edited

Oh, that is terrible news! I highly recommend looking into Roy Osherove's book, "The Art of Unit Testing", which is fantastic. Bob Martin also has some good TDD information, but I recommend reading his "Clean Code" book to get a look at how to better organize code, which is essential for good TDD. I genrally start my students (generally very junior developers) with these two books.

You can immediately find beneficial help by looking up some "Red Green Refactor" kata videos. Pluralsight may also have something useful.