After having perused the ui code today, I have to say that many elements
of the ui package can be tested much more thoroughly than they are,
without any refactoring at all (well, some private methods would have to
be made package private). For example, in the process of fixing the broken
(untested) tooltips on undo/redo, I added a new MainFrameTest class where
we can put tests on the methods in class MainFrame. Check out the test I
put in there for createManualToolbarButton. It tests that method without
worrying about what model is installed in the ui at all. Many of the
methods in class MainFrame (and the other ui classes) could be tested in
the same way.
We need to start retrofitting more methods to MainFrameTest while working
with the ui code. If everyone does a little bit of this retrofitting
whenever working with the ui, it should be fairly painless.
Of course, any new functionality (or altered functionality) in the ui
should include new tests.
-- Eric
|