CSSE 220 Unit Testing GUI Applications Checkout TicTacToeTesting - - PowerPoint PPT Presentation

csse 220
SMART_READER_LITE
LIVE PREVIEW

CSSE 220 Unit Testing GUI Applications Checkout TicTacToeTesting - - PowerPoint PPT Presentation

CSSE 220 Unit Testing GUI Applications Checkout TicTacToeTesting project from SVN Questions Why do software engineers do unit testing? UNIT TESTING REVIEW Why do unit testing? Get code right Keep code right as changes are made


slide-1
SLIDE 1

CSSE 220

Unit Testing GUI Applications

Checkout TicTacToeTesting project from SVN

slide-2
SLIDE 2

Questions

slide-3
SLIDE 3

UNIT TESTING REVIEW

Why do software engineers do unit testing?

slide-4
SLIDE 4

Why do unit testing?

  • Get code right
  • Keep code right as changes are made
  • Confirm our understanding of the method

specification before implementing it

  • Provide documentation
  • Confirm pieces in isolation so we don’t have to

worry about them during integration (when we put code together)

Q1

slide-5
SLIDE 5

How do we test GUI applications?

  • Should we test GUI applications?

– Reasons for unit testing are still applicable to GUI applications

  • How do we test GUI applications?

– Automated UI Testing – Manual Testing by interacting with the GUI – Unit testing with a testing framework (JUnit)

Q2

slide-6
SLIDE 6

Unit Testing vs. GUI Testing

  • Unit Testing

– “White Box Testing” (code access) – Tests pieces in isolation – Ensure smallest portions of application function

  • GUI / Integration Testing

– “Black Box Testing” (no code access) – Ensures application meets requirements – Tests entire application as a whole

slide-7
SLIDE 7

UNIT TESTING MODEL

Testing with JUnit

slide-8
SLIDE 8

Testing GUI application effectively

  • Decouple Model and User Interface
  • Model:

– State of the Application – Application logic – Application data

  • User Interface:

– GUI components that user interacts with – Use to interact with model

  • Write unit tests for the model
slide-9
SLIDE 9

Testing TicTacToe

  • In groups of 3 study the TicTacToe code in

tttEasier and tttHard

  • Explain why it would be challenging to write

unit tests for tttHard

  • Explain why it would be easier to write unit

tests for tttEasier

Q3-4

slide-10
SLIDE 10

TEAM PROJECT

Work time Be sure everyone is getting a chance to drive.

Q5-6