Backup Your Hard Drive

Posted by Kurt Schrader Thu, 29 Nov 2007 20:49:00 GMT

Sparks!

A quick reminder to all of my friends out there as yet another Macbook Pro hard drive bites the dust at our office. I can only imagine that Apple put Time Machine into Leopard specifically because so many of these things crap out.

(Image From Makezine)

Ruby 1.9 Changes 1

Posted by Kurt Schrader Mon, 26 Nov 2007 18:44:00 GMT

I was playing with Ruby 1.9 a bit over the holiday weekend and I found the eigenclass Changes in Ruby 1.9 page to be an invaluable reference to the changes we'll all be dealing with soon.

Some highlights:

  • Ruby 1.9 is significantly faster than Ruby 1.8.6, at least for the toy programs that I wrote with it.
  • send() no longer works to send to private methods. You need to use send!() instead.
  • Symbol #to_proc now allows you to do

    %w[a b c].map(&:capitalize) # => ["A", "B", "C"]

Check out the link above for more. It looks like December is going to be a fun month for Rubyists.

Closed APIs Suck: An Open Letter to Salesforce 5

Posted by Kurt Schrader Fri, 23 Nov 2007 19:31:00 GMT

Dear Salesforce,

I've been doing some work with you lately, and I was hoping to hook into you using your APIs to automatically insert some of our leads. Unfortunately, I can't. Despite the fact that you have a full API, it seems that you've chosen to restrict API access to "Enterprise Edition" and higher level accounts, and at my office we only have a "Group Edition" account.

I've been trying to think of a good reason why you would do this. I'm doing my best to lock our small but growing business into using Salesforce. Why wouldn't you want that to happen? I'm trying to tie myself intimately into your infrastructure. I'm trying to make it impossible to extract myself from being your customer down the road, but you're thwarting my attempts at every turn.

Think of how it would increase my switching costs if something better comes along. I would have to tell whoever is pushing us to adopt the new application, "Sorry, if we switch we'll have re-engineer our app." It would set the bar much, much higher. Also, it would only help your case for sticking around if I could say "You know all of that cool stuff that our app does with Salesforce, it'll all be gone if we switch over."

So come on Salesforce, how about making both of our lives easier and opening things up. I'm sure that some high-up executive there is telling you that there are a bunch of good reasons not to. I'm here to tell you that that person is wrong. Open up and this relationship will be better for both of us.

Thanks in advance,

Kurt

Using Selenium for Navigation and Hpricot for Validation in your Webapp 2

Posted by Kurt Schrader Wed, 21 Nov 2007 23:58:00 GMT

Selenium is a great tool. We have a bunch of Selenium tests that run with every one of our builds. Unfortunately, they contain a bunch of XPath in them to verify elements, and the XPath engine in IE6, to put things lightly, is a piece of garbage. It takes a huge amount of time to verify an element in a page.

As an example, here is the amount of time that our Selenium test run used to take on Firefox:

Finished in 506.108548 seconds

And here's how long it took on IE:

Finished in 4567.47592 seconds

That's 1 hour and 16 minutes to the same set of tests that it takes less than 9 minutes to run in Firefox. Clearly this is unacceptable, and, from watching the tests run, it's clear that the IE XPath engine is to blame.

We decided to attack this problem by using Hpricot to verify the elements in a page instead of the built in XPath engine. This allows us to use Selenium for navigation between pages in our site and Hpricot to do the verification.

It's simple enough to grab the HTML from the page at any point during a Selenium test by using

@browser.get_html_source

(as long as you're using Ruby Selenium Driver) and then you can do all of the verification that you want on it, in far less time. Plus, the number of changes that you have to make to your Specs/Tests are minimal. As an example,

readouts_table = table('id=readouts') readouts_table.cell(0,0).should contain_text("Molecule")

in our old code became

doc = Hpricot(@browser.get_html_source) readouts_table = doc/"//table[@id='readouts']" readouts_table/"thead/tr[1]".should == "Molecule"

in our updated code.

As always though, the proof is in the pudding. I've updated 2 out of 19 of our specs, and our time on Firefox has dropped to:

Finished in 488.753052 seconds

But more importantly, out IE run time is now:

Finished in 3171.07507 seconds

That's a 24 minute difference already and we can already fit in a couple of extra CI builds a day because of that.

We're planning on adopting this strategy for all of our Selenium tests moving forward. Selenium will be used only for navigation, and Hpricot will be used for verifying the page content. I strongly suggest that you consider it instead of using the built in verification.

Software Pundit != Software Luminary 3

Posted by Kurt Schrader Fri, 09 Nov 2007 04:22:00 GMT

My friend Jay published a blog post today entitled Despised Software Luminaries and, for once, he got it all wrong. I know Martin and Obie , his examples in the post, from my time at Thoughtworks, and they're not software luminaries. They're software pundits.

Both of them spend a lot of time telling people how they think the software world should operate. Whenever you tell people how they should do something, it naturally leads to disagreement. It's that simple. People despise them because they disagree with them.

When I think software luminary, I think of people like Alan Kay, Fred Brooks, and Edsger Dijkstra. People that made fundamental changes to the way that we write software. People like Obie and Martin are smart, talkative guys, but they're not quite in the same league as those guys.

(See also: http://en.wikipedia.org/wiki/Turing_Award)