ActiveB controls in VB are great timekeepers, but they are the scourge of effective test-based development.
To effectively test the entire VB6 application, ideally you need to have a design in which the EXE is a thin shell on top of the ActiveX DLL that does all the work. Forms implement the interface and register in the DLL. Therefore, if you have an order entry form, it implements the IOrderEntryForm interface, and events will call methods in the OrderEntry class located in the MyAppUI dialog box.
To emphasize in Visual Basic 6, FORMS can implement an interface. The form is then registered with the user interface class in this LOAD event. Form events (such as MyButton_Click) invoke methods in the user interface class. A user interface class using form interface methods to change what is displayed. This is additional work, but it saves a lot of time for testing. Also maintenance, as you can change what the form looks like once the implemented interface remains the same.
It also means that before you have something like MYEXE-> MyActiveXDLL, you will turn into MYEXE-> MyUIDLL-> MyActiveXDLL.
For your test environment, you create an ActiveX DLL that mocks the user interface by creating classes that implement various forms of interface. The UI DLL knows no difference, and you have full control over which inputs are sent and what you are reading.
Please note that this type of design pattern is discussed here . I used it as the basis for developing and supporting my company's CAD / CAM application for metal cutting machines.
Third-party ActiveX controls are a bug in this scheme. This is because the heavy lifting code is inside the control itself. The more complex the ActiveX control, the worse the problem. The trend in my company is to reduce our dependence on third-party controls for internal applications.
However, like any algorithm and design pattern, this involves a challenge. How many problems you get in the area of ββyour software using advanced text control. If not so much, you can leave with the test script both manual and automatic (i.e., sending strokes to the application) and use unit test for the rest.
A critical element of using Unit Testing of your FULL application is overlaying as much as possible on the interfaces. Just do what you can at the moment, and pay attention to those areas that you want to change when you develop in the future. Do not despair if you do not have 100% coverage right away or even the next year.