4 ms·
Ask HN: Help me start using test-driven design and development “in anger”
I've been programming a long time, so I'm not a novice and writing code from a blank screen, making it work, and deploying it in the real world. But I was around before things like "testing frameworks" and "Unit Testing Libraries." As a result I really don't know how to get started, "properly," with TDD.
Where do I start? What tutorial should I work through?
For the purposes I would guess the language I'd have to start with would be Python.
Help?
- i0nutzb 11y agoIn order to do efficient TDD, you need to be fairly familiar with the SOLID principles. I saw at least one book on O'reilly about TDD-ing in Python, but I can't really tell how good they are, since I don't do Py myself: http://chimera.labs.oreilly.com/books/1234000000754 http://chimera.labs.oreilly.com/books/1234000000754 However, if you are willing to invest few hours for watching TDD in other languages, I could recommend you these stuff: 1) https://code.tutsplus.com/courses/solid-design-patterns https://code.tutsplus.com/courses/solid-design-patterns 2) http://www.jamesshore.com/Blog/Lets-Play http://www.jamesshore.com/Blog/Lets-Play 3) Clean Coders Series ( http://cleancoders.com/ http://cleancoders.com/ ) - there are only few episodes strictly on TDD, but there are a lot of how and why on design patterns, principles and so on. (I'm doing PHP/JS, but I found Clean Coders - mostly Java - very helpful) I just found this: https://code.tutsplus.com/tutorials/beginning-test-driven-development-in-python--net-30137 https://code.tutsplus.com/tutorials/beginning-test-driven-de...
- 271441 11y agoThanks - I'll check them out.
- sheraz 11y agoI feel you. Only last year did I really embrace testing. But I did it from what I call "outside-in". That is, I started with acceptance tests and then worked my way down to unit tests. Search for "Accept Testing Driven Development." Mostly my tools are Selenium for single page web apps that and codeception (php) for testing my APIs. I find this method works well for me because it helps me to find the areas that actually needed the most testing. I didn't spend time writing unit tests for areas of code that were used only 1% of the time. Also, it gives me a better understanding of how to bootstrap the entire infrastructure, which helps for setting up different environments (dev, staging, production).