Friday, October 26, 2007

So, we had this crazy idea a few weeks ago to help us catch edge-case issues in Refactor! Pro.

Now, I should first mention that the IDE Tools team has created around 20,000 test cases (with roughly a 2:1 ratio of unit tests to functional tests). These test cases collectively cover CodeRush, Refactor! Pro, and the DXCore, and they take about 4 hours to run on two machines each running half the tests.

Those test cases handle issues we have predicted in the course of development, and they also cover reported issues (so once we fix a bug, it never comes back).

So, a few weeks ago, we (Team CodeRush, Team Refactor, and your humble scribe) were in a meeting, discussing edge case issues and the challenge of finding those before we ship.

As usual, I wasn't paying attention.

Instead I was thinking about the time I played Unreal Tournament for the first time, several years ago...

I'm walking on the outside of a spaceship, stuck to the surface with magnetic boots, holding a gun that shoots spinning blades of steel...

...and this bad guy was approaching, running at me fast from behind the curve of the edge of the ship. I know he was a bad guy because he was wearing yellow. It's the same way I know that Big Bird is inherently and very secretly evil, no doubt the mastermind behind vile equations that form the three dimensional shape of a Pringles potato chip (also somewhat yellow -- coincidence? you decide).

But I digress.

For the sake of discussion, let's just call this bad guy "Bob".

So Bob is coming at me. He's running fast, lifting the rocket launcher. Getting ready to fire. Bob is low on the horizon of the curved edge of the spaceship. At first I see only his head, but then I see his torso, and soon I'll be seeing that rocket flying into my face.

At this point, someone says "Uhm, Mark. We're in a meeting. Are you getting this?"

And I'm screaming: "Not NOW. Can't you see he's got a rocket launcher!"

Followed by: "Uhm... I think Miller's flashing back to Nam again.... Should somebody call a doctor or something?"

Let me tell you something. I will need a doctor if that rocket penetrates my skull, performs a Kennedy magic bullet move and rips a Z pattern through my body, eventually shooting out my ass.

They might call that the magic burrito move.

But there's no time to think about that. Not with this yellow-jumpsuit-donnin' MUTHA FUKKA charging my ass on the outside of this spaceship.

So I scream like a little girl and squeeze the trigger hard. My flying spinning disks fly out. I can see the fear in his beady pixelated eyes. His finger pulls on the trigger. My spinning blades of steel fly out to his...

to his...

to his neck!

OMG

Slice!

Cut clean.

Bad guy head is spinning slowly, FLOATING AWAY in zero gravity! Bob's body is still standing there -- attached to the spaceship courtesy of the magnetic boots.

And I'm laughing hysterically.

OMG.

OMTFG.

Amazing. I just relived one of the funniest and most unexpected moments in my video game playing history.

Who was the bad guy?

Well, Bob was a bot. Having no friends, my LAN parties consist entirely of ME. So the other team consisted entirely of bots.

And that's when one of the other guys on the team said: "Bot? Miller, that's a brilliant idea!"

We could build a bot to test our products.

The bot lives in Visual Studio. It runs 24/7 on dedicated machines. Opens large open-source projects downloaded from the net. Projects with test cases. Compiles and runs the test cases. Collects the results. Then moves around the code, opens files, moves into classes and members, moves to random locations, finds available refactorings, and then applies one at random selected from that list. Then compiles and runs the project test cases again. Verifies results are the same, or, when an issue is found, logs the results and sends steps to reproduce (including project files) to a developer on the team.

And repeat.

Run forever.

And all we need to do is feed it open source projects from the net.

...

Well kids, this is exactly what we've just built, and it has already reported edge case issues in its first 24 hours of running.

I think that's damn exciting.

And I'm almost as giddy as I was when Bob's head floated away.

:-)

10/26/2007 10:24:45 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [7]Trackback