Tales from the Trenches - Swapping Libraries

Ok, not a very deep post, but my buddy Tai over at Luxurious Animals just told me a story on IM I couldn't resist sharing.

He built a nice animation of birds in flight, and after implementing a fix, someone reported that the birds no longer moved.

That user went home and this morning, reported that the birds were in their final position.

Why?

Turns out that someone swapped out a JavaScript library and the duration value went from milliseconds to seconds. The animation now takes almost 28 hours to complete. (But hey, it still works, right?)

Woot. This is why I love client-side development. ;)

Archived Comments

Comment 1 by Dominic Watson posted on 9/23/2012 at 12:20 AM

And that's why teams with really good automated tests love their existence!

Comment 2 by Raymond Camden posted on 9/23/2012 at 6:00 PM

Amen. I wonder if Selenium can handle testing timed events like this?

Comment 3 by Dominic Watson posted on 9/23/2012 at 11:56 PM

Possibly. If not, some of the js testing frameworks might come in handy. I think that it perfectly highlights the difficulty of writing good/any tests though. I think that is probably why so many of us fall short with testing - with time constraints, it is the easiest thing for us to let go of and the hardest to keep; the client won't care after all...(!?!)

Comment 4 by James Brown posted on 9/24/2012 at 8:44 PM

With Sinon.js, I believe you could have tested this functionality:
http://sinonjs.org/docs/#clock