Record & replay for applications validation

From OTBWiki
Jump to: navigation, search

Testing applications is a complex task. We would like to be able to record precisely the use case leading to a fault and to replay it at willing. There are two kinds of interactions between the user and the application :

  1. Triggering callbacks on widgets (for instances buttons, check boxes, menu items)
  2. Sending events to widgets (clicking on widgets, resizing, hiding ...)

The following gives some hints on how to record & replay these two kinds of interactions. Please note that this solution would be specific to FLTK.

Record

Callbacks

Callbacks associated to widgets are explicitly declared in the fl file. Therefore it would be rather easy to apply some python script adding logging instruction to every callback and the state of the widget (using the value() method). We could also use this script to add enabling/disabling of record capabilities and accessors on the log filename. It would also be possible to record the timing of the user action.

Callbacks are also explicitly declared in the *GUI.h file. Each call to these functions could be recorded in a log file. To enable a replay the full state of the application widgets could be save at the same time. A way to identify each callback is necessary and would probably be better handled by a macro.

Events

Not investigated yet.

Replay

Callbacks

The python script would also add to the fl file some methods to parse each record file line, set the appropriate value to the appropriate widget (still the value() method), and trigger the callback (using the do_callback() method). Triggering callbacks like this is proved to work (refer to the segmentation application tests).

Events

Not investigated yet.