How to implement __try __except in ML64 (MASM)

I’m currently working on a project that is requiring me to write a bunch of x64 assembly code.  One of the requirements that surfaced is that I needed to be able to trap exceptions in a specific block of code in the same way that __try / __except works in C++.  As it turns out,…

0

Beware of Auto-Reset Events (They Don’t Behave the Way You Think They Do)

So I just spent several days debugging an intermittent crash in some test code.  Part of the reason it took so long was because whoever wrote this code introduced a dependency on a legacy test component that was apparently so old that sources and symbols had disappeared.  So the first part of the diagnosis involved a bit…

4

Why Stepping Through Code Trumps Unit Testing

Over the past few years, there has been a big buzz about how writing unit tests (preferably via Test Driven Development) combined with code coverage is the silver bullet for keeping bugs out of the product.  While the benefits of unit testing are undeniable, there are quite a few folks out there who advocate unit…

3

Wither White-Box Testing?

I was recently reading JW’s blog post on Prevention vs. Cure: http://blogs.msdn.com/james_whittaker/archive/2008/07/24/prevention-v-cure-part-1.aspx and it set me off a bit.  The blog post talks about “developer testing” which got me thinking about one of my biggest gripes: the “Software Design Engineer In Test” title.  I hate this title because it implies that someone who does test development…

4

The Three Laws of Software Development

If you haven’t read The Pragmatic Programmer, by Andrew Hunt and David Thomas, I’d highly recommend it.  It puts a fresh coat of paint on many of the concepts discussed in Steve Maguire’s classic Writing Solid Code and Steve McConnell’s CodeComplete (both of which are must reads for any software developer).  Anyway, one of the…

3

Using a Custom Proxy For Interception

I’ve been working on a system that required intercepting the method calls in an object model; basically I was trying to use Aspect Oriented Programming to weave in some logging and verification code.  My first attempt was to simply add an object sink to a ContextBoundObject as discussed in the following msdn article: http://msdn.microsoft.com/msdnmag/issues/03/03/ContextsinNET/default.aspx. While…

3

Why UI Automation Is Not All That And A Bag Of Chips

I spent some time today looking at an issue on a Korean system where a test was searching for a specific item in a combo box.  The test would iteratively select each item in the combo box, examine it and continue looping until it found the right entry.  The only problem was, this particular test was failing. …

0

The Designer Process That Would Not Terminate (Part 2)

In my previous post (http://blogs.msdn.com/geoffda/archive/2007/08/31/the-designer-process-that-would-not-terminate.aspx) I talked about an issue where RCWs (Runtime Callable Wrappers) awaiting garbage collection were holding references to a COM object and preventing it from being deterministically shut down.  In this post, we’ll continue the discussion–this time focusing on how to use the debugger to track down such a problem. To facilitate this…

2

The Designer Process that Would Not Terminate

I recently was asked to take a look at some VSTO test automation that wasn’t behaving correctly on lab machines.  The test was fairly simple; it created a VSTO Excel project, dirtied the document, closed the designer window without saving, and then reopened the document to verify that it was not dirty.  However, it turned…

3