2 Graphical User Interfaces A graphical user interface (GUI) is composed of objects (buttons, menus) using metaphors familiar in real life.The software user interacts with the GUI objects by performing events that manipulate the GUI objects as one would do with the real objects.Events cause deterministic changes to the state of the software that may reflected by a change in the appearance of one or more GUI objects.
3 GUI Hierarchy GUIs, by their vary nature, are hierarchical. This hierarchy is reflected in the grouping of events in windows, dialogs, and hierarchical menus that can be tested in isolation.Since there are a large number of possible permutations of GUI events, this grouping of events decomposes GUI into manageable GUI components.
4 A Formal Definition of GUI A GUI is a hierarchical, graphical front-end to a software that accepts as input user-generated and system-generated events from a fixed set of events and produces deterministic graphical outputs.A GUI contains graphical objects and each object has a fixed set of properties.At any time during the execution of the GUI, these properties have discrete values, the set of which constitutes the state of the GUI.
5 Modal WindowsA modal window is a GUI window that once invoked, monopolizes the GUI interaction, restricting the focus of the user to a specific range of events within the window, until the window is explicitly terminated.The language selection window in MS Word is an example of a modal window.
6 Modeless WindowsOther windows in the GUI are called modeless windows that do not restrict the user’s focus; they merely expand the set of GUI events available to the user.In the MS Word, performing the event Replace opens a modeless window entitled Replace.
7 GUI ComponentsAt all times during interaction with the GUI, the user interacts with events within a modal dialog.This modal dialog consists of a modal window X and a set of modeless windows that have been invoked, either directly or indirectly by X.The modal dialog remains in place until X is explicitly terminated.Intuitively, the events within the modal dialog form a GUI component.
8 A Formal Definition of GUI Components A GUI component C is an ordered pair (RF, UF), where RF represents a modal window in terms of its events and UF is a set whose elements represent modeless windows also in terms of their events. Each element of UF is invoked either by an event in UF or RF.An example of a GUI component is the FileOpen modal window (and its associated modeless windows) found in most of today’s software.
9 Event InterleavingBy definition, events within a component do not interleave with events in other components without the components being explicitly invoked or terminated.
11 Restricted-Focus Events Restricted–focus events open modal windows.The Set Language event in MS Word is an example.
12 Unrestricted–Focus Events Unrestricted–focus events open modeless windows.The Replace event in MS Word is an example.Modeless windows also need to be explicitly terminated.
13 Termination Events Termination events close modal windows. Common examples include the Ok and Cancel events.
14 Menu-Open Events Menu-open events are used to open menus. They expand the set of events available to the user.Menu-open events do not interact with the underlying software.Common examples include the File and Edit events.
15 System-Interaction Events System-interaction events interact with the underlying software to perform some action.Common examples include the Copy event used for copying objects to the clipboard.
16 An Example: MS WordPadComponent Menu System Restricted Unrestricted Termination SumName Open Interaction Focus FocusMainFileOpenFileSavePrintPropertiesPageSetupFormatFontSum
17 Event-Flow GraphsAn event-flow graph for a GUI component C is a 4-tuple <V, E, B, I> where:V is a set of vertices representing all the events in the components.E V V is a set of directed edges between vertices. (vx, vy) E if vx immediately follows vy.B V is the set of events that are available when C is first invoked.I V is the set of restricted-focus events.
18 An Example: MS WordPad Help File Edit About Contents Open Save Cut CopyPasteTo File, Editand HelpTo File, Editand Help
19 Integration TreesAn integration tree is a 3-tuple <N, R, B>, where:N is the set of components in the GUI.R N is a designated component called the Main component.We say that a component Cx invokes component Cy if Cx contains a restricted-focus event ex that invokes Cy.B N N is the set of directed edges showing the invoking relation between components.
20 An Example: MS WordPad Main Filenew FormatFont FileSave FileOpen PageSetupPrintViewOptionsProperties
22 Intra-Component Coverage Criteria Event coverage: each event (or vertex) in the component is performed at least once.Event-interaction coverage: each edge (vx, vy) in the component is performed at least once.Length-n event-sequence coverage: each event-sequence of length n is performed at least once.
23 Inter-Component Coverage Criteria Invocation coverage: each restricted-focus event in the GUI is performed at least once.Invocation-termination coverage: each length 2 event sequence (ei, ej) in the GUI is performed at least once, where ei invokes component Cx and ej terminates component Cx.Intercomponent length-n event-sequence coverage: each event-sequence of length n that starts with an event in one component and ends with an event in another component is performed at least once.
25 Total Number of Event Sequences Component Event-Sequence LengthName ’ 2’MainFileOpenFileSavePrintPropertiesPageSetupFormatFontPrint+PropertiesMain+FileOpenMain+FileSaveMain+PageSetupMain+FormatFontMain+Print+Properties
26 GUI Testing Tools: GUITAR GUITAR is a GUI Testing Framework that presents a unified solution to the GUI testing problem.Our emphasis has been on developing new event-based tools and techniques for various phases of GUI testing.
27 GUI Testing Tools: Abbot Abbot helps you test your Java UI.It comprises Abbot, which lets you programmatically drive UI components, and Costello (built on Abbot) which allows you to easily launch, explore and control an application.The framework may be used with both scripts and compiled code.
28 GUI Testing Tools: JFCUnit An extension to the JUnit framework that enables you to execute unit tests against code that presents a Swing GUI based interface.Recording and playback to/from XML allows novice GUI developers to generate and execute tests.
29 GUI Testing Tools: UISpec4J UISpec4J is an Open Source functional and/or unit testing library for Swing-based Java applications, built on top of the JUnit test harness.