We’re now into the second week of gSchool. It has been an intense six days thus far. The Jumpstart Lab crew has really thrown us into the deep end, expecting us to have completed five tutorials already. One more, EventReporter, is due at the beginning of day nine.
What we’ve already done:
This last tutorial was yesterday’s project. I was really excited to get into writing some tests. We talked about testing in class, and the consensus was that Test Driven Development did lots of good things for programmers. Some of the students’ explanations of testing included: it helps make sure the application is working, it helps guide the developer to the next features that need to be implemented, it describes the application. I am excited to start including it in my workflow, because all of the error-driven clicking and typing I’ve been doing up until now is getting really old.
Before bootcamp started, I worked through all of these tutorials on my own, and wrote my own copy of the Treebook tutorial on Treehouse as well. While completing Treebook, Jason Siefer walks you through a lot of TDD, first using MiniTest, and later Rspec and the Shoulda gem. Now that I’m digging into testing without the support of a tutorial, I’m trying to decide which syntax I like best for testing. Although it is the simplest, I’m not a huge fan of code like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
The syntax is just ugly, to me. I prefer this Rspec code I wrote for Treebook:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
I noticed last night that my fellow student, Katrina Engelstad, tweeted a link to this blog post by Matt Sears. It looks like a useful reference for MiniTest. Here’s a block of code from that page which shows a way to make MiniTest behave like Rspec:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
Finally, I’ve been tantalized by the possibilities of Cucumber. I haven’t had time to dig into this testing approach yet, but the prospect of writing language like this is very appealing:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
For now, even though I think it’s ugly, I’m going to stick to MiniTest for the “TDD with MiniTest and EventManager” and EventReporter tutorials, since I am still getting comfortable with TDD. Overlearning MiniTest will be a good foundation to have, even if I end up using Rspec or Cucumber in the future. So long for now! I’m off to go implement some fifty odd tests for EventReporter.