23 February, 2013

tdd-bdd goodness

wow, ok, so here's another huge plus for TDD and BDD. it gives you the confidence to not immediately blame your own code when something goes wrong when you deploy and take part in a large SOA project. when you know that, given the right inputs, you'll produce the right results (because you built the system using TDD based on the other system's messages), you know to look to things outside your system when it's going pear shaped.

turns out, this was a human error thing that was the result of some less-than-stellar design on my part. also, the QA test plan was not using our intended behavior for the software, so... suffice it to say, there were a lot of cognitive leaps to be made to get this validated. buuuuuut... the greatest thing i got out of it was i was an effective troubleshooter because i didn't waste time (or stress) digging in my code for answers.

it turned out to be an education thing. once the dust settled, code was verified.

scotch eggs and armadillo eggs

baked the scotch eggs this time. armadillo eggs are the smaller ones. they're hot peppers stuffed with cream cheese and wrapped in sausage. i don't eat meat, so I use "gimme lean" fake sausage. awesome!

13 February, 2013

09 February, 2013

bathtime brings out the puppy in fred


which is pretty good considering he's 14 and crazy playtimes are few and far between

01 February, 2013

worthy adversary

a very nice russian imperial stout by the folks over at fulton. i don't like black licorice, but there's something similar to it in the finish. maybe it's the sweet followed bu a crisp bitterness. i'm not comparing it to the an anise flavor, it just has a similar quality. smells good (strong) too.

tenbelowzero

fahrenheit, that is

18 January, 2013

tis the saison?

trying le merle from north coast, tonight. nice, clean flavor. i love it when beer develops fruity flavor without any fruit. the cork smelled like champagne when it first came out.

12 January, 2013

manufacturing is dirty, does it have to be?

crazy bad pollution in china ever wonder why smog's worse there than here?

well, not so long ago, similar (but maybe not as concentrated) pollution was here. could it be that by leaving the manufacturing to the chinese, we're letting them do our dirty work? i really want to see us bring more "making" and manufacturing back to the united states, but we have to be able to do it in a manner that is not so destructive.

can our post-industrial-revolution (or whatever it's going to be called) please be based on manufacturing in the cleanest possible way? can the post-industrial-revolution's social mores be based on less consumption instead of the schlocky bullshit "ingenuity" being hocked by larry the cable guy in this commercial. 

there has to be some sort of balance to manufacturing and population centers. sure, you need critical mass to minimize the waste for some industries. this will cut down on transportation of raw materials or, at least, have shared services like railroads, power, and employees, but does all the crap have to be made in the same place far away from our homes? would we demand cleaner and smaller manufacturing if the plant was visible from our backyards? hell yes. would we buy things that last longer and are easier to repair, if the junkyar... er... recycling centers were right around the corner? yes, again (hopefully).

i don't know... it just feels as if we're propping up a shiny-gadget-driven manufacturing bubble that's going to pop like the american housing market. more things are being built for us to consume, but for them to be manufactured at a price that we're willing to pay, they can only be manufactured by cheap labor or with no environmental regulations--or worse, both.

can we keep manufacturing small to medium sized? can we keep our consumption that way too? it feels like multiple things need to shift on both the supply and demand side of things.

hiding in aisle 14 at t1

05 January, 2013

disassembly!

when i was a kid i had a workbench and a set of tools. when it came to fixing stuff, i was ok. i kept bicycles, go karts, and an old motorcycle running, but the real fun of the workbench was disassembling stuff. i tore apart stuff like clock radios or whatever electrical gadgets were headed toward the garbage. well, when we decided to send a couple of old desktop computers to the recycler, i figured i'd pull the hard drives apart to show the kids. i kind of felt like a kid again, too.

not aero

file under: #doingItWrong

04 January, 2013

oak-aged yeti, so nice

enjoying a hugely flavored imperial stout. the oak hangs around after the finish, but it works well.

01 January, 2013

vim commands/functions to run cukes within vim

OK, I'm doing more rails work in vim, these days, so I'll be tossing more stupid vim tricks up here as I run into them.

The other day, I was moaning about cucumber and locations of step files, as it encourages (but doesn't depend upon) a file-naming convention. As such, step files can be hard to find. Anyway, as I'm kicking through a way to script a solution to that problem, I decided I wanted a way to run cukes from within vim.

I came up with two solutions:

  1. one to run the whole file that's in the currently open buffer
  2. one to run the scenario that starts on the line the cursor is on
To implement these, I'm using the very cool RunShellCommand function found here, which opens the results of the command in a scratch buffer in a new window.

I just added the following command definitions to my .vimrc:

command! Cuke call s:RunShellCommand('bundle exec cucumber ' .expand('%:p'))

command! CukeL call s:RunShellCommand('bundle exec cucumber ' .expand('%:p').':'.winline())  


I haven't mapped short commands with my <leader> yet as I'm not sure if I'll use this regularly, but it seemed helpful, so I thought I'd share. The drawback is that the execution time of cucumber is long, especially if it's a UI test, so it can take over your UI for a while, which is why I added CukeL, so I cold run just the current line. The cucumber overhead is still pretty high, so I may look into creating a modified RunShellCommand that forks the process, so you can continue working while you fire off the command.

31 December, 2012

cucumber disambiguation, or... survival tip for a noob in an existing rails project

I've just jumped into an existing rails project at work. The existing team is using the hell out of BDD/TDD. While I'm super excited to get there with them, I struggled HUGE with the fact that their features and steps have been heavily optimized and DRYed out. To grok the project and the methodology, I was trying to jump from feature to step and because they've been working with this for a while, they have organized source around DRY, not around readability and discoverability. As such, I was stumbling around trying to figure out where the hell each of the step definitions were for the features I was reading.

I finally stumbled upon the right incantation of cucumber options to get what i needed:


bundle exec cucumber -o cuke.out --format stepdefs features 


If you want to do all features. However, if you just want to discover the feature-step relationships for a specific feature:


bundle exec cucumber -o cuke.out --format stepdefs features/specific_feature_file.feature


Will produce output like this:

5.1738260 /^I am logged in as a valid user$/
   # features/step_definitions/authentication_steps.rb:100
2.6341953 /^(?:|I )go to (.+)$/
   # features/step_definitions/web_steps.rb:48
2.1448050 /^I should be able to visit the admin area$/
   # features/step_definitions/admin/admin_steps.rb:5
1.2116820 /^I am logged in as an admin$/
   # features/step_definitions/authentication_steps.rb:106
0.7382180 /^I am logged in as an uber admin$/
   # features/step_definitions/authentication_steps.rb:118
0.1408770 /^I should see the Contacts\/New Contacts page$/
   # features/step_definitions/marketing/contact_list_steps.rb:1
0.0094120 /^(?:|I )should not see "([^"]*)"$/
   # features/step_definitions/web_steps.rb:123
0.0092010 /^(?:|I )should see "([^"]*)"$/
   # features/step_definitions/web_steps.rb:105


