Friday, August 31, 2007

Star Wars Tranformers or Transformer Star Wars?

From the category of Random Toy Combinations...


Darth Vader transforms into the Death Star


Chewie transforms into the Millenium Falcon

Tuesday, August 28, 2007

How extreme are your unit tests? Part Deux

While discussing my previous post on extreme unit testing with a colleague we surmised that Ashcroft was probably named after the former Bush Administration US Attorney General responsible for the Patriot Act (and a pretty good singer). Inspired by this project here are a few suggestions for new unit test frameworks:
  • Rumsfeld - Runs the tests you have, not the tests you wish you had
  • Gonzales - Can't remember if it ran the unit tests or not
  • Cheney - Claims to know where you can find Tests of Mass Dependency Injection
  • Bush - Proclaims all of the unit tests were successful - Mission Accomplished! - but in the background keeps allocating more resources hoping the tests will complete soon

The Memento Pattern

After programming for more than a decade I finally found a production use for the memento pattern - as a way to externalize the state of a complex legacy object (the actual state info is small, but for legacy the reasons the class is full of all sorts of cr... business logic, references to controllers, managers, etc) so the object can be stored in ehcahce and spooled to disk when necessary.

If I continue to program for another decade maybe I'll find a use for the remaining 50% of the Gang Of Four ... err, GoF patterns that I haven't yet seen used in a production system :)

Wednesday, August 22, 2007

Windows Update takes out Skype

A routine Windows Update triggered a series of events that caused a two-day outage of the Skype service.

In a nutshell the Windows Update went out to millions of computers at about the same time, those computers rebooted about the same time and then tried to auto log-in to Skype upon reboot at about the same time. Unfortunately Skype engineers had "tuned" their "self-healing" network for a different series of events.

Ouch.

How extreme are your unit tests?

A short list of unit testing categories and tools I've seen on my journeys through legacy Java code bases in the last few years:
  • Freestyle - No unit tests, maybe the occasional ad-hoc main() method used during development.
  • Keep It Real - You believe in keeping code clean and modular, and have written unit tests for the modules using something like JUnit or TestNG.
  • Mock Me - How isolated are your modules? During unit testing can you replace the modules with Mock Objects using something like EasyMock?
  • Cover Up - You've got unit tests but what percentage of your code does the unit tests cover? A code coverage tool like Clover will tell you.
  • Attack of the Mutants - You think your unit tests comprehensively test the code? Jester makes random changes to your test code and verifies if that test still passes; so called mutation testing.
  • No Code Left Behind - Got a large chunk of legacy code that you're not sure is used? Guantanamo deletes all code not covered by unit tests.
  • Cylonification - You wrote the application first. Then you wrote some unit tests. But the unit tests were actually end-to-end integration tests. And the tests took a very long time to run. And they depended on each other. And they rebelled. And they have a plan. Ashcroft monitors and enforces discipline on your unit tests.

Wednesday, August 15, 2007

Global warming just a Y2K bug?

Looks like some people still haven't learned the Y2K lessson...

While inspecting historical temperature graphs, he noticed a strange discontinuity, or "jump" in many locations, all occurring around the time of January, 2000...

These graphs were created by NASA's Reto Ruedy and James Hansen (who shot to fame when he accused the administration of trying to censor his views on climate change). Hansen refused to provide McKintyre with the algorithm used to generate graph data, so McKintyre reverse-engineered it. The result appeared to be a Y2K bug in the handling of the raw data...

NASA has now silently released corrected figures, and the changes are truly astounding. The warmest year on record is now 1934. 1998 (long trumpeted by the media as record-breaking) moves to second place. 1921 takes third. In fact, 5 of the 10 warmest years on record now all occur before World War II.