16-19 October 2016
Copenhagen University
Europe/Copenhagen timezone

Test Driven GUI Development

19 Oct 2016, 11:10
20m
Marble Hall (Copenhagen University)

Marble Hall

Copenhagen University

Thorvaldsensvej 40

Speaker

Raquel Alvarez (ISIS, STFC)

Description

From its inception, software quality has been at the forefront of concerns in Mantid[1], a scientific framework for reduction of neutron scattering data. The Mantid project was implemented with a long term future in mind, and the need to maintain quality and robustness while continuing to develop the framework has been a cornerstone in the project. As such, we have developed a comprehensive and robust automated testing framework of many thousands of unit tests covering all aspects of the underlying framework and algorithms, which are supplemented by hundreds of automated system tests that verify full workflow on real data volumes. This has proved invaluable to ensuring that core aspects of the application are thoroughly exercised and validated before any change is accepted. However, graphical user interfaces (GUIs), which provide an important front-end to many of Mantid's users, have historically been hard to test, needing specialised commercial testing frameworks with scripts that can often be fragile to further development changes. In addition, traditional approaches to generating such interfaces often introduce long-term problems into frameworks of this type. In the past, manual testing has been the solution in these areas, however this is both expensive in a large project when testing must be repeated with each release, and prone to missing errors. Indeed, the user interface has been the site of the majority of bugs found after release in Mantid for many years. Recently, we have begun to build new interfaces using the Model-View-Presenter (MVP) design pattern, which originates from a family of designs, in which view and presentation logic are entirely separated. The presentation logic is naturally made available for unit testing, and we can therefore automate our testing scenarios, provide wide test coverage, and test at speeds unobtainable via GUI testing frameworks. Test driven development complements MVP approaches, and we find that applications prove to be much more robust and reliable, even while under significant development. Indeed this design pattern can be applied at a lower level, recently several technique areas have requested an enhanced batch processing capability within their user interfaces. Therefore it makes sense to build a general data reduction widget that can be inserted into Mantid user interfaces, allowing developers to share the maintenance and development effort involved in taking care of UIs. This new “DataProcessor” widget requires little information about the specific technique area, providing a neat and concise way to execute complex batch-processing via "DataProcessorAlgorithms”, and as it uses the MVP pattern, it comes with a full set of unit tests that ensure its long term maintainability and robustness against code changes, across all the interfaces that use it.

Primary author

Raquel Alvarez (ISIS, STFC)

Co-authors

Arnold Owen (Tessella plc / ISIS, STFC) Matthew King (ISIS, STFC) Nicholas Draper (Tessella plc / ISIS, STFC)

Presentation Materials

There are no materials yet.
Your browser is out of date!

Update your browser to view this website correctly. Update my browser now

×