I was xcopying some folders this weekend. (xcopy: the poor man's backup system.) Everything was going swimmingly. Or so I thought, until I noticed that some files that should have been copied weren't.

What!? xcopy has never failed me before! What's going on?

So I tried it again, more targeted than the original command since I knew about where it stopped working.

"Insufficient memory."


Does it mean the destination drive is full? No, there's plenty of space left. Does it mean I'm trying to copy too many files at once? This particular set of files is much smaller than others that copy just fine, so probably not.

I binary searched my way down the file system trying to identify which files were causing the problem. Eventually I narrowed in on one particular folder that seemed to be the culprit. If I deleted it, the original command worked. If I xcopy'd just that folder, I got the error.

Hmmm...how was this folder different from the others that worked? I tried various things but didn't see any pattern. I suspect that the problem is related to folder name and/or file name length but was unable to confirm that suspicion. Finally I gave up and just copied that folder manually.

I would call this a bug in xcopy. If I am hitting some maximum path length (hmmm...MAX_PATH perhaps?) then it may actually be spec'd behavior that seemed reasonable back in DOS days and has never been updated since. Regardless, "Insufficient memory" is a very ambiguous error message. In this case I think it's not even correct, but I really don't know. This is almost as useless as the message box I once received that contained no caption and no contents whatsoever except for an OK button. Error messages like these drive users nuts.

This is why basing feature work on user scenarios is so important: you have to understand what the user is attempting to do in order to build something they will use. This however is also why thinking outside the spec is incredibly important if you want a well-tested feature: you know what the spec says the feature should do, but your customers don't know this nor do they really care. Customers are going to use (abuse) that feature in amazing ways. Each time they think of something that you haven't they are going to run into bugs, some of which will be heinous enough to make that customer defect to your competitor. This is a Bad Thing -- in my world, at least.

Test until you're confident that you've  found every last bug, then be prepared to help your customer when they find one you missed. Because you've never found them all.

*** Comments, questions, feedback? Want a fun job on a great team? Send two coding samples and an explanation of why you chose them, and of course your resume, to me at michhu at microsoft dot com. I need a senior tester and my team needs program managers. Great coding skills required for all positions.