On 02/19/2014 12:25 PM, Miklos Espak wrote: > Hi, > > I discovered a few sever problems in the MITK Core while I was testing > our custom viewer based on QmitkStdMultiWidget. The problems affect the > DisplayGeometry and SliceNavigationController and maybe the BaseRenderer > as well. > > Basically, the problem is that many unnecessary events are sent about a > state change. The SliceNavigationController has a private BlockUpdate > function to handle this, but the DisplayGeometry does not. > > For instance, signals are sent out while the state of an object is just > temporary, i.e. it is not the final state that the object should reach. > E.g. the following function will send a few itk::ModifiedEvent() from > both function calls, resulting in 3-5 ModifiedEvents. Only one signal > should be sent at the end of the function. >
Hi Miklos, I think you are totally right ;) > [...] > For our viewer I follow a relatively simple design pattern to ensure > that all the state transitions are atomic. I also wrote a simple test > framework for writing unit tests to enforce this requirement. It can > automatically check if: > - a signal is sent only if the state has changed > - the state does not change twice (after a signal has been sent) > - the new state is consistent > - the new state is equal to the expected state (if the expected > state was set beforehand). > > I think it would be worth enforcing these constraints on the MITK Core > classes. I would be happy to provide the my generic tester and the > design pattern. > > What do you think? > > Cheers, > Miklos > Sound good. Does your framework check the Modified event behaviour of single method calls or the correct behaviour of a larger setup? At least for some critical classes we should probably unit-test this on the method level. Best Marco ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
