Testing, testing, TDD
Last weekend I dipped my toes into the world of Test Driven Development (TDD). Knowing that this would be a big part of the course at Makers, I knew I’d have to get my head around it eventually - my only prior experience being the pre-written tests that appear in Codewars kata.
The basis of my intro was a workshop I attended courtesy of Queer Code, who host events for queer developers of all experience levels. The opening demonstration worked through creating a number to roman numeral converter in Java. Although my experience of Java is very limited, it wasn’t difficult to get to grips with the themes of the session:
- writing a failing test
- writing code to pass the test
- refactoring the code
After the demo we got stuck into doing our own testing. I utilised test/unit as opposed to Rspec as I wouldn’t have to install anything and instead immediately start on the testing. I just followed some examples and tested some arithmetic methods - I would share the website that I was shown but haven’t been able to find it.
Upon arriving home I still had the testing bug and worked through a tutorial from Women Who Code. This was an introduction to Rspec that, like my earlier testing, centred on some arithmetic methods. Whereas the earlier session provided a solid grounding in the business of testing, the WWC tutorial honed in on how Rspec worked making for a pretty well-rounded day of TDD.
Also, I was having a chic-wag with someone earlier who pointed out that there also a post about TDD up on the Maker’s blog.