Saturday, August 21, 2010

Visual Unit Testing Work

NaroCAD test suite cover basic functionality, that try to guarantee a crash free experience in most of simple cases (creating of basic tools, loading a file, save it, do an Undo/Redo, and so on). Still some issues may be there, but the future builds will be less crash proof, to say so.

Anyway, being more crash resistant (thank you for all users that did sent bug reports when NaroCAD crashes, they were great startup cases to us to see what was happening), will not necessarily mean that NaroCAD will bring a smooth experience.

So I will dedicate time to make a visual unit test that will try to reduce NaroCAD to "bare metal". Also, I will try to reduce the interactions that can get out of hand in NaroCAD code flow that make two problems to seem to be interrelated: is hard to make a unit-test in first hand, also is hard to get right all components relations to be workable.

Half of reason is that some parts of code (mostly meta-actions) they do connect to everything NaroCAD provides, and they interact all with all. This makes fairly hard to fix some bugs as some components fixes tend to break other components.

Another part of the problem is that some parts are interrelated by design, like a mouse coordinate have to get aligned with shapes around, but from unit test standpoint, it is hard to provide a big component as is the solver (which is a fairly big component) just to test if two click will create a line or not. So I will investigate and I will try to make the relations between components explicit and minimalistic and I will try a way to make creation of a fake (empty) solver component short code-wise.

At the end I want to make possible to make a script to be run in unit test, that will say: click, mouse down, coordinate that, component mouse-input, and also this test to run in a visual way, so the person which test this component, will be able to see if the line will be created. The steps should have a configurable speed (like 500 ms), but for certain to test a long test case, will be less annoying than to do it manually and to see that you did select a wrong component, instead the XOY rectangle, you clicked YOZ one, so you will have to redo the test. If you will have more than 5 steps, it will be really annoying to repeat a step that should work from scratch.

Also, but I will not guarantee this, I will try to make a "recording remote" from NaroCAD in the DEBUG (builds for developers) that can build those unit recording sessions automatically. This part may require changes at NaroCAD level that themselves yet may break the thing is wanted to be achieved: stability.

No comments: