week, day = 2, 5
Time flies when you're too busy to notice the passage of time.
Today we had our first official introduction to RSpec and Behavior-Driven Development (BDD), which is basically Test-Driven Development (TDD) with a soul. TDD is fairly agnostic in terms of what to test, how thoroughly to test it, and where to start testing. BDD provides some theoretical motivation for answering these questions, namely you want to focus on the behavior of your application, especially as it relates to the User's Experience (UX). And even though we had used RSpec in our pre-course work and first two assessments, this was our first explicit explanation of the syntax and what's going on under the hood.
We practiced writing our own specs by designing a 5-card draw poker game using the BDD methodology. It was definitely a different way of approaching the task as it not only requires you to think about your app in a bottom-up manner (thinking about the specific actions that occur at each step of the game play), but you first have to think about the project top-down so you know what classes you need, what methods need to be written for each class, and how the classes interact with one another. Everything has to be pretty well planned out before you can starting writing specs to test code you haven't written yet.
Despite the fact that my partner and I didn't finish the project, I was happy with our progress as we came up with some really good code for dealing with the comparison of hands, which is really the only tricky logic in the problem. Everything else is just pretty standard loops and making sure each class can access what it needs from the other classes. I also feel a lot more comfortable with RSpec. Much of the mystery is gone which I think will make future assessments a little less terrifying :)
And day == 5 means it's Friday. And Friday means end of the week happy hour!










