Testing of embedded and mobile Qt and QML Applications Qt - - PowerPoint PPT Presentation

testing of embedded and mobile qt and qml applications
SMART_READER_LITE
LIVE PREVIEW

Testing of embedded and mobile Qt and QML Applications Qt - - PowerPoint PPT Presentation

Testing of embedded and mobile Qt and QML Applications Qt Developer Days 2013 by Harri Porten About me Name: Harri Porten Company: froglogic GmbH Position: co-founder and CTO Qt usage: since 1997 (KDE project) Qt


slide-1
SLIDE 1

Testing of embedded and mobile Qt and QML Applications

Qt Developer Days 2013 by Harri Porten

slide-2
SLIDE 2

About me

  • Name: Harri Porten
  • Company: froglogic GmbH
  • Position: co-founder and CTO
  • Qt usage: since 1997 (KDE project)
  • Qt development: Software Engineer at Trolltech
slide-3
SLIDE 3

Overview

  • Types of Testing
  • Why Automate?
  • Challenges on embedded and mobile platforms
  • Live demo
slide-4
SLIDE 4

Types of Testing

  • Unit Testing
  • Performance Testing
  • ...
  • Functional GUI Testing
  • Black/Gray Box Testing
  • Assume user's point of view
  • Automate to spot regressions
  • Combinable with profiling, coverage and other analysis and monitoring tools
slide-5
SLIDE 5

Why Automate?

  • Faster
  • Get results quicker
  • Run more tests in the same time
  • Trivial to replay in different configurations
  • Reliable, reproducible and repeatable
  • Relieve testers from monotonous tasks
slide-6
SLIDE 6

But...

  • Automating GUI tests is not trivial
  • Typical reason for test effort failures: wrong test approach
slide-7
SLIDE 7

Platform Challenge

Qt runs on:

  • Windows (various versions)
  • Linux (desktop and embedded)
  • Mac OS X
  • Android
  • Boot to Qt
  • iOS
  • QNX
  • VxWorks
  • Nucleus
  • ….
slide-8
SLIDE 8

Toolkit Challenge

Those may play a role:

  • QWidgets
  • QML elements
  • Native controls
  • Web!

Most challenging: combinations of the above.

slide-9
SLIDE 9

Platform Solution 1/2

Biggest help from....

Qt itself

slide-10
SLIDE 10

Platform Solution 2/2

Additional help through:

  • Resolution independence
  • Synchronization methods
  • UI abstractions
  • Reusable functions/objects
  • Mock objects
slide-11
SLIDE 11

Virtualization

Target hardware

  • the real thing
  • limited number
  • harder to automate

Virtual systems

  • VMware, Virtual Box, qemu
  • emulator vs. simulator
  • easy replication, resets and automation
  • Simulation of hardware features, limitations and events.
slide-12
SLIDE 12

Capture and replay

  • Produces massive test scripts
  • Not readable
  • Not maintainable
  • No code re-use possible
  • Brittle against changes in the UI
  • Solution: Scripting & Refactoring
slide-13
SLIDE 13

Script Languages

Beware of “vendor scripts” or “macros”! Open and powerful choices exist:

  • JavaScript
  • Python
  • Perl
  • Ruby
  • Tcl
  • ...
slide-14
SLIDE 14

Factorization

function main() { launchApplication(“clean”); loadData(“sample.dat”); changeParameter(“ParameterA”, 10); runCalculation(); dumpData(“out.txt”); compareData(“out.txt”, “expected.txt”); }

slide-15
SLIDE 15

GUI Objects

login = LoginScreen() login.tryLogin(“myuser”, “wrongpassword”) test.compare(login.success, False) test.compare(login.message, “Wrong password”) login.tryLogin(“myuser”, “realpassword”) test.compare(login.success, True)

slide-16
SLIDE 16

Scripted Approach vs. Capture & Replay

slide-17
SLIDE 17

Screen coordinates

  • Addresses screen positions and not UI controls
  • Breaks with UI layout changes
  • Depends on GUI style and platform
  • Scripts hard to understand
  • Solution: Address objects based on properties
slide-18
SLIDE 18

Reliance on screen captures

  • No knowledge of GUI controls
  • Too much heuristics
  • Depends on irrelevant data (colors, fonts, etc.)
  • Many incorrect fails / errors
  • Solution: Identify on and compare object properties
slide-19
SLIDE 19

UI Styles

Tab Control

slide-20
SLIDE 20

UI Styles

File Selectors And mobile and embedded..???

slide-21
SLIDE 21

Example: Widget Recognition Options

Very BAD: MouseClick(132, 367) BAD: MouseClick('Tree', 30, 136) BAD: MouseClick( FindObjByImg('item-image.png')) GOOD: ClickItem('Tree', 'Event')

slide-22
SLIDE 22

Help from Developers

  • QObject::setObjectName()
  • QML “id” property
slide-23
SLIDE 23

Architecture

Location vs. Remote

slide-24
SLIDE 24

Demo

Live