I understand the concept of Unit Testing as coming up with simple ideas about what your code should output – then outputting it. So it’s thinking about what you want a piece of code to do – then making a test to ensure it works.
At which point in learning programming should TDD (unit testing) be incorporated?
Edit: I liked the comment about unit testing as soon as the tools to do it stop becoming magical.
Originally the question came about because I realize I don’t have the skills yet to develop a large program, but would like to learn by coming up with ideas for what some piece of code could / should do.
I’m wanting to get into learning by doing and I figure a structured way to do this would help. Python is the language I’m using. Thanks for all the input thus far.
Unit testing is a huge time saver when you’re starting out, because you end up doing a lot of “code, run, debug” cycles while learning. It’s that “run” phase that becomes a time suck when you’re doing it ad-hoc every time. Also I think beginners tend to introduce more regression problems, which is another huge time sink if you don’t catch them right away with a unit test.