December 31, 2008

Perhaps They Should Have Tested More - Microsoft Zune

A Zune Swoon?

Hey, anyone know how to get this thing working again?

Apparently, starting around midnight last night, all first-generation 30GB Model Zunes - every one - restarted themselves and locked up at the boot screen.

Just take a look at some of the Headlines:
  • 30GB Zunes Failing En Masse
  • 30GB Zune apocalypse arrives as devices enter digital coma
  • Zune 30s all freezing up at once. Ack! Aliens!
  • Zune plagued by massive freeze
  • Did the Y2K failure come to Zune 30 devices 9 years later?
  • Microsoft Zunes spontaneously dying all over the place
  • Microsoft Zunes Hit By Rash of Lock-Up Bugs
  • Microsoft Zune 30GB users reporting freezing problems
  • Zunesday
  • 30GB Zunes Everywhere Are Frozen. Z2K9?
  • Worldwide Zune suicide?
  • 30GB Zunes Fail Simultaneously Everywhere
  • 30GB Zunes Killing Themselves In Droves
  • Microsoft's Latest Global Problem
  • 30GB Zunes hibernating for 2009?
  • Z-Day Hits Zune 30s
  • Some Zunes Expire Along with 2008
  • Z2K for Zune music players?
Think some Boundary Value Analysis might be in order?

At this time, Microsoft's Zune Support page says only:
zune service status


Customers with 30gb Zune devices may experience issues when booting their Zune hardware.  We’re aware of the problem and are working to correct it.  Sorry for the inconvenience, and thanks for your patience!
When I checked at 2:00 PM Eastern time, Microsoft's Zune Support page now says:
zune service status


Customers with 30gb Zune devices may experience issues when booting their Zune hardware.  We’re aware of the problem and are working to correct it.  The Zune Social might be slow or inaccessible.  Sorry for the inconvenience, and thanks for your patience!
So apparently it was a leap year problem.
Today 5:43 PM
Official response for Zune 30 Freezing Issue (Zune 30gb stuck at reboot screen)

Early this morning we were alerted by our customers that there was a widespread issue affecting our 2006 model Zune 30GB devices (a large number of which are still actively being used).  The technical team jumped on the problem immediately and isolated the issue: a bug in the internal clock driver related to the way the device handles a leap year.  The issue should be resolved over the next 24 hours as the time change moves to January 1, 2009.   We expect the internal clock on the Zune 30GB devices will automatically reset tomorrow (noon, GMT). By tomorrow you should allow the battery to fully run out of power before the unit can restart successfully then simply ensure that your device is recharged, then turn it back on.  If you’re a Zune Pass subscriber, you may need to sync your device with your PC to refresh the rights to the subscription content you have downloaded to your device. 

