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.

14 December, 2012

narwhal

like imperial stout? yeah, me too!
do yerself a favor and chase down a narwhal. sierra nevada did a great job on this one.

02 December, 2012

beat that salad...

c'mon, i dare ya. i'm pretty sure you can't go into your fridge and come up with a better salad, right now.

oh well...

which makes a better leg for the TV shelf?

a cardboard tube and index cards or the 4" pvc pipe.

agreed... the cardboard has a certain college-dorm inventiveness, but the pvc is actually cut to size.

pvc it is.

mn gardening in december?

mulched the strawberries, today...

01 December, 2012

third coast old ale

mmm... it's been a while since i've had bells third coast old ale. it's a little darker brown than i remember, but just as tasty. at 10.5% alcohol, i won't be having many of these in one sitting!

26 November, 2012

23 November, 2012

another successful tree hunt

arrived home with a fine mn fraser fir. the family peeps were excited to go get it, but everyone lost their momentum on the drive home. looks like it'll have to sit naked (undecorated) for a while until we get the ornaments out.

22 November, 2012

we are humans, let's add some value

repeat after me: i am a human.

you really are, unless you're a bot, and, then... screw you. ok, though... you are a human. what value do you add value to a process? you can add a ton of value. sure there's not a ton of original thought these days, but you're a human and you have a chance (maybe rare) to actually produce original thought. computers--those things we use to get answers--get answers already thought of and answered by other humans. computers are really good at accessing data that other humans already thought of.

if you are a human, and, trust me if you read past the first sentence, you're a human. a bot would've totally moved on by now. if you are a human, take your damn mind and all of its potential and add value to every situation you are in. if you are a human and you're in a conversation in which data you know of is relevant and... could  affect outcomes, please share that information!!!

don't assume you are just a search engine or a database client who'll just provide answers to questions. people in the conversation may not have anywhere near the context you have for the problem set. they may not even know the questions to ask to get the information they need to solve their problem. you, however, have the context and the knowledge and the ability to produce original thought. you can add value to the situation by recognizing that the other person in the conversation is trying to solve a problem for which you know the answer, and providing that answer.

don't wait. if you are aware, you can add value. machines don't have morals, even if they have answers. you have morals. you have a conscience. you need to make your knowledge known. machines may not care about outcomes, they are just vehicles toward outcomes. we care about outcomes because we can see beyond our current situation. we have perspective. if people need your knowledge but don't know how to ask for it, you still need to provide it. even if you're not holding back for nefarious purposes, failing to answer based on the fact that the other person didn't ask is a form of a lie. you know it, you've experienced it as a kid.

the real thing i want you to think about is, what are the consequences of not adding value as a human? the consequence is that you can be replaced by a computer or another simpler machine.

be human and add value, please.

03 November, 2012

agile practitioners, are we waiters or doctors?

In the opening session at yesterday's Agile Day Twin Cities (url or #adtc2012 tweets), David Hussman and Jeff Patton introduced a metaphor for the sake of conversation. The metaphor was to give agile practitioners a way to describe their own role in the software development processes they use. The question was: are you more like a waiter or a doctor in your agile process? This, of course assumes that waiters take orders (specifications) and deliver food (features) while doctors participate in a discovery process to solve problems. The thing with metaphors is you can torture the heck out of them and render them meaningless, but I feel there's something to this and I want to hash it out a little, here.

I am now in my 8th month at a company who is committed to using Scrum for their development process. I was a certified scrummaster a couple of years back, but my employer at the time didn't practice, so I let certification lapse. Between that employer and my current employer, I took a short stint at a software company that had some big quality issues which they'd asked me to come in and help solve. We didn't have the same view of what might solve the problems, so put a few things in place to help, but ultimately decided to let them get back to handling things without me. I have done a number of agile-flavored things in my career, but had yet to practice a formal agile method before this.

Now, I'm in my 8th month of practicing full-on scrum with a product team. There have been ups and downs, but they're neither as high nor as low as I've experienced at other places. It feels extremely sane, but I have been feeling, lately, like I just react to "priority." Admittedly, until yesterday, I hadn't been able to put a name to it, and, while I had a sense that something was off, I wasn't sure what.

I've wanted to work in an agile process for quite some time, why didn't it feel perfect? Things are working very well, we get our product work done, we meet our deadlines, so what could be wrong? When in an afternoon openspace session about the Doctor-Waiter metaphor, Hussman asks those of us sitting around, "So, are you a Doctor or a Waiter?" It hit me, "oh wow, I'm a waiter." That's what I've been missing.

