XUnit Test Patterns: Almost Out?

April 30th, 2007 by James Carr

While putting together some ideas for the TDD Anti-Pattern wiki tonight, I got to thinking… “Whatever happened to that XUnit Test Patterns book?” (yes, in case you were wondering, I do think with words hyperlinked like that). You know, the one I blogged about almost a year ago when I accidentally stumbled across the Amazon.com page and the author’s site. At a glance, I was enthusiastic, and even joined a mailing list for the book, which I realized I have not seen much activity on in ages.

And it was a good thing I decided to look into it. I mozzied on over to the xunitpatterns site and, not only has it been largely updated,the author states it that it is currently in “Typesetting” and close to release! I got excited, but then read the next sentence…

If all goes well, the book should go to the printers in March and be in stores in April!

Awww… it is May now, and I know it’s not out, otherwise I’d have it in my hands reading it right now. :(

However, I really look forward to seeing it, and in the meantime the site is an EXCELLENT source, and provides some handy patterns for unit testing. Definitely worth a look!

TDD Anti-Patterns: The Wiki!

April 30th, 2007 by James Carr

There’s one post and one post only on my blog that gets the largest amount of attention: the TDD Anti-Patterns entry. This was an entry to kind of precede an article I had prepared for the IEEE special issue on TDD, however that article never materialized (mainly due to last minute writing on my part).

Since this particular blog entry has been pretty popular, I am going to launch a wiki for it soon. Hopefully it can serve as not only a catalog of the smells, but allow for community contributions, examples, and steps to improve and move away from those smells.

So.. stay tuned, and let me know if you are interested in helping out. ;)

A new Javascript Unit Testing Framework?

April 29th, 2007 by James Carr

Today I happened across jsTester, which describes itself as:

JsTester allows validation of javaScript code inside java. It provides a group of assert methods like JUnit’s Assert, it also supports the validations described in http://javascript.crockford.com/remedial.html, and the ability to use your own validations (unary & binary predicates).

Looks interesting, although I admit I have yet to try it out.

Adding More Flexibility To FIT Fixtures

April 28th, 2007 by James Carr

There’s one fixture of all the fixtures in FIT that people find the most useful… the ColumnFixture. The simplest of all, just a simple table with columns that map to object properties and methods, with each row setting values, calling methods, and verifying results. Anyhow.. in my time I’ve faced all matter of problems with ColumnFixtures, with tons of nice little smells showing up in our fitnesse tests here and there. So today, for my Friday Personal Development time at Carfax, I decided to tackle some of the problems.

Read More »

Best No Testing Excuse Ever

April 27th, 2007 by James Carr

“Well we don’t want to break our code base with unit testing.”

Brilliant.

Rant: Copy and Paste Programming

April 27th, 2007 by James Carr

Let me forwarn you that you may be offended by this post… it may come off as a bit hostile and derogatory, but it’s just something I need to get off my chest. When someone thinks it’s entirely acceptable to write a 300 line method and call it “the quickest and simplest thing to do that works” and then copy and paste those 300 lines 10 times and modify maybe one or two variables to cover other scenarios, you don’t deserve to even have a job programming.

I’m sorry, but I don’t care what your time constraints are. I don’t care that you just learned the language. And I don’t care you sat down and thought “OMGZ! I need to get this done yesterday!” The fact that you did not just try to use that thing you call a brain and THINK about what you were doing and just reduced yourself to a CTRL+C and CTRL+V keyboard monkey reduces any possiblity that I could respect you as a programmer. Honestly, did you get through school by copying homework assignments? Did you get the genius next door to do your work for you while you were out partying, and luckily had awesome memorization skills to pass exams?

A skilled craftsman is one who devotes their time and energy to honing their skill. They may start out knowing very little, but through dedication and at least using their brain they improve, and even if their code isn’t perfect, at least they gave it effort. By just mindlessly copy and pasting you didn’t even make an effort… you’re just lazy.

When you need to do something similar to something else, maybe it’s okay to copy and paste the first time, change a few things, then look at what you can do to consilidate both tasks and make the same code useable in both situations. But doing the whole copy and paste and saying “I’ll refactor it later” is idiotic… you know that “later” is never going to come, and with that attitude you’re just going to keep doing it over and over to the point that “refactoring it later” will take you 30 days.