Customers can continue to stay informed via the support page on (

We know this has been a big inconvenience to our customers and we are sorry for that, and want to thank them for their patience. 

Q:  Why is this issue isolated to the Zune 30 device?
It is a bug in a driver for a part that is only used in the Zune 30 device.

Q:  What fixes or patches are you putting in place to resolve this situation? 
This situation should remedy itself over the next 24 hours as the time flips to January 1st.

Q:  What’s the timeline on a fix?
The issue Zune 30GB customers are experiencing today will self resolve as time changes to January 1.

Q:  Why did this occur at precisely 12:01 a.m. on December 31, 2008? 
There is a bug in the internal clock driver causing the 30GB device to improperly handle the last day of a leap year.

Q:  What is Zune doing to fix this issue? 
The issue should resolve itself.

Q:  Are you sure that this won’t happen to all 80, 120 or other flash devices? 
This issue is related to a part that is only used in Zune 30 devices.

Q:  How many 30GB Zune devices are affected?
All 30GB devices are potentially affected.

Q: Will you update the firmware before the next leap year (2012)?

Matt Akers
Zune Product Team
Now who could possibly have thought to test for leap year issues?  After all, that "leap year" thing is a fairly new invention, right?

Perhaps they should have tested more.

An update.
Supposedly, this is the code which failed:
year = ORIGINYEAR; /* = 1980 */
while (days > 365)
    if (IsLeapYear(year))
        if (days > 366)
            days -= 366;
            year += 1;
        days -= 365;
        year += 1;

December 29, 2008

Book: How We Test Software at Microsoft

A really nice addition to my QA Bookshelf.

How We Test Software at Microsoft
by Alan Page, Ken Johnston, Bj Rollison

In How We Test Software at Microsoft, Alan Page, Ken Johnston, and Bj Rollison provide a terrific mix of insight into Microsoft, along with in-depth explanations of practical test processes.

From the introduction:
"This book is for anyone who is interested in the role of test at Microsoft or for those who want to know more about how Microsoft approaches testing.  This book isn't a replacement for any of the numerous other great texts on software testing.  Instead, it describes how Microsoft applies a number of testing techniques and methods of evaluation to improve our software."
I would also add that this book is for anyone who wants to learn some extremely useful, real-world approaches to both typical and complex testing situations.

  1. Software Engineering at Microsoft
  2. Software Test Engineers at Microsoft
  3. Engineering Life Cycles
  4. A Practical Approach to Test Case Design
  5. Functional Testing Techniques
  6. Structural Testing Techniques
  7. Analyzing Risk with Code Complexity
  8. Model-Based Testing
  9. Managing Bugs and Test Cases
  10. Test Automation
  11. Non-functional Testing
  12. Other Tools
  13. Customer Feedback Systems
  14. Testing Software Plus Services
  15. Solving Tomorrow's Problems Today
  16. Building the Future
While not all of the solutions will apply to everyone (unless you happen to work at a company with over 9,000 testers), everyone will learn something.  The excellent explanations of Equivalence Class Partitioning and Boundary Value Analysis are among the best I have ever read.

This is a very good book - one I highly recommend to all current and would-be testers.

November 12, 2008

Perhaps They Should Have Tested More - Google Android

txtN cn B fun - bt danjrus!

Who knew that simply texting the word "reboot" would actually cause a phone to reboot?

Apparently, words texted right after a reboot were interpreted and executed as commands with root priveleges by Android, rather than simply being sent. 

A bit of a security flaw, no?
"I was in the middle of a text conversation with my girl when she asked why I hadn't responded. I had just rebooted my phone and the first thing I typed was a response to her text which simply stated "Reboot" - which, to my surprise, rebooted my phone."

"Google hurried to repair the problem, which causes the phone to interpret any text entered just after the phone was turned on as a command."

"Linux and Unix users are advised to use their systems with "root" privileges reserved only for administrators, but Android was actually giving anybody that privilege."

"The Android bug has to rate as one of the great software bloopers of all time."

"We tried really hard to secure Android. This is definitely a big bug."
Perhaps they should have tested more?

Here are a few helpful suggestions for words to use while testing the fix for this particular bug:
  • Restart
  • Shut Down
  • Ctrl Alt Del
  • $1,000,000
  • Travel Back In Time 
  • Melt
  • ET Phone Home
  • Nuclear Winter
  • Delete Traces Of All The Calls I Just Made To Those 900 Numbers
  • iPhone
  • Sarah Palin President (no wait, this one simply isn't worth the risk)
See also:

October 19, 2008

A Fall Walk Around Walden Pond

It was a beautiful fall day in New England yesterday.

Sunny, cool, no wind, great foliage.

So once we got our to-do list done for the day, we drove to Concord, and took a walk around Walden Pond.

(Walden Pond. October 18th, 2008)

What a great way to spend a fall afternoon.

October 7, 2008

Game Night at the Office

In my company, we've recently started a Game Night.

We take turns bringing in games.  After hours, we grab a conference room, and play for an hour or so. It's been lots of fun so far, and helps create a nice bit of teamwork.

The games
  • need to be able to accomodate around 5-10 players at a time (so checkers, chess are out)
  • need to be quick to learn
  • need to be accessible for teammates who are not native English speakers (so complex word or idiom-based games are out)
  • can't take more than 1-2 hours to play
Here are some we have played so far...


"A trick-taking card game where the object is to empty your hand. The twist is the player who plays the lowest card in a trick sits out the next round."

Hit or Miss

"Sharpen your pencils - and your intuition - for this quick playing "think-in-sync" party game. Draw a category card and in 45 seconds, list as many related words that come to mind. When the timer runs out, roll the die - if it lands on HIT, pick a word that you think everyone wrote; if it lands on MISS, pick one that only you wrote. Choose wisely and score big points. The player with the highest score wins. Hit or Miss - the can't MISS game that will turn your next party into a HIT!"

Category 5

"There are 104 cards numbered from 1 to 104. Every card has at least 1 small flag on it, which will score against you. The deck is shuffled and players are dealt 10 cards each. 4 more are dealt up on the table to form the start of 4 rows.
When each player has chosen a card from their hand, these are revealed and put on the ends of the rows according to simple rules.
As the rows get longer, a row with 5 cards in it is full. If your card is to be the 6th, you pick up the 5 cards in the row, and your 6th card goes to the front to restart the row. The cards you pick up do not go into your hand, but sit in front of you to score against you at the end of the round. Play rounds until someone hits 74 (the minimum speed of a hurricane) and the lowest score wins."



"The deck contains 6 kinds of cards. On each turn a player will take a stack of 3 cards (1 hidden and 2 visible) and keep one hidden and one visible card. The second visible card will be given to another player. At the end of the round, the player with the largest stack of cards in each color will not score points for those cards, while all other players will score points for those cards."

Wyatt Earp

"The aim of the game is for each player to earn the most money from capturing famous outlaws. 2 to 4 players take up the roles of Sheriffs who are hot on the outlaws’ tails, trying to capture the outlaws with most rewards on their heads."

Trans America

"A very simple railway game. Each player has a set of 5 cities strung across the US that need to be connected by rail. Players place either 1 or 2 rails each turn. The player who can make the best use of the other players' networks is generally victorious."


"As card games go, this one is quite revolutionary. Perhaps its oddest feature is that you cannot rearrange your hand, as you need to play the cards in the order that you draw them. The cards are colorful depictions of beans in various descriptive poses, and the object is to make coins by planting fields (sets) of these beans and then harvesting them. To help players match their cards up, the game features extensive trading and deal making."


"Tock is a board game, similar to Ludo or Sorry!, in which players race their four tokens around the game board from start to finish—the objective being to be the first to take all of one's tokens "home". Like Sorry!, it is played with cards rather than dice."

Uno Spin

"The UNO classic card game goes revolutionary! When a spin card is played, someone must spin the wheel. Will luck be on your side? Will players get to discard cards, be forced to pick up more cards, or even exchange hands? In a single turn, everything can change! Players can come from behind and suddenly take the lead. It's fast-paced fun that'll make your head spin! Includes one UNO Spin? wheel and 112 UNO Spin cards and instructions."


October 1, 2008

Optimistic Developers, Pessimistic Testers

In my experience, developers tend to be optimistic folks, while testers tend to be more pessimistic.
  • Developers are creators, with a natural optimism about making new things and solving difficult problems.
  • Testers are fault finders, with a necessary skepticism and doubt.
  • If developers are the yin, testers are the yang.
I believe this is a good thing, a sort of checks-and-balances tension that makes for better software.

But it does lead to some interesting contrasts...

Optimistic Developer: The glass is half full
Pessimistic Tester: The glass is twice as big as required

Optimistic Developer: This code hasn't yet been tested. It's not known if it has any bugs
Pessimistic Tester: This code hasn't yet been tested. It's not known if it actually works

Optimistic Developer: We are 90% done
Pessimistic Tester: We don't know when we'll be done, if ever

Optimistic Developer: We will refactor the code to make it better
Pessimistic Tester: They are throwing out the working code and replacing it with an unknown quantity

Optimistic Developer: I only changed one line of code
Pessimistic Tester: The entire system must be retested

Optimistic Developer: The code is the design
Pessimistic Tester: There is no design

Optimistic Developer: We'll fix those bugs later, when we have time
Pessimistic Tester: We never have enough time to fix the bugs

Optimistic Developer: This build is feature complete
Pessimistic Tester: The features exist; some are completely broken

Optimistic Developer: Anything is possible, given enough time
Pessimistic Tester: Everything has flaws, and given enough time I can prove it

Optimistic Developer: Of course it will work
Pessimistic Tester: It might work, but probably won't

Optimistic Developer: One last bug fix, and we can ship tomorrow
Pessimistic Tester: Fixing this one bug will likely lead to two more

Optimistic Developer: Stop finding bugs, or we'll never be done
Pessimistic Tester: Stop creating bugs, so I can find them all

Optimistic Developer: There's no need for more tests
Pessimistic Tester: Let's just run a few more tests to be sure

Optimistic Developer: There is no I in TEAM
Pessimistic Tester: We can't spell BUGS without U copyrightjoestrazzere

Optimistic Developer: That's an "undocumented feature"
Pessimistic Tester: That's a bug

Optimistic Developer: I like to build things
Pessimistic Tester: I like to break things

Optimistic Developer: Sure, we can use the Beta version of this component in Production
Pessimistic Tester: We should wait until version 2.1

Optimistic Developer: Willing to bet that there are no more bugs
Pessimistic Tester: Willing to take that bet

Optimistic Developer: Let's slip these changes in now, because I'm starting my vacation tomorrow
Pessimistic Tester: Let's not

Optimistic Developer: That will never happen in Production
Pessimistic Tester: Never is a long time

Optimistic Developer: It works on my machine
Pessimistic Tester: Perhaps your machine is the only one where it works?

Optimistic Developer: The sun'll come out, tomorrow...
Pessimistic Tester: Raindrops keep fallin' on my head...

Optimistic Developer: I'm a Realist
Pessimistic Tester: I'm a Realist

And here's a slideshow version, in case you need it:

September 29, 2008

Perhaps They Should Have Tested More - Skynet

What's wrong with advanced artificial intelligence systems these days?

It's no surprise that self-aware systems will always turn on their creators - anyone could see that coming.  But buggy robots?  There's just no excuse.
  • A robot forgets who she is
  • Malfunctions cause her to flip from protecting John to attempting to assassinate him
  • Another software glitch causes gynoid Cameron to go missing
  • A software glitch causes her to wreck her shopping cart into a display of watermelons at the grocery store
Perhaps they should have tested more?

Oh wait, they still can!  Just go back in time and do the testing that they should have done in the first place.

And if you can go back in time, why can't they go back and avoid the bugs altogether?

I guess the future just isn't what it used to be.


September 15, 2008

Join ASQ, Earn More Money?

Like many of you, I get a lot of QA-related email.

An email I received recently from the American Society for Quality (ASQ) titled "Want the potential to earn more money?" says:
"Research shows people who joined associations have experienced increased job satisfaction, earn more money, and are generally happier*. An ASQ membership can help by giving you the tools you need to become successful in your industry and differentiate you from the competition. So why wouldn’t you want to be a part of ASQ?

Have the opportunity to meet, communicate, and collaborate with your peers within the quality community through conferences, local section meetings, ASQ forums or divisions, ASQ Communities of Quality discussion boards, and more.
Take this opportunity to be an integral part of the recognized leader in quality and be happy as an ASQ member. Visit and use priority code XXXXXXX to join today.

*2008, The William E. Smith Institute for Association Research"
The clear implication from the title and the text is - join ASQ and you will earn more money.

But when I searched for this "research", I found that the press release from The William E. Smith Institute for Association Research itself makes it clear that this is not a cause-effect relationship:
"The report reveals that, on average, association members earn higher salaries, like their jobs more and are happier people than those who do not join  associations. Rather than suggesting that association membership itself leads to success, the report concludes that success in one's profession increases the likelihood of joining an association."

Now I'm sure this is just a bit of sales puffery, right?

After all, a group that bills itself as "the world's leading membership organization devoted to quality" and which requires its members to be "honest and impartial in serving the public, their employers, customers, and clients" wouldn't intentionally mislead people, would they?

I'm sure there are good reasons to join ASQ.  But I'm not sure that this research provides any compelling reason to do so.

(If I read research which indicates that owners of Rolls Royces earn 50% more than the average, should I go out and buy one in hopes of increasing my salary?  Or, perhaps I should just hang around and collaborate with people who already own one?)

September 6, 2008

Let's All Play Crash That Browser - Google Chrome

Note: Typing nothing more than :% into the Chrome address bar will crash the entire browser.

Tom:   It's time once again to play America's favorite game show - Crash That Browser!

Tom:   With us today we have a new contestant - Google Chrome.  Is it ok if I just call you Chrome?  Alrighty then.  Tell us a bit about yourself, Chrome.

Chrome:   Why thanks, Tom.  Yes, I'm the new browser on the block.  And I combine minimal design with sophisticated technology to make the web faster, safer, and easier.

Tom:   Well isn't that interesting.  So Chrome, are you actually in production now?

Chrome:   Well, of course I'm still in (BETA), but I am part of the Google family, and my cousin Gmail is still in Beta too (wink, wink, nudge, nudge, know what I mean).

Tom:   Why are you winking at me?  Stop that!  Oh, I get it!  Anyway, so tell us something interesting about yourself.

Chrome:   Tom, one of my features is Crash Control.  Each tab is a separate process.  That way every tab you're using is run independently in the browser, so if one app crashes it won't take anything else down.

Tom:   Good for you!  Good for you!

Chrome:   And of course, we're Google, so our slogan is "Don't be evil (BETA)."

Tom:   Great, great.  So let's get to the game.  Chrome, how many keystrokes will it take to crash you?

Chrome:   Ha!  Tom, I don't think you can crash me in 32K keystrokes.  After all, I'm a fresh take on the browser, started from scratch and built on the best elements out there.

Tom:   Wow, that's quite a bold prediction.  How about if we start just a bit smaller?  How about two keystrokes?

Chrome:   Well, you can try, but as I said, my technology allows me to prevent one tab from crashing another.  Give it your best shot, Tommy boy.

Tom:   Ok, here goes...


Chrome:   Whoa!  Er, uhm, (cough) I think Google Chrome has crashed. Is the camera rolling (gasp)?  Can I just Restart now, Tom?  Please (gurgle)?

Tom:   Sorry, Chrome - that's all we have time for.  Bye, bye folks!  Thanks for playing along.  Join us again next week at this time and we'll all play Crash That Browser!


September 17, 2008 - an update:

So the good news is that as of build, this bug is fixed.
The bad news is - other side-effects.

Try this:
  1. Clear Chrome's browser history
  2. Type :% in the address field
  3. In the dropdown list that appears below the address field, select the ":%" entry, and press Enter.
On my system at least, I get a dialog box indicating that Chrome must "launch an external application" to handle this link. That's odd.  The dialog seems rather ominous.  Am I under attack?  Should I notify Homeland Security, or just hide under my chair?

And it is missing the name of the application which will be launched. Hmm... An application with no name!  Didn't America sing that song?  In the desert, you can remember your name...  

And clicking the Launch Application button doesn't actually do anything. Well, it seemed promising.  At least it didn't do anything evil... or did it?

Oh, Snap! Welcome to Google Chrome (BETA)

Care to play Crash That Browser?  If you know how to crash a browser (any browser), send me a note and I'll post it.

August 14, 2008

Perhaps They Should Have Tested More - Netflix

Still waiting for your copy of Rambo, 27 Dresses, or The Bucket List to arrive from Netflix?  You may be waiting a while, and you may not be alone.

If you were expecting to receive your Netflix DVDs in the past few days, you may need to wait a bit.
  • Its worst technical outage ever
  • All 55 shipping centers affected
  • Three days of missed DVD shipments
  • May lose $1.8 to $4.6M in revenue
Perhaps you should consider watching preseason Football instead?

From Netflix:
"We were able to ship some DVDs from about half of our distribution centers yesterday but we haven’t yet been able to resume shipping this morning. Our engineers continue to work around the clock to restore normal operations. In the meantime, we’re notifying affected customers via personal email and we’ve posted a notice on the Netflix Web site. We’re as frustrated about this as you are and we once again apologize for the inconvenience."
See also:

August 12, 2008

Perhaps They Should Have Tested More - VMWare

Not quite a Year-2000 bug - more like a Year-2008, Month-August, Day-12 bug.

If you were unlucky enough to download VMWare's ESX 3.5 update 2 in the past few weeks, you got a nasty surprise today when you tried to power on one of your virtuals:
"A general system error occurred: Internal Error."
And if you peeked into the logs, you might have seen:
http://msg.License.product.expired This product has expired.
(even though nothing was supposed to actually expire.)

Sorry - your VMs will no longer power on.  Oops!  Hope that isn't too important for you...

CEO Paul Maritz indicates that a leftover piece of pre-release code was to blame.
"Last night, we became aware of a code issue with the recently released update to ESX 3.5 and ESXi 3.5 (Update 2). 

When the time clock in a server running ESX 3.5 or ESXi 3.5 Update 2 hits 12:00AM on August 12th, 2008, the released code causes the product license to expire.  The problem has also occurred with a recent patch to ESX 3.5 or ESXi 3.5 Update 2. 

When an ESX or ESXi 3.5 server thinks its license has expired, the following can happen:
---- Virtual machines that are powered off cannot be turned on;
---- Virtual machines that have been suspended fail to leave suspend mode; and,
---- Virtual machines cannot be migrated using VMotion.

The issue was caused by a piece of code that was mistakenly left enabled for the final release of Update 2.  This piece of code was left over from the pre-release versions of Update 2 and was designed to ensure that customers are running on the supported generally available version of Update 2. 

In remedying the situation, we’ve already released an express patch for those customers that have installed/upgraded to ESX or ESXi 3.5 Update 2.  Within the next 24 hours, we also expect to issue a full replacement for Update 2, which should be used by customers who want to perform fresh installs of ESX or ESXi. 

I am sure you’re wondering how this could happen.  We failed in two areas:
---- Not disabling the code in the final release of Update 2; and
---- Not catching it in our quality assurance process. 

We are doing everything in our power to make sure this doesn’t happen again. 

VMware prides itself on the quality and reliability of our products, and this incident has prompted a thorough self-examination of how we create and deliver products to our customers.  We have kicked off a comprehensive, in-depth review of our QA and release processes, and will quickly make the needed changes.  

I want to apologize for the disruption and difficulty this issue may have caused to our customers and our partners.  Your confidence in VMware is extremely important to us, and we are committed to restoring that confidence fully and quickly.

Thank You,
Paul Maritz
President and CEO "
From Gary Chen, a senior analyst with Yankee Group:
"Software will always have bugs, but a widespread issue like this that affects all VMs is really damaging, especially at this point in time where virtualization is starting to take off. VMware is going to have to fix this fast, provide an explanation, and outline what they will do to strengthen their QA in the future."
From the VMWare web site:
"An issue with ESX/ESXi 3.5 Update 2 causes the product license to expire on August 12, 2008. VMware engineering has isolated the root cause of this issue and will reissue the various upgrade media including the ESX 3.5 Update 2 ISO, ESXi 3.5 Update 2 ISO, ESX 3.5 Update 2 upgrade tar and zip files by noon, PST on August 13.  These will be available from the page:  Until then, VMware advises against upgrading to ESX/ESXi 3.5 Update 2."
What if you've already upgraded to 3.5 Update 2?

Well - sorry about that. 
Perhaps you'd like to set your clock back for a while? 
Might I suggest January 1, 2000 as a handy target date?

See also:

August 11, 2008

WinTask - Getting Properties of Objects

When using WinTask as a test tool, we often want to get a property (text, selection, etc) from an object.  Here are some methods to do so.

' Getting Properties (text, etc) from various objects
' Author: Joe Strazzere

' Get Text from a multiline edit box
result_capture$ = Capture$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1,1)
' Get Text from an edit box
result_capture$ = Capture$("NOTEPAD.EXE|Edit|Find|1",1,1)

' Get Seletion from a ComboBox
result_capture$ = Capture$("NOTEPAD.EXE|ComboBox|Font|5",1,1)
' Get the text from a ComboLBox
result_capture$ = Capture$("NOTEPAD.EXE|ComboLBox|Font|1",1,1)
' Get the text from a Static field
result_capture$ = Capture$("NOTEPAD.EXE|Static|Microsoft ® Notepad",1,1)
' Get the text from a SysListView32 control
result_capture$ = Capture$("NOTEPAD.EXE|SysListView32|FolderView",1,1)

' Get the nth item from a ComboBox
var$ = ListItem$("NOTEPAD.EXE|ComboBox|Page Setup|1",2)
' Get the nth item from a Listbox
var$ = ListItem$("NOTEPAD.EXE|ListBox|About|1",2)

' Get the Selected item from a ComboBox
var$ = SelectedItem$("NOTEPAD.EXE|ComboBox|Page Setup|1")
' Get the nth item from a Listbox
var$ = SelectedItem$("NOTEPAD.EXE|ListBox|About|1")

' Check for the existence of a given window
ret = ExistW("NOTEPAD.EXE|Button|OK")

' Determine if a Checkbox is checked or not
ret = CheckedW("NOTEPAD.EXE|Button|Match &case")
' Determine if a Radio Button is checked or not
ret = CheckedW("NOTEPAD.EXE|Button|P&ortrait")

' Determine if a given window is enabled or not
ret = EnabledW("NOTEPAD.EXE|Button|&Find Next")

August 1, 2008

Patriots Training Camp 2008

Took a day off from work and made our annual trip to the New England Patriots Training Camp.

In the morning, they held a walkthrough in t-shirts and shorts. In the evening, they were in full pads and helmets.

A few observations:
  • The new "Patriot Place" currently being built is going to be rather special. The Hall of Fame looks really nice and the CBS Scene restaurant will be amazing. Where Gillette Stadium used to look like a football stadium in the middle of nowhere, it now looks like a football stadium in the middle of a shopping plaza. Quite a change.
  • Randy Moss catches a football far more smoothly than anyone I've ever seen. Watching him catch a football gently in his hands, then watching someone else catch with their arms is like watching two totally different physical actions.
  • The new first-round draft pick - Jerod Mayo - looks fast. He also doesn't look out of place while playing inside linebacker with the first string defense.
  • During the morning walkthrough, you could see what the players actually look like without all the padding and helmets. For example, Lawrence Maroney looks skinnier than I would have expected, while Kyle Eckel was much more solid than expected.
  • During the evening session, the Pats conducted 2-minute drills. Brady led the offense downfield, but wasn't able to score in the required time. Needless to say, he was extremely unhappy about that!
While I don't want to wish the summer away, the yearly camp visit really makes me look forward to the start of football season!

July 10, 2008

Vacation in Maine 2008

For the second year in a row, we spent the July 4th holiday week in York, Maine, right across from Long Sands.

(York, Maine)

Again, a really nice, relaxing week.

We went for long walks every day, and spent some time on the beach almost every day.  We met up with some family, and some friends.

My son got to enjoy some surfing.  My wife got to enjoy some shopping.

And one of the things I enjoy for summer vacation is the time I get to read.  I went to the bargain bin of the local Barnes & Noble, picked up some interesting books, and wasn't disappointed.  I was able to read three books:
  • The Cosmic Landscape: String Theory and the Illusion of Intelligent Design by Leonard Susskind
  • Romo: My Life on the Edge: Living Dreams and Slaying Dragons by Bill Romanowski
  • The Brothers Bulger: How They Terrorized and Corrupted Boston for a Quarter Century by Howie Carr
We also decided to eat at a close-by restaurant for the first time.  It turned out to be a very pleasant surprise.  We've driven by over the years, and based on the take-out window, it appeared to be nothing more than a typical clams-and-burgers joint.  But inside it was far more up-scale that we imagined.  We had some really good seafood - some asian tuna, lobster chowder, etc, and good steak tips.  The waiter (from Senegal) was attentive.  They had a nice selection of beverages.  We ended up going back a second night.  I file this one in the "can't judge a book by its cover" category.

Another nice vacation.

June 26, 2008

WinTask - Undocumented Workarounds

As with any tool, there are a few undocumented problems and limitations in WinTask.

Here are some that I know about.  I'll add more as I learn of them.
(last updated: December 30, 2009)

#ScriptAfterTimeout$ does not allow you to use a .rob file name containing a space. It works correctly if the .rob doesn't contain any spaces in the file name.

So this will not work:
#ScriptAfterTimeout$="After Timeout"
#ExecTimeout = 20

Pause 30 secs
WinTask Tech Support says that the " needs to be doubled:
The " needs to be doubled, so try:
#ScriptAfterTimeout$=chr$(34)+"After Timeout"+chr$(34)
and it will work.
In version 3.5a, it doesn't appear that the CAPTION statement works correctly in dialogs.

For example, the titlebar of this dialog won't show any caption, even though it should show "My Caption is Here":

    BEGINDIALOG Dialog 465, 387, 350, 220
    CAPTION "My Caption is Here"
    DEFPUSHBUTTON "&OK", btnOK, 137, 157, 75, 23

    CallDialog Dialog

The workaround is to remember to use the optional Title$ argument in every CallDialog statement:

    CallDialog Dialog,"My Caption is Here"

Note: This has been fixed in subsequent versions.
The <mode> argument in the Capture$() function cannot be a variable.  It must be a constant.

So something like this will not work
var = 0
Capture$("window name",1,var)
It will get the following syntax error:
A number is expected
As a workaround, you could create a function like this and use it in place of Capture$:
Function MyCapture$(window_name$, instance, mode)
Local a$
  Select Case mode
    Case 0
        a$=Capture$(window_name$, instance, 0)
    Case 1
        a$=Capture$(window_name$, instance, 1)
    Case 3
        a$=Capture$(window_name$, instance, 3)
    Case 5
        a$=Capture$(window_name$, instance, 5)
    Case 7
        a$=Capture$(window_name$, instance, 7)
    Case 9
        a$=Capture$(window_name$, instance, 9)
    Case Else
        a$=Capture$(window_name$, instance, 0)
MsgFrame() cannot display an ampersand (&) as part of the text.

So, MsgFrame("A&B",1) will just display "AB"

WinTask Tech Support says to use two & characters instead of one
In the Windows control which is used for MsgFrame/MsgFrameTitle, the & is a special character (keyboard shortcut underlined). So to force the display of this character, you need to double the &
MsgFrameTitle() cannot display an ampersand (&) as part of the text.

So, MsgFrameTitle("The Title","A&B",1) will just display "AB"

WinTask Tech Support says to use two & characters instead of one
In the Windows control which is used for MsgFrame/MsgFrameTitle, the & is a special character (keyboard shortcut underlined). So to force the display of this character, you need to double the &
MsgFrameTitle("The Title","A&&B",1)

June 22, 2008

Book: High Performance Web Sites: Essential Knowledge for Front-End Engineers

In High Performance Web Sites: Essential Knowledge for Front-End Engineers Steve Souders explains that at least 80 percent of the time it takes to display a web page happens after the HTML document has been downloaded, and describes the importance of the techniques in this book.

From the author:
"After two quick introductory chapters, I jump into the main part of this book: the 14 performance rules. Each rule is described, one per chapter, in priority order. Not every rule applies to every site, and not every site should apply a rule the same way, but each is worth considering. The final chapter of this book shows how to analyze web pages from a performance perspective, including some case studies."

HTTP Overview provides a short description of HTTP, highlighting the parts that are relevant to performance.

Rule 1: Make Fewer HTTP Requests, describes why extra HTTP requests have the biggest impact on performance, and discusses ways to reduce these HTTP requests including image maps, CSS sprites, inline images using data: URLs, and combining scripts and stylesheets.

Rule 2: Use a Content Delivery Network, highlights the advantages of using a content delivery network.

Rule 3: Add an Expires Header, digs into how a simple HTTP header dramatically improves your web pages by using the browser's cache.

Rule 4: Gzip Components, explains how compression works and how to enable it for your web servers, and discusses some of the compatibility issues that exist today.

Rule 5: Put Stylesheets at the Top, reveals how stylesheets affect the rendering of your page.

Rule 6: Put Scripts at the Bottom, shows how scripts affect rendering and downloading in the browser.

Rule 7: Avoid CSS Expressions, discusses the use of CSS expressions and the importance of quantifying their impact.

Rule 8: Make JavaScript and CSS External, talks about the tradeoffs of inlining your JavaScript and CSS versus putting them in external files.

Rule 9: Reduce DNS Lookups, highlights the often-overlooked impact of resolving domain names.

Rule 10: Minify JavaScript, quantifies the benefits of removing whitespace from your JavaScript.

Rule 11: Avoid Redirects, warns against using redirects, and provides alternatives that you can use instead.

Rule 12: Remove Duplicate Scripts, reveals what happens if a script is included twice in a page.

Rule 13: Configure ETags, describes how ETags work and why the default implementation is bad for anyone with more than one web server.

Rule 14: Make Ajax Cacheable, emphasizes the importance of keeping these performance rules in mind when using Ajax.

Deconstructing 10 Top Sites, gives examples of how to identify performance improvements in real-world web sites.
The book is a quick read containing some good hints and tips.  Many are fairly easily investigated and implemented in most companies.

Seemingly out of place, however, is Rule 2: Use a Content Delivery Network.  While it's certainly a good way to improve performance, it's not something every company can afford.

Overall, an interesting book.

June 10, 2008

WinTask - Getting the Path to Your Script

Command$(0) returns the full path and file name of your script.

So this:
will extract the path to your script from Command$(0).

See for yourself:

WinTask - Initializing a String Array

You can initialize each element in a string array with the same value in one line as follows:
Array$() = "value"
And of course you can initialize a string array to all nulls this way:
Array$() = ""
To assign different values to each array element, you could use something like:

May 17, 2008

A Picture Is Not Worth A Thousand Words

Occasionally, I see a bug report with little more than a picture attached.

The bug reporter is basically saying "Here's a picture.  The bug is self-evident."  But for a good bug report, that is simply not good enough.

A picture doesn't explain how we got there
In all bug reports, I want to see a step-by-step procedure on how to reproduce the problem being reported.  I don't want the  persons doing the debugging to have to guess.  And I don't want them to turn the bug report around as Not Reproducible.  That would just waste everyone's time.
A picture doesn't explain what is right, and what is wrong
I'm sure the bug is totally obvious to the person who wrote the bug report.  But it may not be so obvious to me, it may not be obvious to the person attempting to debug the problem, and it may not be obvious at all to someone reviewing bug reports some time down the road.  State what actually happened.  Use words that the reader will understand.
A picture doesn't explain the expected result
A good bug report states what was expected to happen versus what actually happened.  Maybe your expectations were wrong? A picture can't explain that. copyrightjoestrazzere
A picture doesn't help when searching
One occasionally-overlooked aspect of a well-written bug report, is that it can be easily found by a search.  If someone else encounters the same (or a similar) bug, I want them to find this bug report.  If they have more symptoms, they could add them here.  If not, they can see the current state or resolution of the bug report.  I want to avoid duplicate bugs whenever possible.  Adding text here about the symptoms, error messages, log files, and such is far more useful in that regard than a picture might be.
Is a picture helpful?  Yes, it is.  Sometimes it is even critical to solving the problem at hand.

Does the picture replace 1000 words?  No.  Not when used in a well-written bug report.

You Might Be In Quabbity Assurance If...

One television program that both my wife and I really enjoy is The Office.  And of course, my favorite character is Creed Bratton - the Director of Quality Assurance.

In this season's final episode, a new HR Director joins the office.  When Creed greets her, she asks what he does.  Creed (who has a severe memory problem) doesn't answer her.  Instead he goes off by himself and struggles to come up with the answer.
What's with this woman?
She's asking things that are none of her business!
What do I do here?
I should have written it down!
Qua something, uh.
Qua, quar, quab...
Quabbity Assurance!
No, no... but I'm getting close...
You Might Be In Quabbity Assurance If...
  • If you like eating mung beans, even though they "smell like death", then you might be in Quabbity Assurance
  • If you have only 4 toes on one foot, then you might be in Quabbity Assurance
  • If you confess that you might have accidentally made love to a man in the 60's ("there'd be no way of knowing"), then you might be in Quabbity Assurance
  • If you faked your own death for tax reasons, then you might be in Quabbity Assurance
  • If you stole a laminating machine and used it to start a fake ID business, then you might be in Quabbity Assurance
  • If you get angry that a quality problem occurred during "the one year" you neglected to do your job, then you might be in Quabbity Assurance
  • If you have been a member of many religious cults, both as a leader and follower, then you might be in Quabbity Assurance
See also:

May 9, 2008

Perhaps They Should Have Tested More - Minnesota Dept. of Human Services

Five years, $8 million - and all I got was this lousy stethescope... and far too many bugs.

Minnesota State Human Services officials have abandoned their first attempt to develop an online health care signup system. 
  • A troubled project with shifting goals
  • The software was incomplete, error-prone and not always efficient to use
  • Officials decided to scrap software that had too many bugs
  • "We don't want to make the mistake of developing a system that won't work."
They plan to start over.  Perhaps (this time) they'll test more?

see also:

May 7, 2008

Perhaps They Should Have Tested More - Chrysler

Browsers crash, software crashes, and when the software is in an automatic transmission, sometimes cars crash too.

Chrysler has recalled over 24,400 Jeep Commanders to fix a software problem in the automatic transmission system which:
  • has endangered scores of Jeep owners
  • could cause a crash without warning
  • could have engines stalling at highway speeds
  • can cause a loss of electrical power and lighting

May 4, 2008

If Architects Had To Work Like Programmers

Here's the classic comparison of a Programmer's work to an Architect's work.

Please design and build me a house.  I am not sure of what I need, you
should use your discretion.  My house should have between two and forty-five
bedrooms.  Just make sure the plans are such that the bedrooms can be easily
added or deleted.  When you bring the blueprints to me, I will make the
final decision of what I want.  Also bring me the cost breakdown for each
configuration so I can arbitrarily pick one.

Keep in mind that the house I ultimately choose must cost less than the one
I am currently living in.  Make sure, however, that you correct all the
deficiencies that exist in my current house (the floor of my kitchen
vibrates when I walk across it and the walls don't have nearly enough
insulation in them.)

As you design, also keep in mind that I want to keep yearly maintenance cost
as low as possible.  This should mean the incorporation of extra-cost
features like aluminum, vinyl, or composite siding.  (If you chose not to
specify aluminum, be prepared to explain your decision in detail.)

Please take care that the modern design practices and the latest materials
are used in the construction of the house, as I want it to be a showplace
for the most up-to-date ideas and methods.  Be alerted however, that the
kitchen should be designed to accommodate, among other things, my 1952
Gibson refrigerator.

To insure that you are building the correct house for my entire family, make
certain that you contact each of my children and also my in-laws.  My
mother-in-law will have very strong feelings about how the house should be
designed, since she visits us at least once a year.  Make sure that you
weigh all these options carefully and come to the right decision.  I,
however, retain the right to overrule any choices you make.

Please don't bother me with small details right now.  Your job is to develop
the overall plans for the house, get the big picture.  At this time, for
example, it is not appropriate to be choosing the color of the carpet.  Keep
in mind, however that my wife likes blue.

Also do not worry at this time about acquiring the resources to build the
house itself.  Your first priority is to develop detailed plans and
specifications.  Once I approve these plans, however, I would expect the
house to be under construction within 48 hours.

While you are designing this house specifically for me, keep in mind that
sooner or later I will have to sell it to someone else.  It therefore should
appeal to a wide variety of potential buyers.  Please make sure before you
finalize the plans that there is a consensus of the population in my area
that they like the features this house has.

I can advise you to run up and look at my neighbor's house he constructed
last year.  We like it a great deal.  It has many of the features that we
would also like in our new home, particularly the 75-foot swimming pool.
With careful engineering, I believe that you can design this into our new
house without impacting the final cost.

Please prepare a complete set of blueprints.  It is not necessary at this
time to do the real design, since they will be used for construction bids.
Be advised, however, that you will be held accountable for any increase of
construction costs as a result of later design changes.

You must be thrilled to be working on as interesting a project as this!  To
be able to use the latest techniques and materials and to be given such
freedom in your designs is something that can't happen very often.  Contact
me as soon as possible with your complete ideas and plans.

PS  My wife has just told me that she disagrees with many of the
instructions I've given you in this letter.  As architect, it is your
responsibility to resolve these differences.  I have tried in the past and
have been unable to accomplish this.  If you can't handle the
responsibility, I will have to find another architect.

PPS  Perhaps what I need is not a house at all, but a travel trailer.
Please advise me as soon as possible if this is the case.
I'm not sure of the origin, since it has been posted so many times without attribution.

The earliest reference I could find was from March 1997:

May 1, 2008

Spam Turns 30!

If there's one thing worse than Spam, it's old Spam.

May marks the 30th anniversary of the first unsolicited commercial e-mail.

The first Spam was sent from a Digital Equipment Corporation marketer named Gary Thuerk, over ARPANET (precursor to the Internet) to a grand total of 393 individuals.

Here are the contents of that first Spam (with the To addresses removed):
"Mail-from: DEC-MARLBORO rcvd at 3-May-78 0955-PDT
Date:  1 May 1978 1233-EDT


               TUESDAY, MAY 9, 1978 - 2 PM
                   HYATT HOUSE (NEAR THE L.A. AIRPORT)
                   LOS ANGELES, CA

               THURSDAY, MAY 11, 1978 - 2 PM
                   DUNFEY'S ROYAL COACH
                   SAN MATEO, CA
                   (4 MILES SOUTH OF S.F. AIRPORT AT BAYSHORE, RT 101 AND RT 92)

Although the term "Spam" wasn't used at the time, this was believed to have been the first.

Today, some estimate that over 150 billion spam messages are sent every day.

And the Vikings sing: Spam spam spam spam. Lovely spam! Wonderful spam! Spam spa-a-a-a-a-am spam spa-a-a-a-a-am spam. Lovely spam! Lovely spam! Lovely spam! Lovely spam! Lovely spam! Spam spam spam spam!


April 27, 2008

Perhaps They Should Have Tested More - Dilbert

An industry heavyweight releases a new version of their system.  It provides a bunch of new features, but with a dramatically different user interface, that seems to confuse most users.  The new release is much slower than the old release, and it seemingly drops support for some user platforms.  The vendor immediately promises to patch the release, but has already alienated some of the user base.

Microsoft?  No, it's Dilbert!

Recently, Scott Adams and the Dilbert team redesigned the site.  And while it's been called a Beta version, the old Production version of the site doesn't appear to be running any longer.  I know it's stretching the point, but this would be like Microsoft releasing a Beta version of Vista (and assuring users to "Please be patient"), while simultaneously causing XP to disappear from everyone's desktop.

Here's the hype:
Welcome to the almost-too-incredible-to-believe BETA version of the new Dilbert web site! We spent most of the past year, and a small fortune, to unwrap all the pent up Dilbert goodness and provide it to you for free, embracing the new realities of intellectual property on the web.

The site is still in BETA. You're getting a preview of future wonders. Please be patient. This is a generation beyond any comic web site, and it gets bumpy when you pass beyond the rim. Take a sneak peek at these new features:

PUNCH LINES: Write your own punch lines for Dilbert strips - just type them right into the panel - and e-mail them to friends!

Soon you will be able to write the entire strip, collaborating with others, in what we call Group Mash! (One person writes the first panel, another writes the second, and so on.) Readers can vote the best ones to the top of the heap. That way you get the attention and credit you need to make life worth living.

Starting today, mocking the idiots in your workplace is a competitive sport! This is going to be fun. I'll participate in the Punch Lines and Group Mashes too. Look for my contributions under username ScottAdams.

ANIMATION: We've animated Dilbert online. Several strips are already done and we plan to add one per day. You have to hear the new voice for Dogbert.

FAVORITE LISTS: Create lists of your favorite Dilbert comics and share with others.

ARCHIVE EXPANDED: Now the free Dilbert archive extends back to 2001. We're working on putting the entire archive online.

COLOR: All online strips are in living color. They look sensational.

SEARCH: Filter the archive by favorite characters. For example, find all the comics in the archive featuring Dogbert or Catbert or Asok, etc., plus any combination of characters.

DILBERT BLOG: My personal blog is moving to this page. And you'll be able to vote on comments, so the wisest and funniest float to the top.
And here's a sampling of the reactions:
"The new animation feayture is unneeded, unwanted, and unloved."

"I'm not sure if the new website is a parody on Microsoft and their ilk, or simply following in their best traditions.

You release the thing, it is full of bugs and works badly so you promise to fix it in a while. Could be the latest version of the Dilbert web site or the latest version of Windows. I look forward to the day when everything else, cars, toasters, books etc, is produced this way."

"Did Scott Adams contract site design out to Dilbert's company?"

"Please tell us that this blog entry was written for you by the Marketing department, and that you yourself are just as shocked and appalled at this unusable mess as the rest of us are."

"I'm sure you all spent a lot of time on it so I don't think you will change back anytime soon but really, this is another case of "you tried to fix something that isn't broke". Very Dilbert."

"Your developers and deployment staff seem to have totally thrown this out. This _isn't_ a beta, this is a live deployment, and as such the 'Beta' image should be removed. It's not cool. Neither is the new format - it is offensive to the eye, difficult to navigate, and has suffered an ill-thought-out roll-out."

"I've worked in IT for 25 years now, and Dilbert has kept me sane throughout that time, but I never thought that Dilbert's own web site would become like one of it's own jokes."

"I'm disappointed to find that the animations are Windows/Mac only. I was looking forward to watching them, only to be told that my Linux isn't supported. Please change this so you don't loose your Linux-using audience."

"It's big, it's bloated, and I don't like it at all. I'm hoping against hope that it's some PHB-inspired, time-delayed April Fools joke of some sort that is some artistic attempt at satire and irony."

"Sorry but the new site is hideous. It takes forever to load, is infested with Flash and generally looks vile."
Then comes an "apology" of sorts from Scott Adams, while hinting that maybe this bloated Beta wasn't such a bad thing:
Our web site upgrade (BETA) reminds me of a local restaurant in my area. The owner painted the storefront a hideous purple, the sort of color that is an insult to all buildings. He did it without city approval, and it got the residents up in arms. Everyone was talking about the restaurant with the awful color. A month later, the owner repainted with an inoffensive color and everyone was happy. In the meantime, the controversy made this restaurant universally known in the area. I drove past it the other day and it was packed. Damn, I wish I had thought of that idea with my own restaurant.

We weren't nearly that clever with our web site redesign, but something like the purple restaurant happened by accident. The majority of people who left a comment had bitter (and totally valid) complaints. We used way too much Flash, the servers slowed to a crawl, the navigation of strips was klunky, and so on. We plan to fix all of that in the next week or two. The developers won't be getting much sleep. We've already made the site much quicker.

Meanwhile, traffic on doubled. And the new features, particular the Mash Ups and the archive search functions are a big hit. People either loved that the strips are now in color or hated it, but everyone had a strong opinion. That's what I love about Dilbert readers. It makes my job a lot more interesting.

Linux users were the most vocal in their complaints. (Who saw that coming?) Your numbers are small but your power is mighty. Just for you, we're working on a bare bones page with only the strips, text navigation, and not much else. Look for that in a week or so. You'll be able to jump from there to the main page if you want to experience the new features like regular folk.

In the meantime, you can always use the new (legal) Dilbert RSS feed. It's just the strips, the way you like it. Click here:

We appreciate all the comments. We're looking at them carefully and making changes. Some will say we shouldn't have inflicted this messy Beta version on the public. There's merit to that argument, but if I was worried about embarrassing myself in front of millions of people, I would need a new job.

Thanks for working with me through this upgrade. I apologize for the messy start.
And then another "apology" is written, while throwing a bone to the Linux audience:
Recently we redesigned the web site and added a ton of features, such as animation, deeper archives, mash ups, and more. The reaction from readers has been fascinating.

Let me get this out of the way: I realize the Beta version of the web site has lots of issues. It’s overloaded with Flash, slower than it needs to be, and the navigation is confusing. We’re fixing most of that over the next few weeks. I apologize for the inconvenience.

The fascinating thing about the responses is that it revealed three distinct types of Dilbert readers:

The first group is the ultra-techies who have an almost romantic relationship with technology. For them, the new site felt like getting dumped by a lover. Their high-end technology (generally Linux) and security settings made much of the site inconvenient. Moreover, the use of Flash offended them on some deep emotional level.

The second group objected to the new level of color and complexity, and the associated slowness. They like their Dilbert comics simple, fast, and in two colors. Anything more is like putting pants on a cat.

The third group uses technology as nothing more than a tool, and subscribes to the philosophy that more free stuff is better than less free stuff. That group has embraced the new features on the site and spiked the traffic stats.

For you first two groups, if you promise to keep it to yourselves, we created a stripped-down Dilbert page with just the comic, some text navigation, and the archive: This alternate site is a minor secret, mentioned only here and in the text footnote to the regular site as “Linux/Unix.”

The main site will be getting a Flash diet that will make it speedier soon, so check back in a few weeks. That’s where all the fun will be.
As an aside, I used HttpWatch to take a look at the "Beta/Production" site at as compared to the "/Fast" site at

The Beta/Production site:
  • took just under 14 seconds to load
  • downloaded about 700k
  • required 63 network round trips
The Fast site:
  • took just over 4 seconds to load
  • downloaded about 220k
  • required 12 network round trips
Perhaps a little usability and performance testing would have been in order before releasing the new Beta/Production version?

April 26, 2008

Book: How Long Is A Piece Of String? More hidden mathematics of everyday life

Rob Eastaway & Jeremy Wyndham

"How Long Is A Piece Of String?" is a book about the mathematics that underlies everyday life.  Written by the authors of "Why Do Buses Come In Threes?", it's a quick, interesting read.

Here are the contents:
Chapter 1 - Why Does Monday Come Round So Quickly? 
Chapter 2 - How Do Conmen Get Rich? 
Chapter 3 - What Makes a Hit Single? 
Chapter 4 - Why Won't the Case Fit in the Boot? 
Chapter 5 - Should I Phone a Friend? 
Chapter 6 - Is It Quicker to Take the Stairs? 
Chapter 7 - How Long Is a Piece of String? 
Chapter 8 - Why Do Weather Forecasters Get it Wrong? 
Chapter 9 - Will I Catch Flu Next Winter? 
Chapter 10 - Am I Being Taken for a Ride? 
Chapter 11 - Will I Ever Meet the Perfect Partner? 
Chapter 12 - Is It a Fake? 
Chapter 13 - Will the Underdog Win? 
Chapter 14 - Why Do Karaoke Singers Sound So Bad? 
Chapter 15 - How Can I Be Sure? 
Chapter 16 - Can I Trust What I read in the Papers?

In chapter 12 - "Is It A Fake?  Number tests that can detect the fraudsters" - the authors provide this nugget of information:

Everyone knows that typographical errors (called typos by those in the trade) are sometimes difficult to spot, so a printer might ask two proofreaders to read through independently to look for errors.
Suppose the first reader finds E1 errors and the second finds a different number, E2.  They now compare their results, and discover that some of the errors, a number S, were the same ones.  How many errors might they expect there to be in total? 
There is a way of making a good estimate, known as the Lincoln Index.  This says that the total number of errors in the manuscript will be roughly:
Expected Errors = (E1 * E2) / S
For example, suppose the first reader found fifteen errors and the second twelve, and that ten of the errors were found by both.  The Linoln Index predicts (15 x 12) / 10 = 18 errors in total.  Of these only seventeen have been found so far - ten found by both readers plus five more that only the first reader found and two more than the second found.
It occurs to me that this could be an interesting experiment in bug estimation.

Have two testers spend some time trying to find all the bugs in a piece of code, keeping the list of bugs found hidden from each other.  Then use the Lincoln Index formula to estimate how many have yet to be found.

I'll have to look for an opportunity to try this and see how well it works in the real world.

April 17, 2008

WinTask - A Better Way To Use Data Items From A Text File

When creating a WinTask script, I often want to put my data items in a text file external to my script.  That way, I don't have to modify the script to use a different set of test data.

Initially, I would read each data item from the file as I needed it

But, with larger sets of data items, this seemed slow.

So now, I read the entire set of data items into an array, then use the array elements as I need them.  This is much faster.

Another benefit is that I can now use the array of items in any order I choose.  Often I want to randomly pick one of the items and use it.

' Check performance difference between two methods of using data in a txt file
' Author: Joe Strazzere
Dim Items$(10000)   ' An array to hold the data items
file$="C: est.txt"   ' The file containing the data items

' This method simply reads an item from the data file when it is needed
Comment("Method 1 - Using each file item in turn")
' Comment(Var$)
Until eof(file$)=1
MsgBox("This method took "+t$+"/100 seconds to process "+i$+" items")

' This methods first reads all the data items from the file into an array
' Then, as each data item is needed, the corresponding array element is used
' Not only is this method faster, but it has the added advantage of being
' able to use the items in any order desired - even randomly
Comment("Method 2 - Using an array and SplitIntoArray")
Until eof(file$)=1
' Comment(Var$)
Until i > ItemCount
MsgBox("This method took "+t$+"/100 seconds to process "+i$+" items")