Fog Creek Software
g
Discussion Board




Unit testing ActiveX Controls

So everybody is writing unit tests except me.

I have started a pet project (meening I am steeling some of the time I should be spending with my wife to write software that will hopefully make my job more fun) which involves a ActiveX wrapper around the Scintilla control (http://www.scintilla.org).

Now, I am writing this in Visual Basic. So far all I have is about 50% of the interface definition and 50% of the documentation (I prefer to document a project before writing it and update that documentation if the implementation demands it).

I would like to use unit testing right from the start. I have never done unit testing and was very disapointed when vbunit 2 didn't install.

Does anyone know of a (free) unit testing framework for Visual Basic?

Does anyone know how to unit test an ActiveX Control? This should be different to unit testing other components, as ActiveX Controls expect user input via GUI.

Daren Thomas
Friday, October 24, 2003

I found this useful when I started writing tests for display code:

http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf

I blogged about how I used what it suggested in a C++ MFC GUI here:

http://www.lenholgate.com/archives/000152.html

Len Holgate (www.lenholgate.com)
Friday, October 24, 2003

You don't unit test UI. You acceptance test UI, which is a manual thing done by people. You can unit test everything right up until the point you display it on the screen and ask for user feedback, though.

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, October 24, 2003

VC6 has an ActiveX test container (tools menu).

Cubist
Friday, October 24, 2003

As Len recommended, testing GUI apps is difficult. I think a good approach is to break your GUI app into two parts: a very thin GUI layer and the big logical core. Design APIs for your core module so it can be tested programmatically. Then you only have to manually test your small amount of GUI code.

runtime
Friday, October 24, 2003

There's always the possibility of using a scripting language (such as WinBatch) to test your UI, but it can be a little delicate and very sensitive to design changes.

NC
Friday, October 24, 2003

I can give you some additional pointers:

http://c2.com/cgi/wiki?GuiUnitTesting
http://c2.com/cgi/wiki?GuiTesting
http://c2.com/cgi/wiki?TestFirstUserInterfaces

Giovanni Corriga
Friday, October 24, 2003

*  Recent Topics

*  Fog Creek Home