A few weeks ago I wrote about Microsoft’s “browser choice” ballot page in Europe, which in its debut used a flawed algorithm when attempting to perform a “random shuffle” of the browser choices, a feature specifically called for in their agreement with the EU. This bug was fixed soon after it was reported. But I recently received an email from a correspondent going by the name “Skoon” who reported a more serious bug, but one that is seen only in the Polish-language translation of the ballot choice screen.
You can go directly to this version of the page via this URL www.browserchoice.eu/BrowserChoice/browserchoice_pl.htm. Try loading it a few times. Does it look random to you? I tried it in Internet Explorer, Firefox, Chrome and Opera and get the same result each time. The order is unchanging, with Internet Explorer always first, followed always by Firefox, Opera, Chrome and Safari, in that order. There is no shuffling going on at all.
I won’t bore you with the details of why this is so. Let’s just say that this is a JavaScript error involving a failure to properly escape embedded quotations in one of the browser descriptions. Because of the error, the script aborts and the randomization routine is never called.
See if you can find the bug. Hint: turn on your JavaScript error checking in your browser (e.g., Tools\Error Console in Firefox) and the error will pop out immediately:
If you can detect this error in 30 seconds by enabling Internet Explorer’s own JavaScript error detection facility — and I believe you can — then we can assume that anyone could have done this, even Microsoft. The odd thing is that evidently no one at Microsoft bothered to check this page for JavaScript errors, or even check the page to see if it actually worked. We’re not talking about sophisticated statistical testing here. Any QA on the page, any at all, would have found this error.
If Microsoft could miss something so basic, how could anyone every trust their programming? Of course Joe Average isn’t a programmer, and won’t necessarily understand why this is a problem. Which is too bad, because any company that could mess up something like this, doesn’t deserve your business.
In this case, i would say:
“never attribute to incompetence what could be ascribed to malice” ;-)
I think a malicious perpetration would be not-so-obvious.
I found it easily because I use Notepad++ for View Source in IE8. The extra quote causes the resulting in-the-clear URLs to be highlighted.
If I open IE8 Developer Tools and View Source, that editor shows me the same weirdness, from which one can look a few places back to see how the extra ” has screwed things up.
I don’t find the diagnostic message that pops up from the warning in the corner of the IE8 status line to be all that useful.
For the fun of it, I had the IE8 Developer Tools submit the page to W3C for validation. That was a hoot. If you look at the first three lines of the file you can see how the whole thing gets derailed (beside having the script error further down).
So, these browser choices actually open up in an (installer-internal?) browser window and require an Internet download to fulfill?
I expect that at Microsoft, “QA” stands for “Quit Anyhow”
They probably decided this code was so important, it should be written by senior managers and/or lawyers, and not by mere programmers.
Off-Topic
Oracle is now going to charge $90 for the ODF plugin for MSOffice. See http://www.sun.com/software/star/odf_plugin/get.jsp
What is next – Open Office – i guess.
Same static order happens with any language when javascript is disabled/blocked. Oh well..
I notified Microsoft of this on the 14th, waiting to hear back. By the way, there is an even greater error on the Polish version of the browser choice screen: the mistranslation of Apple’s statement. It calls Safari a search engine, rather than a web browser.
The thing to remember is that ‘malice’ and ‘incompetence’ are not the only possible explanations. For example, ‘negligence’ is also a distinct third possibility.
As I said in my previous posts, developing quality software is not dependent on having a team made up of super heroes. Perfect software is not made by having only perfect programmers. A quality process allows you to take “average programmers” (and let’s admit it, any company above 50 people has mainly average programmers) and through review and testing making software that meets requirements. It is like Shannon’ theorem on how to send a perfectly intact message over a noisy channel. It can be done, if you use an error-correcting protocol.
Obviously Microsoft, when it works on “products”, knows how a quality process works. Since it is clearly not working in the case of the browser choice ballot, I think this suggests that a product team is not working on it, but instead it being developed in an ad-hoc manner.
I looked at the source code of the page and noticed that all browser information is present twice: once in the JavaScript array where the syntax error occurred and once in an HTML table. Using JavaScript it’s perfectly possible to take the browser information from the HTML table, shuffle it and put it back in the new order. There’s no need to store it in a hard-coded JavaScript array.
With a column per browser in the HTML table they need to modify a separate cell in each table row for each browser. Had they concentrated the information in a single div element per browser, the JavaScript would have been simpler, just a single element per browser needs to be taken from the page and put back in a different order. The divs could have been placed side by side using CSS to create the same layout they use now.
So there is no need to put the browser info in the page twice and no need for the JavaScript code to depend on the structure of the information. This would have made the JavaScript code simpler, and without browser information hard-coded in JavaScript the syntax error would not have been possible (by not properly escaping the browser info in the HTML code similar things can go wrong of course, but that is something they already have to deal with).
Just as with the original shuffle algoritm error this looks as if it has been built by someone who still has a lot to learn. Still having a lot to learn is perfectly all right, but it seems that Microsoft didn’t take the trouble to have someone more experienced look over his or her shoulder. That’s pretty careless for a page that you can expect to be scrutinized by a critical crowd. The QA is sloppy too, if present at all.
Perhaps Microsoft wants to give the impression it’s just a minor thing that’s hardly worth any effort.
@Gerrit April 23, 2010 at 5:06 pm:
“Perhaps Microsoft wants to give the impression it’s just a minor thing that’s hardly worth any effort.”
They gave me that impression with Windows Vista.
-Harrow.