About the author

Steven Harmansteven harman :: makes sweet software with computers!

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

News

Badges

  • Subtext Project
  • Support Subtext

BDD

There are 10 entries for the tag BDD

Prefer Dependency Injection to Service Location

There is currently a thread running over in the StructureMap Users mailing list asking if we really need constructor injection when using an Inversion of Control container. Before any one rips off on a rant let me say that I worked with Jon in my former life and I’m fairly certain he’s merely conducting a thought experiment, trying to sure up his own beliefs. A worthwhile exercise, if you ask me. At any rate, I have a few points I wanted to throw out there; most of them basic and mere reiterations of the words of others… but I’m...

Toward a Better Use of Context/Specification

If you’ve hand-rolled your own Context/Specification apparatus to support your test spec-first lifestyle, you’ve likely got a base class that looks something like the following: 1: public abstract class concerns 2: { 3: [SetUp] 4: public virtual void setup_context() 5: { 6: context(); 7: } 8:...

A Little More Sugar for Testing Routes in asp.net MVC

The other day I was spec’ing out some new routes for my application and I wanted to make sure certain routes were ignored. Not happy with the disgustingly-verbose way of testing routes OOTB with asp.net MVC, I decided to lean on the great work Ben Schierman did in his fluent route testing extensions. I whipped together a quick extension method that allows me to do the following: 1: public class when_requesting_a_gif_file : with_routes_configured ...

Saving the World via… TDD?

Hot on the heels of my wildly (in)famous “When Should I Write Tests?” post, I have another fun tidbit about testing to share with you. Though, to be honest, I found this gem via my buddy Scott C Reynolds, so I can’t take all – actually, I can’t take any – of the credit. Anyhow, Scott posted a great little snippet of code that does a couple of things: Shows the gist of Context/Specification style specs in use. Ensures we won’t need John Connor’s help after all. ...

When Should I Write Tests?

That is a question I get quite a bit, albeit in a variety of different flavors, but the heart of the question is always the same. So, inspired a conversation with my friend Corey, and a certain talk from a recent Ruby Hoedown that he told me about, I decided to clear up the issue once and for all. And to make it perfectly clear, I decided to register some new URLs that are easy to remember: http://whenshoulditest.com http://howoftenshoulditest.com Go give them a read, I think you’ll get...

Rhino.Mocks Beta Bits are Running Turbo-Charged!

A few weeks ago Oren (known to many as Ayende Rahien) pushed out a Rhino.Mocks beta drop so we could take a look at the new Arrange/Act/Assert syntax being cooked up for the pending 3.5 release. Yesterday I finally upgraded my client project to the 3.5 beta bits and started digging into the new syntax. AAA, FTW! After using Arrange/Act/Assert for just a day or two I’m already hooked. It feels like a much more natural fit for bdd-style tests. The whole Given, Expect, When, Then, go-back-and-verify-expectations flow always felt clumsy and counterintuitive, and AAA allows for...

Save Your Fingers, Use a BDD AutoHotKey Script!

Tired of typing all those underscores_while_writing_your_BDD_specifications? Yeah, I wasn’t really either. However I’ve heard read complaints from some folks that typing the underscore so many times was getting annoying, so they had opted for PascalCasing instead. Just deal with it Maybe its because of my exposure to Ruby and the joy that is RSpec, but I don’t think such minor annoyance is enough of a reason to top using a more readable style. Repetitive Stress Injury, be damned! Or maybe not! The other day while cleaning out my RSS reader I came across AutoHotKey (thanks JP), a...

Meme: How Does an Open Source Guy Pack?

The crazy-hott company I work for is getting ready to move into new, swanky, techno-stuffed digs. Yesterday was packing day for the delivery center - where my group of super-consultants live - and in honor of the event my grand-boss, Brian Prince, started a little meme: How does an XXX guy pack? Brian tagged several of his minions with variations of the meme and surprise, surprise... I'm Open Source Guy. In OSS, this is how we roll... Similar to how a tools nerd packs, an Open Source guy would first take a look at the lay of...

Expectation Based Testing with Mocks

Last week I talked about Rubifying your C# code by adding the .Each() extension method to the IEnumerable<T> interface. I was discussing that code with one of the guys at work and he asked a brilliant question So, how did you test that? I was floored. Being such a test-first fan boy I couldn’t believe that I had failed to write that little extension method in a TDD manner. Hell, I hadn’t even done TAD! So how do I test it? There are no doubt a plethora of ways to test this...

How Not to Design for Usability

This is not a fake. I actually saw this very sign on an ATM here in town... and naturally had snap a picture for my own enjoyment. Oh, and this is no small mom and pop regional bank. We’re talking one of the largest banks in the world (in terms of sheer assets)... and a former employer of mine. I need to visit a few other locations to determine if this is an isolated case of overzealous design, or if it is standard practice. My gut feeling is the latter - most likely as required by...