Now, you can tell where the f-uh-uh-uh-uke, fuke... er... cuke the implementation is. Odds are, a team who's been doing this for a while have shut off step output because they know the project like the back of their hand, but something like this will help a noob like you get up to speed in an existing project. Well, it helped me and it took a while to find the right search terms to give me what I needed. Oh, also, the output file was a huge help because the number of NOT MATCHED BY ANY STEPS lines in the project blew the useful stuff right out of my iTerm's scroll history.

Good luck...

Now, I'm thinking of writing a vim plugin that will use this output to create a ctags like file that will allow you to jump around from feature to step regardless of what your file naming conventions are. 



28 December, 2012

stairway


so... someone passed this on to me today saying, "here's a day changer." it was, so i'm sharing it again with a little commentary.

sooo, anyone who claims women can't rock can kiss my butt. here's a link to ann and nancy wilson (heart) playing "stairway to heaven" while the surviving members of led zeppelin in the crowd watched. these ladies aren't a whole lot younger than the dudes from zoso, yet they brought it... big.

for the girls and women out there, don't, don't, don't let anyone tell you you can't play in a boy's/man's world. make it yours and play your heart out. and, yes, i mean that as a metaphor for life, not just the small (but influential) sphere that calls itself rock and roll.

and for those of you who watch this, enjoy. i did, and so did messrs. plant, page, and jones.


27 December, 2012

focus on the trail, not on the flakes

keeeeeep yer eyes on the trail! don't get distracted by the snowflakes floating through the helmet lamp.