2012 Goals – June Retrospective

I suppose this is the half-way point of the year and I think I’ve done pretty well.  Without any further ado, let’s hop into the list.

#1 Participate in Tough Mudder / Get in better shape

I think I’m doing pretty well here, I’m doing a lot of outdoor work (planting trees, building shelves, workbenches and the like, painting rooms, etc) which I suppose is helping me lose some weight but it definitely isn’t helping endurance any.  With my schedule being somewhat hectic recently I haven’t been able to get into the routine I’d like.  However, the rubber meets the road in October, so I’ve got to get on the ball.

#2 Propose my PhD Topic

I’m still making headway, it’s definitely much closer than it was before.  I’m hoping to have the code completed in the next week at which point I can clean up the proposal document and presentation.  Then, hopefully, start herding cats to make the proposal happen.

#3 Learn a new programming language

I’ve been playing around with Clojure some and dabbling a bit with Scala.  I have to say I prefer Clojure to Scala right now.

#4 Housework

I finished painting all the bedrooms I had planned to paint.  I still haven’t painted the master bedroom because I’m not really sure what I want to do with it, so it’ll stay white until further decisions are made.

Outside, my father and I installed three crape myrtle trees in my yard a few days ago.  Yes, it’s the middle of summer and probably the worst time to do landscaping, but at $13 a tree, it was worth it.  We also built workbenches for my garage which turned out nicely.  I’ve now got to arrange my garage and get everything in order out there.

Up next is figuring out what to do in respect to gutters around my house.  Do I pay someone to install them or do I attempt it myself?


And we’re done for this month!  I think it’s all moving along quite well and I just need to up my game on the working out since I’ll be paying the piper in a few months.

2012 Goals – May Retrospective

Five months down and another seven to go.  I accomplished a lot this month, but at the expense of some of my other goals, so let’s take a look at what I’ve done.

#1 Participate in Tough Mudder / Get in better shape

Unfortunately, I fell off the bandwagon on this one last month and didn’t exercise or eat nearly as well as I should have been eating.  It become painfully obvious when I ended up hurting my back mowing my lawn.  So, I’m doubling down on this one this month and restarting the Insanity! workout to drop the weight I’ve gained and need to lose in order to be in great shape for Tough Mudder.

#2 Propose my PhD Topic

I made a lot of progress on this one, I’ve gotten a running version of what I need to do done and now I’m just adding a few bells and whistles to have it complete.  Of course, it needs some more complicated examples, so that’ll require more modification of the code I’m sure.  But, like I’ve said before, there is a light at the end of the tunnel, and I’m reasonably certain it isn’t a train.

#3 Learn a new programming language

I’ve gotten more comfortable with Scala and I picked up a book on Clojure and I’m using Promela in my PhD work so I think this one is moving along pretty well. I’d still like to write some posts about Scala but I don’t want to do that until I’ve got a better grasp on how to write prettier Scala code.

#4 Finish painting rooms in my house

I installed the oven as referenced in last month’s retrospective and did a bit more cleaning on the garage and with help from my dad, installed two attic vents in the attic above my garage.  It really helps keep the garage at a decent temperature (in fact it is either cooler than, or the exact temperature as outside) so I’m happy about that. I still need to paint the one bedroom, but I felt some other house items needed to be taken care of first.

#5 house cleaning and #6 brewing my own beer

I believe I’ve reasonably accomplished these from the previous month, so they’re off the list until I think of new things to add to my monthly goals.


So, other than seriously screwing up the first goal, I feel I accomplished a lot, but still have so much more to do.  I suppose this is how home ownership and life goes: you’re never done. 🙂

Mocks, Fakes, and Stubs. What are they and when do I use them?

I know there has been tons of things already written about mock, fakes, and stubs available all over the Internet, but I’ve decided to add to that glut and give my spin on these wonderful testing ideas.  The first questions are: why should I care what the difference between the three is and how do I use them?  Well, I’m glad you asked those questions because, it’s really quite simple.  You use mocks, fakes, and stubs during unit testing such that you can test a small section of code in a safe manner without requiring the entire system to be instantiated to run the test.  Depending on how and what you are going to test determines which of the three methodologies you’ll use.

Now, this is all well and good, but let’s define the three methodologies.  I tend to feel Martin Fowler gives the definitions that I agree with the most, so I’ll use those:

