Testing Your Way To Bug Diagnosis

June 7th, 2006

Sometime you run into a bug that you can reproduce off an on, and you just get this feeling that it's because each time you try to reproduce it you're doing something slightly different and that's causing it to appear and disappear. I encountered just such a bug today.

The bug report came in, select a word at the end of a list item, hit backspace and the word is deleted correctly but the next list item is incorrectly moved up and appended to this one (as if you'd hit forward delete at the end of the list item with no selection). I'd seen this problem happen with my own eyes, the first time I tried it I reproduced the problem. So I made a change to the code base to try and track down what caused it and all of a sudden the problem disappeared.

Aha! Clearly I've isolated the problem code and fixed the issue. Being a good little XP developer I slapped myself on the wrist, undid my code change and set off to write a test first. For some reason, I first manually went through the same steps as before but this time, even with my changes reversed, the bug didn't show up. I reverted all the files and tried again - still no sign of the bug.  I put the fix back in and suddenly the bug came back.

Finally it occurred to me that I had made a change to the way I was manually running the test - the first time I ran the test I had created the list, selected the last word and hit backspace. After a while I got sick of creating the list so I did it once more and saved the result so that it would be preloaded next time I ran the application. The document was exactly the same, but the key step to reproduce the bug was actually inserting the list - the bug would never show up if you didn't first apply a list to some content. As a side note, this makes perfect sense and isn't actually a case of code that's too tightly coupled - it's the effect of a complex feature that is currently only partly implemented.

Even knowing this difference I found that I kept doing things just slightly differently that the bug didn't show up, so I had no confidence that I had fixed it. Slapping my wrist again, I wrote an automated test that ran through the exact procedure I needed to reproduce the bug. Now I could run through the same steps anytime I wanted and know that they were done exactly the same way (as an added bonus it did them much faster).

It turns out that my original attempted fix did nothing to fix the bug and the actual cause was something quite different. A few minutes later and it was all fixed up and I could get back to implementing new stories, confident that we'd never see that problem again.

Unlockable Features In Games

June 7th, 2006

It's not often that Slashdot comes up with something genuinely interesting that I haven't seen from somewhere else before, but they managed it today. Puritan Work-Ethic, How I Loathe Thee really struck a chord with me:

Nearly every video game since "tank pong" has buried its best content behind layers of work. Unlike any other retail product I can think of, when you buy a video game, the chances that you will actually get what you paid for are infinitesimal. I can't think of a single game I've played where I am confident that I've seen every single level; unveiled every coveted secret; unlocked every whatsit and pretty and soundtrack left like kipple by the designers in the dark corners of the code.

I bought it. I want my game.

The last couple of weekends, my darling fiancè has rented a couple of playstation games for us to try out. Last weekends games were The Italian Job and one of the many Bond games. Both are a lot of fun in and of themselves, but both lock off 99% of the content until you've achieved certain milestones. This is more than just a few special bonuses being locked off to give you something to aim for, this is almost the entire game being locked off - even complete modes were locked off, like the multi-player arena in Bond wasn't available until you reached some undetermined point in the multi-player cooperative mode. The Italian Job was similarly bad, a huge range of cars included in the game and none of them available. What's worse, completing stages wasn't enough to unlock things, you had to get a seriously high score while doing it - and the game was really quite challenging just to get through. In fact after a weekend of playing, we've only managed to see two of the stunt courses because it's so hard to unlock the next one.

It's a real shame that the game industry has decided that games are only fun if there's some semi-tangible reward for doing well. What they don't realize is that just getting through the level is the reward, it is genuinely satisfying just to be able to get to the end of the level. There's no need to lock of particular features or even future levels to provide a reward, just getting through is reward enough.

Similarly, games that have specific and rare save points are doomed to be discarded in frustration. There's just no reason for it, if I want to make the game harder by not saving regularly, I can do that - I'm in control. If however I want to make the game easier and less frustrating by saving regularly, let me do that. I do know what I want, I do know when I'm having fun and when I'm ruining it for myself.

The reality is, I don't play games because I want to have a really hard challenge. I play games because I want to win. I hate losing at games it annoys me - why would I waste my time voluntarily doing something that clearly I suck at? I want to get up and over the suck threshold quickly and make progress and win - sure I want to be challenged, no it shouldn't be too easy, but I should be able to win, even if it means saving every two seconds so I can practice little bit by little bit to get it just right. In the end, the only reason I'll enjoy the game is because I can win at it - so give me a break, unlock the content, let me pick what I want to do when I want to and that way I'll make sure I win just often enough to maximize my enjoyment.

Using Ant As An Installer

June 7th, 2006

Since its inception, our IWWCM integration has been a bit of a pain to install - the instructions differed based on which version of IWWCM you where running and which version of WebSphere or Workplace you used and you had to move and edit files in various locations. Nothing difficult but it was just too easy to forget a step and have things go wrong.

The simplest way to improve things - provide an installer that automates the process. The problem is, most installer tools are ridiculously complex to work with because they attempt to provide a way to do anything you could ever want. It would have taken us days just to get our heads around how to use the tools.

Instead, we whipped up a simple ant script, bundled a copy of Apache Ant, and provided a simple .bat file to start the process up. We'll probably also provide a shell script for UNIX systems and we'd like to investigate getting it working on AIX but we don't yet have a copy and none of us know anything much about it. Most of the installation problems we've seen are on Windows so that's the main thing to get working.

Ant turns out to have some pretty compelling advantages - it's cross-platform, very simple to write and modify, works well with version control and automated build processes and all the engineers are already familiar with it. One advantage I hadn't thought of until I got home this afternoon - having an ant installer allows the install to be done completely from the command line which I'm sure will be greatly appreciated by those sys-admins who run their IWWCM installs on a headless box.

The extensibility of ant is great too, we had to write one custom task to find the right path to use since a particularly directory name we needed changes every time IBM release a patch so it had to be found dynamically. In under half an hour we had it written and working - I think it took longer to write the documentation to explain how to find the path than it was to get ant to find it automatically.

All in all, I'm impressed - for simple, server installations this looks like a great option. There's no way it cuts it for client side installations, though there have been a couple of attempts at providing a friendly GUI, none have yet succeeded. For client side installs it's probably worth learning the details of a real installer and using that instead.

Ephox Is Hiring

June 7th, 2006

Ephox current has two job openings available - a technical role in our Brisbane (Australia) office and an administrative type role in our San Mateo (US) office.

Application Support Analyst (Brisbane Office)

  • Combine your software engineering skills with extensive client contact
  • Work with a dynamic, innovative team doing eXtreme Programming
  • Particpate in developing the Client Services team for a growing international business

Overview

We are looking for an Application Support Engineer with excellent communication and problem solving skills to join our technical team. With a focus on client service, your role will be varied and challenging and will include analysis of client's integrations of EditLive!, provide advanced technical support, liaising with Sales, and provide professional services directly to customers or partners, mainly remotely. Some limited amount of travel may be required.

You will also have the opportunity to work with our product management and be involved in some implementation work (both on our core products and on customer integrations).

See the Seek Job listing for more information.

Customer Service/Administrative Assistant (San Mateo Office)

We are seeking a Customer Service/Administrative Assistant for a full-time position. You will be responsible for managing customer requests, maintaining customer information, providing administrative support to the San Mateo team and light bookkeeping.

You must be a detail-oriented, team player with 2-5 years of related experience, excellent organizational, multi-tasking, problem-solving, communication, and interpersonal skills, sound judgment and good computer and internet skills. You must like working in a small company.

Responsibilities

  • Customer service via phone and e-mail
  • Active management and follow-up of customer requests
  • Maintain customer information/database
  • Provide executive, administrative support to the U.S. team
  • Product knowledge
  • Light bookkeeping

See the Craig's List entry for more details.

Pasting Images Into EditLive! for Java

June 7th, 2006

I got some nice feedback over night on an old post about WYSIWYG editors:

# Pedja Says:
June 6th, 2006 at 11:49 pm

You are the greatest.

You are the only web rich text control where I can simply paste image from clipboard.

Congratulations!

I had forgotten about that feature - it has often been one of my favorites, particularly when I want to include screen shots in technical documentation I'm writing.

When you copy an image from most (all?) image editing applications or Window's print screen functionality, you can paste in EditLive! for Java and it will automatically insert an IMG tag and make sure that the image is uploaded to the server when you submit the page.

In recent versions I believe it uses PNG to upload, but in older versions it used JPEG and it may still on some JVMs where outputting PNG isn't available. I'm not sure how well this works cross platform, it will depend on whether or not the JVM makes the image content available on the Java clipboard correctly.