Let’s just be honest to ourselves… there’s really no reason you should copy and paste your code. Period.

What I Do When I’m Bored

April 26th, 2007 by James Carr

I whipped this up in about 30 minutes using flickr’s developer API and some PHP. Added Lightbox2 javascript library for effect.

I forgot how fun PHP can be for quick and dirty things like this.

Wow…

April 14th, 2007 by James Carr

I usually don’t post stuff political or media related, but when I was at the gym today and watching CNN while on the treadmill… hasn’t this whole Don Imus thing gone too far? CNN displayed big fancy graphics with the words “Don Imus: The Aftermath” with dramatic and suspenseful music, blared his name and comments from others on the situation non-stop on the ticker, and even hosted another fun filled interview with Al Sharpton and his thoughts about the situation.

This is all they covered pretty much during the hour I was there. Oh yeah, a bomb blew up somewhere in Iraq, but that’s not as important as the “Don Imus Scandal”, and only got perhaps 5 minutes mention.

Completely overrated. :(

Blog Tagged

April 6th, 2007 by James Carr

I woke this morning to discover that sly devil Cory Foy had blog tagged me. I’d never heard of it before, but after a quick search discovered it’s a fun blogging game to get other bloggers to confess five interesting things about themselves that not a lot of people know about.

So, without further ado, here’s my five things.

  1. ARRRGGGHHH!!! I was quite the hot head in high school… I think I got in fights just about all the time. Kind of funny reflecting back on that, considering I can hardly remember the last time I raised my temper (or voice) at someone.
  2. Tandy? Well that's dandy. Just like Cory, I was a geek since I as little, programming BASIC on my Tandy Color Computer 3 when I was 8, but wasn’t going to select it as a career. Although I dreamed of being am astronaut when I was little (even attending Space Camp in Florida), I’ve held a large variety of jobs, and before college was planning to either go to culinary school to become a chef or go for a business degree and open a restaurant there after (I still do!). Luckily, I decided to go with what I liked and went for a Computer Science degree.
  3. ARRRGGGHHH!!!
    I’m a caffeine freak… whether it’s a can of Red Bull, a quad shot mocha, or even some green tea, I always have my caffeine fix in hand so I’m ready to be on the move. The only downside is my tolerance has built up so high I don’t quite get the rush I used to anymore.
  4. Jack Johnson
    My music tastes are wide and cover a large variety of different genres. I like rock. I like alternative. I like music by artists such as Dave Matthews or Jack Johnson. I even like rap. Sometimes I sill listen to 2pac or Bone Thugs-n-Harmony on the way to work… or I might listen to The Doors, or Smashing Pumpkins.
  5. Hippies!
    My father is a 60 year old hippy who still thinks the 1960s haven’t ended. This always makes for fun and interesting visits, and I look forward to seeing him when I go to visit in California, even though I always feel like the adult when I’m with him. ;)

Well, I suppose that’s it… hopefully not as dull as I thought it was, and congrats for making it this far. Now it’s my turn to tag!

Next up are Brian Button, Mario Aquino, Jeff Brown, Jeff Langr, and Chris Wheeler.

Speeding Up Development With Fitnesse

April 5th, 2007 by James Carr

I use fitnesse a lot for acceptance testing, and as an “over optimizer” i was recently bugged by one thing I felt slows me down… having to redeploy over and over when writing fixtures. Sometimes you whip up a fixture that has simple functionality and deploy, only to discover you goofed somewhere and it doesn’t work. Wouldn’t it be nice to just quickly edit and save fixtures?

This is where my current fascination with Groovy intersects with my fixture writing madness. I was toying with Groovy earlier today after work and thought “Wouldn’t it be nice to just edit groovy files and save them, and have fitnesse use them?” And tongiht I’ve done just that (although rather hackishly). I wrote a WikiWidget plugin that basically les you define a groovy source file directory (much like the !path wikiWidget) that essentially pulls them into the classpath. All that is required is to have the groovy.jar in the classpath, and it works flawlessly.

It’s late, and I’m sure there’s bugs, so once I clean it up I’ll make it availble for everyone to use. ;)