Mock objects pre-programmed with expectations which form a specification of the calls they are expected to receive.

Fake objects actually have working implementations, but usually take some shortcut which makes them not suitable for production.

Stub objects provide canned answers to calls made during the test, usually not responding at all to anything outside what’s programmed in for the test. Stubs may also record information about calls, such as an email gateway stub that remembers the messages it ‘sent’, or maybe only how many messages it ‘sent’.

I have a large preference for using fakes and stubs.  I’m not a huge fan of mocks since sometimes the coding gymnastics you do to get the mock behaving like you want, writing a fake could be written.  Also, mocks point to the fact, that you probably should have written an interface and implemented that instead of a single concrete implementation.  However, since I’m talking about all three of them, here are some examples on how I use each of them (and I can start with my least favorite one to get it out of the way).

Mock objects are best used when the the code being tested uses a library not under your control and you need to test very specific actions on the library.  For instance, you’ve written a wrapper to a database connector and you want to test to make sure that data read from the database is converted correctly.  In this case, I’d use a mock library (like Mockito in Java) to mock the calls to the database for the test harness.

Fakes, which are my favorite testing helper, can take the most work to get running, but they are far more flexible in my opinion once they are completed.  As described before, a fake is a working implementation of an interface that takes shortcuts in it’s implementation such that it behaves as the full implementation acts but without the overhead.  I find them most useful when testing database interactions with higher level code.  A good example of this is business logic in a server.  There is no reason to instantiate all the database layers in order to test the business logic.  It’s much easier to provide a fake implementation of the interface to the database and let the business logic do it’s thing.  In addition, these fake implementation can be used throughout your codebase anytime a database connection is needed.

Finally, there are stub objects.  Stub objects are meant to be used when only a small piece of functionality is used from a collaborating class within the codebase.  For instance, if there is a larger class being used, but only two simple methods are being used — a stub is more than likely a great choice.  Stub objects are often implemented as private inner classes to the test class such that all relevant code is kept close.    This old Spring Source blog article does a pretty good job of describing the difference between Mocks and Stubs.

In conclusion, these are three basic unit testing techniques and a quick overview of when to use each of them.  Personally, I find fakes to be the most helpful and reusable and mocks to be the least effective; however, different strokes for different folks (and codebases).  The bottom line is pick the best approach for the codebase and job at hand and test that code!

2012 Goals – April Retrospective

The fourth month of the year has come and gone and now, we’re into May and time to do a self-assessment of the goals I’ve set out for myself.

#1 Participate in Tough Mudder / Get in better shape

I’ve been eating better in general (thanks to juicing and cutting carbs from my meals) and exercising, although not as much as I would have hoped.  It’s hard sometimes to cut carbs out completely, so I’ve been doing carb substitutions.  I know I still want some carbs, but I’ll forgo eating a certain type of carb to get another in return.  So, I’ve cut down on the carbs by not eating them at meals and giving myself a beer or two during the weekend as a reward.  Sure it might not be the healthiest, but life should be about having fun too.  I think I’ll be restarting Insanity! to help knock off that extra bit of fat that I shouldn’t have then transition back into doing P90X with more weight than I was using.

I’ve stopped using Fitocracy and SlimKicker as well.  I think Fitocracy is much better than SlimKicker since I don’t totally agree with SlimKicker’s point system when it comes to logging food.  It’s preferences are not the Paleo / low-carb diet that I find works best for me, but a low-fat diet that I don’t like and doesn’t help me at all.  I’ll probably start using Fitocracy again since it can interface with RunKeeper which is on my phone and it can track my bike rides.

#2 Propose my PhD Topic

I’m not where I totally want to be, but I am working on the end-to-end example and have one-third of it working right now.  The middle third I’m working on is going to be the toughest since it requires an awkward translation since the models have a mismatch in their representations.  I can make it happen, it is just requiring a bit more thought than I would have liked (but it’s a PhD, it isn’t supposed to be easy :)).  The last third is fairly simple and I could probably write it right now, but I want to save it for after what I’m working on so I’ll feel completely awesome about finishing it.

#3 Learn a new programming language

This lines up with completing my PhD so I might be moving this into that goal this coming month.  Either way, I think I’m making decent progress and I want to write a few posts about learning Scala from a different perspective than how they’ve been written thus far online.  So that might be my new goal.

#4 Finish painting rooms in my house

