Docsity

Plan Generation for GUI Testing - Slides | CMSC 838, Study notes of Computer Science

Partial preview of the text

Download Plan Generation for GUI Testing - Slides | CMSC 838 and more Study notes Computer Science in PDF only on Docsity!

Plan Generation for GUI Testing

  • The 21st International Conference on Software Engineering
  • The Fifth International Conference on Artificial Intelligence Planning and Scheduling
  • IEEE Transactions on Software Engineering

2

GUI

Underlying

Code

Research Focus

Interactions between the GUI and the Underlying Code

  • GUIs are Event Driven
  • Individual User Events
    • NOT ENOUGH!
    • Sequences of User Events lead to Different States
  • Test Case: Sequence of User Events
  • How to Generate Test Cases?
  • Use Planning to Select Likely Test

Cases

Why Planning for GUI Testing

4

  • Infinitely Many
  • Randomly Choose Sequences
  • Expert Chooses Sequences
  • Automatically Generate Events for

COMMONLY USED TASKS

Selecting Test Sequences

Initial State Goal State

Multiple Event

This is the text. Sequences Thisis the text.

Overview of Test Generation

Phase Step Test Designer Automatic

Planning-based

System

Setup 1 Derive Planning

Operators

from GUI

2 Code Preconditions

and Effects of

Operators

Test Case

Generation

3 Specify a Task

(Initial and Goal

States)

4 Generate Test

Cases

8

Straightforward Approach

  • Define One Operator for each User

Action

Operator :: CUT Preconditions : isCurrent(Menu2).

Effects : FORALL Obj in Objects Selected(Obj)? ADD inClipboard(Obj) DEL onScreen(Obj) DEL Selected(Obj) ADD isCurrent(Menu1) DEL isCurrent(Menu2). Menu

Menu

File Edit View Ins

Cut

Exploit the GUI’s Structure

  • Reduce the Number of Operators
    • System more Efficient
    • Easier for the Test Designer

10

Opening Modal Windows

English (United States)

OK Cancel Default...

Set Language

Create Hierarchical Operators

Two Types of Abstractions

  • Combine Buttons? Create System- Interaction Operators
  • Decompose GUI Hierarchically? Create Abstract Operators

14

Create System-Interaction Operators

File_SendTo_MailRecipient

= <File + SendTo +

MailRecipient >

Sys-Interaction Operator:

File

Send To

Mail Recipient

Create Abstract Operators

SelectFromList() Default OK Cancel

Language Window’s Operator Set

Main GUI’s Operator Set … Set Language SelectFromList() Default OK Cancel ...

English (United States)

OK Cancel Default...

Straightforward

Approach

Set Language

Set Language ...

Main GUI’s Operator Set

Using Abstraction

16

Create Abstract Operators

SetLanguage()

SelectFromList (“English(US)”)

OK

Abstract Operator

Planner

SelectFromList() Default OK Cancel

Language Window’s Operator Set

SetLanguage()

High Level Plan

Sub Plan Define Abstraction

Test Case

SelectText (“This”)

FormatFont (“This”, 18pt)

FormatFont (“text”, Underline)

SelectText (“text”)

Primitive Operator

Primitive Operator

Abstract Operator

Abstract Operator

I N I T I A L
G
O
A
L

20

FormatFont 18 OK FormatFont^ Underline^ OK

Planner Planner

Format Font Format^ Font

Mapping Mapping

SelectText (“This”) Format Font 18 OK SelectText (“text”)

Format Font Underline OK

22

Alternative Test Case

SelectText (“This”)

SelectFromList (18)

FormatFont (“text”, Underline)

SelectText (“text”)

Primitive Operator

Primitive Operator

Primitive Operator

Abstract Operator

SelectText (“This”)

SelectFromList (18)

SelectText (“text”)

Format Font (^) Underline OK

SelectText (“This”)

FormatFont (“This”, 18pt)

FormatFont (“text”, Underline)

SelectText (“text”)

Primitive Operator

Primitive Operator

Abstract Operator

Abstract Operator

I N I T I A L
G
O
A
L

Experimental Results

(Task)

Plan

No.

Plan

Time

(sec.)

Sub Plan

Time

(sec.)

Total

Time

(sec.)

26

Concluding Remarks

  • Automatic Planning is a Feasible

Approach for GUI Test Case Generation

  • Automatic Generation of

Preconditions and Effects from GUI Specifications

  • Generate Expected Output

(Automated Verification)