When first being introduced to TDD (Test driven development) I was in class with my group. we all had the same feeling, this feels like were doing everything backwards!
We had been used to writing semi-clean code and then testing for it afterwards. Which in our inexperienced minds made perfectly good sense. Write some code. Then test that code.
However, after doing an assignment for class we started to realize the power of TDD. We were able to better organize our thoughts and methods before writing the code. A couple of us agreed that it kind of felt like having pseudo code and being able to write TESTABLE code was a skill. Lastly, when it came to refactoring things. We never had to rewrite entire tests, and we already had tests to work with to ensure our changes were working properly.
Some helpful resources:
https://stackoverflow.com/questions/14891967/understanding-stubs-fakes-and-mocks
(explains some of the terms needed)
https://junit.org/junit4/
(examples to follow for JUnit)
From the blog Mikes CS Journey by Michael St. Germain and used with permission of the author. All other rights reserved by the author.