Sunday, August 25, 2002


A picture named 20mana.1.468a.jpg
Managing Planet Earth [New York Times: International News]

Interesting article - with this really great picture. I need to find a use for it.

[Andrew Bayer Is Dreaming of China]
9:32:47 AM    trackback []     Articulate [] 

Going to Koyasan. Engin01, the cultural non-profit that I helped start is having an offsite meeting at one of the most famous... [Joi Ito's Web]
8:28:56 AM    trackback []     Articulate [] 

Mark Twain. "He had discovered a great law of human action, without knowing it - namely, that in order to make a man or a boy covet a thing, it is only necessary to make the thing difficult to obtain." [Quotes of the Day]

8:23:44 AM    trackback []     Articulate [] 

That's a sparse August calendar over there on the right....

So things have settled down somewhat (I don't have to work both days of the weekend...).

UI Test Automation Under Windows

Today I started working on an MSAA (Microsoft Active Accessibility)-based .NET component to drive Windows UI with the aim of using it to do automated testing (among other things).  After playing around with a few different approches I have settled on this one:

I'm implementing the component using C++ and managed extensions.  I use the managed extensions primarily to provide the public interface to the component so that all .NET languages can use it.  Behind the public interface I'm doing everything using native code.  I'm doing it this way primarily because I don't know enough about .NET interop to do what I need to do (Plus, I'm well versed enough in what I have to do on the native side to write that code pretty easily.  The hard part so far has been marshalling native data to the managed side of things).

When testing UI, you basically need to do 2 things for any particular action: you have to 1) locate the object you want to query or manipulate and 2) do the query or action.  My approach to locating UI objects is to use a combination of Win32 and MSAA calls.

A Little Windows UI Background Info...

UI objects in Windows can be found using a tree structure with the root node being the desktop (actually, there can be multiple desktops but for simplicity's sake I'm ignoring that possibility for now).  There are two different tree hierarchies that can be used to navigate to UI objects in Windows: 1) the window hierarchy (using Win32 HWND's) and 2) the MSAA hierarchy (using IAccessible COM object pointers).

The window hierarchy is composed of window objects.  The API's to traverse and manipulate this hierarchy have been around for a long time (all the way back to Win16...).  Since this stuff dates back to when machine resources were precious, this stuff is fast and lightweight.  The only problem is that there have been technologies that have been implemented that don't use Windows windows for UI.  Windowless COM controls are one example.  HTML pages are another.  Dialogs implemented by MS Office applications are a third.  These technologies draw their own controls on a pane that is a single Windows window.  The Win32 APIs can't get you to these kinds of non-Windows-window-based controls and windows.

Enter MSAA.  There is a group in Microsoft that is very concerned about computing for the disabled (check out http://www.microsoft.com/enable).  Accessibility aids (like screen readers for the blind) traditionally used the Win32 API to query and manipulate UI but the newer technologies that bypassed standard Windows windows (and in the process the Win32 API) made this impossible.  So the accessibility group defined a technology that would allow custom UI implementers to provide a way to programmatically work with their UI components.

It turns out that the needs of people making accessibility aids and the needs of people trying to implement automated testing tools are quite similar so this technology can be used to implement automated UI testing on Windows.

If you want to explore these two UI technologies there are tools that you can use to browse them.  On the Win32 side you can use Spy++ (this tool ships with Visual Studio).  The MSAA hierarchy can be looked at using the MSAA tools (available here).

More on my UI navigation approach next time...

[ronpih I guess...]
8:13:28 AM    trackback []     Articulate [] 

Blog for continuity.. AIESEC loses half of its workforce every year. Read how they're using weblogs to improve continuity, community, and productivity. [diJEST: a journal of extrapreneurial strategy and technology]
8:12:07 AM    trackback []     Articulate [] 

Great Developers.

So I'm sitting here thinking about What makes a Great Developer.

Everything Brad mentions in his post rings true in my ears. I even use a similar list when interviewing people. I score them. If they don't get a certain score, they are a NO HIRE. I'm going to add something to my list that I had thought about but never put a lot of weight in it. I'm going to add - "...some strong interest in an artistic pursuit, such as music, literature, poetry, etc.". This one will make for some interesting interviews. It allows me to really get at a person and what they are passionate about. I hate interviews where the person just sits there and answers all my questions correctly. They show no passion. I would much rather have a person be passionate and miss a few questions.

I remember one candidate that I interviewed loved putting together boat models. Not just any type of boat, the kind that you see in bottles. He started talking about that and lost all track of time. He explained to me the little details of making sure there aren't a lot of glue fumes in the bottle, etc. He was a HIRE in my book. But he blew it in the negotating of salary phase. Oh well...

Now just to poke a bit of fun ;-)

I quote - "A lean company needs to make sure that they hire only the most productive, self-directed, and creative development staff possible". I'm wondering, does a company ever state "Let's hire the least productive, wanderers, who couldn't have an original thought if it was implanted in their brain"? ;-)

Seriously though. All companies want to hire the best. But sometimes I think people have to step back and realize that people that think they are the best have huge egos. I used to work at a place like this. Everyone thought they were the best (including myself). And we were always trying to one up or show up our peers that nothing ever got done. It was the worst experience in my life. I'm still ashamed at myself for acting the way that I did.

The most important thing to me is this - culture. If the company wants to be successful, they have to have a culture that strives for a quality product, that strives to keep politics at a minimum and communication at a maximum, and that strives to realize that the people working for them have lives outside of work.

[News from the Forest]
8:09:44 AM    trackback []     Articulate []