Still haven’t finished the room yet.  Instead, I cleaned out the garage and moved a palette of bricks from inside the garage to the side of my house and bought a new oven to replace the broken one in my house.  I’ll be installing the oven (hopefully) sometime this week and then perhaps I’ll work on painting this last room across a few nights.  Cut in the corners and trim one night and then roller it the next.

#5 Spring / Summer house cleaning

I started on this and cleaned up the formal living area of my house.  It resulted in a lot of things going out to the recycling bin and a few things going into the trash.  I’m hoping to focus on one room each week and try and clean it out either donating, selling, recycling, or throwing away unneeded thing in each room. Then, even if I don’t toss anything, as long as I organize it all and get it in order, it’ll be far ahead of where it currently is (looking clean, but sort of disorganized to my eye).

#6 Brew my own beer

I think I’ll be removing this one this month since I’ve got a Honey Kolsch that I’ll be tasting soon and I brewed my Belgian Beersperiment which is now aging in a secondary carboy (can’t wait until this one is ready to go!).


I think I’m doing ok, but I’m not having near the progress that I was hoping on some of the goals.  Of course, in the end, the point is to finish them while not going insane and having a life outside of these goals.

2012 Goals – March Retrospective

Ahh, March has come and gone and it’s now time for April showers and a look back at how successful or not I was at my goals for the year.

#1 Participate in Tough Mudder / Get in better shape

I back slid a little bit at the end of March since getting the flu, it really knocked a lot out of me.  I still made sure to bike and do some stretching but I didn’t focus on building muscle as much as I should have.  I did make strides in eating healthier however, I invested in a juicer and have begun juicing one meal a day (normally dinner) and have also made sure to make breakfast to hold my eating out to lunch time during the week.  I’d like to move in the direction of eating out only a few times a week as opposed to the eight or nine times a week that I do now.  To that end, I’m a big fan of Fitocracy and I just found a new app called SlimKicker that is a food / fitness logging app, so I’m gonna give that a try and see how I like it.

#2 Propose my PhD Topic 

I moved this up to number two since I figured I should prioritize these in order of importance.  Health should always be number one, so school becomes number two.  If I’m not healthy, then it makes school that much harder.  I feel that I’m definitely on a roll on this one.  I’m currently coding the end-to-end example that I need to propose and I’m hoping I can be done with the example by the middle of April.  At that point I should be able to start working through the paperwork to propose in May.

#3 Learn a new programming language

I thought I was going to remove this, but thinking about it more, learning another programming language is never a bad thing, so I’m putting it back on the list.  I could move this down below the other points, but for right now, it’s still closely related to the previous goal of proposing my PhD topic that I’ll keep it here.  I’ve been learning Scala and Promela, Spin’s model checking language, which I’m using in my PhD.

#4 Finish painting rooms in my house

I’ve been a little lazy on this.  I’ve prepared the last room I need to paint by pulling all the wall plates off and getting the drop cloth in the room.  I just need to take about an hour or two a night and just knock out the cutting in of each wall and then take another few days to just paint a wall a day or something.  Either way, it’s almost there, just have to knock it out over a few nights or one weekend.

#5 Remove the child playset from my backyard (completed) -> Spring / Summer house cleaning

It’s been torn down and ready to be taken to a dump or picked up as bulk trash.  It just depends on how soon bulk trash comes as to what I do with disposing of the pieces.  I’m going to say the new goal is to remove clutter and junk from my house by cleaning out closets and such.  A late Spring / early Summer cleaning!

#6 Brew my own beer

I just brewed the honey kolsch yesterday, so I’m going to move onto experimenting with brewing different beers.  This will be ongoing so there is no telling where this will end up.  I’m hoping to brew a Belgium Blonde with a banana nut bread flavor in it; so, yeah, it could be epically awesome, or epic fail.


Like last month I think everything is moving in the right direction, just a few lapses here and there that I need to take care of.


The playset is down

So, my younger brother got tired of me blogging about how I haven’t taken down the child’s playset that was left in my back yard by the previous owners of my house so he and his friend came over and helped me take it all down today.  I paid them back in beer and pizza, now I’m left with getting it ready for bulk pickup and removal and probably a trip to the dump to dump the big-ass metal poles used to hold it all together.

It came apart surprisingly quick with three people working on it.  I’d say we spent about 30 minutes on it total.  I can mark another item off my to-do list and push another one on it :).