Jul 03 2008

Opensource Google C++ testing framework

dastels @ 9:52 pm

I’m pleased to say that we are opensourcing our C++ xUnit-style framework. See the official announcement.


May 14 2008

Cool Tool

dastels @ 9:17 am

A friend of mine, Misko Hevery, has written a very cool opensource tool for analyzing Java projects and scoring them in terms of how testable they are. His plans are to have it point out what’s wrong, and make suggestions as to what you can do to improve the situation.

Check it out: Testability Explorer

Well worth looking at.


Jan 28 2008

Source from TDD: A Practical Guide

dastels @ 1:27 am

Several people have asked me for the source from my last book “TDD: A Practical Guide”. A lot has happened since that book, and the files from it that were once posted on the Saorsa & Adaption sites were lost. Unfortunately I’ve had to tell people that the source was now longer in existence.

Well, today I was doing some routine housekeeping and… Huzah!!! I found a zip of those very source files. For anyone who has been looking for them… I’m pleased to say that I’m making them available at long last. You can download it here


Jan 16 2008

RSpec + JRuby

dastels @ 6:17 am

My coworker, Paul Zabelin, posted here on some ideas that we’ve been experimenting with using RSpec stories and JRuby.


Jan 15 2008

New and Improved: RSpec 1.1.2

dastels @ 11:48 am

Tonight RSpec-1.1.2 was released. See most of the details on David Chelimsky’s blog.

I take a personal interest in this release as it includes my first active submission to the codebase in some time.

The functionality I added relates to the definition of steps in the new story component. Up until now, you used a string to define a step. For example:

Given "a student named '$name'" do |name|
  #...
end

When "the student is given a grade of $grade" do |grade|
  #...
end

Then "the student should $pass_fail" do |pass_fail|
  #...
end

This would result in stories like the following:

Given a student named 'Mike'
When the student is given a grade of 40
Then the student should fail

Continually talking about “the student” is grating and very un-natural sounding. Sounds downright, bloody legalistic, actually. And a lawyer is the last thing we want to be accused of sounding like… other than maybe Denny Crane.

One approach to this would be to go to something like:

When "he is given a grade of $grade" do |grade|
  #...
end

Then "he should $pass_fail" do |pass_fail|
  #...
end

which would give us:

Given a student named "Mike"
When he is given a grade of 40
Then he should fail

Now, speaking of lawyers, we probably want to make this a little more PC and be able to do this:

Given a student named "Michelle"
When she is given a grade of 60
Then she should pass

We could conceivable create another set of steps for the feminine forms, refactoring to remove the duplication. That might suffice in the simple case, but it’s still rather crude. I’d like to be able to use a regular expression and create steps something like:

When /(he|she) is given a grade of (.*?)/ do |pronoun, grade|
  #...
end

Then /(he|she) should (.*?)/ do |pronoun, pass_fail|
  #...
end

With release 1.1.2, that’s exactly what you can do.

There are a couple things to point out:

  1. Alternatives need to be in a group to limit their scope.
  2. Whatever matches groups such as that (and any others) will be sent into the supplied block as arguments. As such they need to be accommodated by having a block parameter for each of them.
  3. Since this is already a regexp, no internal processing is done to it. With string step names, variables (of the form $<identifier>) are rewritten as (.*?). When using a regexp as the step name where there are variables, we much do this rewriting ourselves.

This new feature provides a new level of flexibility in defining story steps. Have fun with it.


Nov 05 2007

RubyConf 2007

dastels @ 4:04 pm

I’m sitting in the airport in Charlotte, on my way home from RubyConf2007.

What a fabulous conference. This the most enjoyable conference I’ve been to in a very long time.

There was so many great talks/ideas/projects, it’s hard to pick highpoints, but these stand out for me (in no particular order):

  • drnic for some very cool tech and sheer entertainment value.
  • Laurent Sansonetti for a jaw-dropping talk/demo about what’s possible with the latest Ruby love from Apple.
  • Charlie & Tom on JRuby
  • Evan on Rubinius… that is one cool project… sign me up
  • and, of course, Matz’s keynote

It’s no wonder the Ruby community is “nice people” when we have someone like Matz at the head of it.

Maybe as rewarding, or even more, than the tech & talks was seeing old friends again and meeting others face to face that to date I’d only known online.

It was an awesome weekend, and I’m eagerly looking forward to the next Ruby conference!


Sep 22 2007

Emacs once again

dastels @ 4:02 am

With my move to Google, I’ll be in a mixed Linux/OSX environment… so it makes sense to me to revisit emacs for my day-to-day programming. 

With some help from zenspider and technomancy, I have the latest carbonized emacs up & running with a nice ruby/rails environment (rinari)… and of course… the zenburn color scheme.


Sep 20 2007

Everyone’s a pirate

dastels @ 12:23 am

Seen on #caboose:

 

courtenay: we uses arrrrrrrspec 


Sep 19 2007

A Microsoft moment

dastels @ 2:36 am

I just added a confirmation dialog to a cancel button on an app that I’m working on. I tested it and stopped for a second as I read the dialog.. then broke out laughing.

cancel-or-cancel.png
What do I press if I really do want to cancel?

Sep 18 2007

The Art of Computer Programming

dastels @ 5:29 am

Tonight I was exploring the current state of RubyCocoa (and it looks good), and I noticed a quote from Knuth’s “The Art of Computer Programming”, his 1974 ACM Turing Award Lecture.

Paul Graham has the text of the full lecture here.

This is a great talk, and should be required reading for anyone calling themselves a programmer. I found the last section, especially interesting.. here’s what I consider to be the core bit form it:

 

“Therefore I want to address my closing remarks to the system programmers and the machine designers who produce the systems that the rest of us must work with. Please, give us tools that are a pleasure to use, especially for our routine assignments, instead of providing something we have to fight with. Please, give us tools that encourage us to write better programs, by enhancing our pleasure when we do so.” 

It struck me that Ruby and recent systems from Apple fill Knuth’s request quite nicely. According to Wikipedia, Knuth uses Macs.. I wonder how he thinks they answer his challenge from ’74. I wonder what his view of Ruby is… Anyone heard anything about that?


« Previous PageNext Page »


Steve Jobs Memorial

Stay Hungry, Stay Foolish!
Steve Jobs

In memory of Steve Jobs