Saturday, August 30, 2014

MakerSquare Day 4: How to write a test (1/4)

Friday is notable because it's the end of the first week, which means it's the traditional day for a MakerSquare student party. It's interesting to meet the C8 students, the people who were in our spot only six weeks ago, but who seem awfully experienced. Whenever we mention a challenge, they look at each other and nod knowingly. Will we be like that in just a few weeks?

My guess is yes, because it's kind of amazing to think about all the stuff we've been exposed to this week. Friday was, planned or not, a kind of summation day, where we went over some challenges from the week: how to work through algorithm problems, how to design a library*, how to write a test.

As expected, I continue to be roundly beaten at ping pong. I sort of wish we had an A league and a B league; but at the same time, getting beaten by A-league players sure does stretch my skills.

* We designed library from the tests backward: given a bunch of rspec tests, we had to make them all pass by steadily expanding our library's functions. (A failed test comes up in red, a passed test comes up in green; so you'll hear people talking about making the test "go green.") But after thinking about it some more, I think I'm going to spend part of the weekend re-working the library with a few extra classes: a book, a library wrapper, a borrower-card, a library, and a review class. That way I could extend it in various ways: the "book" class could be reused by a book-store; and the library-wrapper class could be used to wrap any other object the library wants to lend.

No comments:

Post a Comment