In my experience, writing the tests just helps me think about the test cases so I don't have to go back and rewrite code when I think of something while writing it. In that way, it saves be a bunch of time and I've already got a test to make sure I caught that case.
Modern Dev Practices Unit Testing highPublished on Jul 3, 2017
In this episode, Robert is joined by Phil Japikse, who explores how in modern development practices, unit testing is part of the development process, not a chore to be tackled after you write your code.
Phil spends most of the time on Test Driven Development (aka Test Driven Design), where you write a test first and then write just enough code to pass the test and then refine the code as you add more tests. In TDD, the tests embody the requirements the code must satisfy.