Anyway, in that openspace session, we kicked the metaphors around and while people were in the process of torturing it, it occurred to me that there are good waiters too. In fact, I had a chance to eat at a great tapas place a few weeks ago in which a waiter guided us through the experience. Could waiter and doctor not be two discrete things, could they, instead exist on a continuum of maturity from waiter to doctor? So, my contribution to the metaphor torture was, "Considering there's a continuum from waiter to doctor, are we working our way through med school by waiting tables?" It got a couple of snickers, but we didn't explore the thought.

Here's what I was trying to get at with the question, just because we're being waiters, doesn't invalidate what it is. It serves a purpose. I am gaining my experience with scrum as a participant, but now that I know there's a higher purpose, I'll be working toward doctor status. Admittedly, my mojo isn't being completely fed or this metaphor wouldn't have resonated so well with me. Some participants (including me for a few moments) in the open space session talked like they were victims of the process, which is why I wanted to kick the metaphor a little longer. Now that we know the names, now that we've identified the healthy state, let's work through it. It's kind of like the start of a 12 step program: admitting the problem.

Except, I won't go so far as saying it's a problem. It may work very well for organizations to feed bite sized chunks of product information through teams working in short iterations. This keeps teams from burning out and it does get things done (still way better than waterfall). What's missing, though, is a feeling of empowerment and engagement for the entire team.

Is being a scrum waiter an organizational thing or is it an individual choice? I will admit, that, as the new guy, I have sat back and observed. I'm working in a new language (yeah, only 8 months with grails too), the lead who hired me has left the company, and I'm experiencing a new development methodology. It didn't take me too long on Agile Day to come to the conclusion that I've chosen to be a waiter. It has served its purpose, giving me exposure to the process, time to absorb a new language and framework, and a breather to embrace the organizational change around me. I have to admit, I've probably even been a little purposefully dysfunctional about my waiter status by pushing all responsibility for prioritizing the backlog on my product manager. Rationalizing it with statements like, "he knows the business."

Now that I am cognizant of that sense of doubt--no... let's call it unease--about where I am in my maturity around scrum, I own the outcome. So, I'm going to start working my way through "med school." I'm not sure of the exact path, but I do know that I have more to contribute to the process than just writing the code. I'm starting to really internalize the product space, so I can begin to help dig into those areas, but I am, for sure, able to be more of an active participant in grooming the backlog and story planning to represent areas in which I do have significant knowledge and the ability to control, e.g., performance and architecture.

As I'm beginning to understand, a healthy scrum process probably expects me to be acting doctorly. So, choosing just to participate with a small pad of paper in my apron and a pencil behind my ear, I'll be the one breaking the rules, not the victim.

27 October, 2012

answer: squash stuffed with spiced rice, raisins, craisins, cashews, and honey

the question was: what does a vegetarian eat when it's cold out?

mmm... poppyseed bread

spent my day making spiced brioche dough for a couple of loaves of poppyseed bread. with all that poppyseed filling in my near future, i hope there are no surprise drug tests on the horizon. funny coincidence, the poppyseed/opium/drug test episode of seinfeld was on just last night

14 October, 2012

amping up the watij


I've been working on a grails webapp recently that I need to iterate on pretty quickly. Unfortunately the steps are getting more and more complex that have to be performed in each iteration. This weekend's project was an attempt to get a web-testing automation flow. No, not for deep QA or for extensive regression testing, I just want to be able to fire off some tests so I can iterate. In case you're wondering, this is on a mac.

I've looked around some and, to date, watij had the lowest bar to entry. So long as I had everything on the classpath that came with the watij webspec zip file, it seemed to work just fine. I wrote a shell script watij.sh to handle the dirty work:

export JAVA_OPTS=-d32
export CLASSPATH=$WATIJ_HOME/testlib/engine-gecko.jar:$WATIJ_HOME/

testlib/engine-ie.jar:$WATIJ_HOME/testlib/engine-webkit.jar:$WATIJ_HOME/
testlib/jniwrap-native.jar:$WATIJ_HOME/testlib/junit-4.8.2.jar:$WATIJ_HOME/
testlib/jxbrowser-2.5.jar:$WATIJ_HOME/testlib/log4j-1.2.15.jar:$WATIJ_HOME
/testlib/MozillaGlue.jar:$WATIJ_HOME/testlib/MozillaInterfaces.jar:
$WATIJ_HOME/testlib/mshtml.jar:$WATIJ_HOME/testlib/runtime.jar:
$WATIJ_HOME/testlib/slf4j-api-1.5.8.jar:$WATIJ_HOME/testlib/
slf4j-log4j12-1.5.8.jar:$WATIJ_HOME/testlib/tuxpack-0.2.jar:$WATIJ_HOME/
testlib/watij.jar:$WATIJ_HOME/testlib/webspec.jar:$WATIJ_HOME/testlib/
winpack-3.8.jar:$WATIJ_HOME/testlib/xulrunner-linux.jar:$WATIJ_HOME/
testlib/xulrunner-linux64.jar:$WATIJ_HOME/testlib/xulrunner-mac.jar:$WATIJ_HOME/
testlib/xulrunner-windows.jar:.

USAGE='
usage: watij <watijscript>.groovy [scriptargs ...]

        sets watij libs on classpath (based on WATIJ_HOME) and
        runs groovy-based watij scripts. All scriptargs passed
    on to the groovy call.

'
while [ $# -gt 0 ]
do
    case $1 in
        -h)
        echo >&2 "$USAGE"
        exit 1;;
        *)  break;;    # terminate while loop
    esac
    shift

done
if [[ $1 == *.groovy ]]
then
    groovy $@
else
    echo >&2 "$USAGE"
fi


Yes, that means you have to set an environment variable, WATIJ_HOME. Then, I also wanted to be able to write and execute my scripts from within vim as that is my primary development tool, so I added the following to my .vimrc:

command! -complete=shellcmd -nargs=* Watij call s:RunShellCommand('watij ' . expand('%:p'). ' ' . <q-args>)

function! s:RunShellCommand(cmdline)
  echo a:cmdline
  let expanded_cmdline = a:cmdline
  for part in split(a:cmdline, ' ')
     if part[0] =~ '\v[%#<]'
        let expanded_part = fnameescape(expand(part))
        let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
     endif
  endfor
  botright new
  setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
  call setline(1, 'You entered:    ' . a:cmdline)
  call setline(2, 'Expanded Form:  ' .expanded_cmdline)
  call setline(3,substitute(getline(2),'.','=','g'))
  execute '$read !'. expanded_cmdline
  setlocal nomodifiable
  1
endfunction

The RunShellCommand function was straight out of the vim tips wiki. It makes it so the output of a command is displayed in an extra window. The Watij command! statement makes it so I can execute watij against the script in the currently active editor window:


Just type :Watij <followed by args>
In this case, my script will launch bing because I added that as an argument
Now... after closing the groovy window with command-q, I see any printed output from the script in the scratch window in vim:
Now, just close the scratch window with :q

In a perfect world, I would like to create a homebrew formula for installing/configuring this and configuring the .vimrc. But... I need to get back to doing some work, so I just decided to blog about it for now.


23 September, 2012

a proud mom and her daughters

tracy ran a 10mi race, today. we're all pretty proud of her achievement!

then, she and the girls wandered minnehaha for some photos. here's a photo of all 3 of them, it's just that em was the only one posing with her mom. bel was in the process of taking a picture of them.

minnehaha trickle

31 August, 2012

ride to boreas pass

this was my ride, today. wow, very cool. right when i was feeling i'd accomplished something, though, a guy rides up and we started chatting about our rides. he's in the process of riding the entire continental divide from banff to mexico, which made my climb seem pretty much like nothing, but still cool to meet him. he's a dutch guy who's taken this summer to do the great divide mountain bike route. anyway, paltry as my accomplishment may be, here's my ride up to the continental divide, it topped out at just under 11,500ft.



View 08/31/2012 ride up to boreas pass in a larger map

photos

just after i hit the dirt

this looks like there's going to be some cool scenery

a quick rest (didn't know how close i actually was to the top)

phew...

gotta be cool

looking east from the continental divide

looking west from the continental divide

proof! (umm, yep, that's my rental bike)

woah... don't get off the beaten path! apparently they have rednecks here too
here's the path i switched to on my way down
the fence keeping jeeps and ATVs off the singletrack


waiting out the rain at the bottom before heading into town

30 August, 2012

29 August, 2012

colorado brews

the dale's scotch ale is a solid beer. i'm not as well versed in the genre but it has a lot of grain with a light hint of smoke. finishes pretty sweet, so dry is nowhere to be found in the description.
the breckenridge brewing 471 double ipa kills! thick and a whole lotta beer, not as hoppy as i'd expect, but good.





28 August, 2012

roadtrip to rocky mountain national park (rmnp)

view from the parking lot at the alpine visitor center in rmnp
gazing across what should be a snowfield... all the friggin snow is gone!
well... almost, but that's friggin sad
flying!