26
[email protected] www.saxsys.de Saxonia Systems Wir lieben IT. Dresden · Frankfurt/Main · Leipzig · München · Hamburg · Görlitz · Berlin Michel Löhr Highspeed Test Automation

FT 2009 Highspeed Test Automation

  • Upload
    mloehr

  • View
    614

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Dresden · Frankfurt/Main · Leipzig · München · Hamburg · Görlitz · Berlin

Michel Löhr

Highspeed Test Automation

Page 2: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Goal of presentation

Using a Domain Specific Language approach with automatic testing will increase productivity and quality in creating and maintaining testscripts

I will showcase this with two examples

Page 3: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Software Testing History

Bis 1956 - Debugging oriented 1957-1978 - Demonstration oriented 1979-1982 - Destruction oriented 1983-1987 - Evaluation oriented 1988-2000 - Prevention oriented (*) 2000- - Automation oriented (**)

A study conducted by NIST in 2002 reports that software bugs cost the U.S. economy $59.5 billion annually. More than a third of this cost could be avoided if better software testing was performed.

Quellen: (*) wikipedia(**) M. Löhr

Page 4: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Rationale

In software development practice, as much as 50% of the total cost is spent on testing

to ensure its quality. To reduce such cost, it is imperative to have a solution to

automate the testing process.

Automating testing within a software development project shouldn’t be itself a software development project within its original project

ROI

Page 5: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Test automation types

White box testing

Code-driven testing Black box testing

(G)UI testing

Platform and OS independence

Data driven capability (Input Data, Output Data, Meta Data)

Customizable Reporting (DB Access, crystal reports, etc..)

Email Notifications (Automated notification on failure or threshold levels)

Easy debugging and logging

Version control friendly – minimum or zero binary files

Extensible & Customizable (Open APIs to be able to integrate with other tools)

Common Driver (Ant or Maven)

Headless execution for unattended runs (For integration with build process or batch runs)

Support distributed execution environment (distributed test bed)

Distributed application support (distributed SUT)

Page 6: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Testautomation Approaches

Data-driven testing

Modularity-driven testing

Keyword-driven testing

Hybrid testing

Model-based testing

Page 7: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Keyword-driven testing

Object Action Data

Textfield(username)

Enter Text „Max“

Textfield(password)

Enter Text „Secret“

Button(login) Click One left click

Page 8: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automatision

Keyword-driven testing

Page 9: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Model-based testing

Model-based testing is software testing in which test cases are derived (in whole or in part) from a model that describes some (usually functional) aspects of the system under test (SUT)

Raising the abstraction level productivity

Page 10: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Domain Specific Languages (DSLs)

Dedicated languages for a specific purpose like SQL for handling data in databases

Macros such as SUM() in Spreadsheets (EXCEL)

Raised abscration level and (re)using domain knowledge

Opposite of general purpose languages as Java or C#

Internal / External DSLs

Page 11: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Domain Specific Languages (DSLs)

Page 12: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

DSL Example #1

Page 13: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Example Test Case: Place and Cancel Order

1. Start application2. Select CD ABC to buy3. Place Order for customer X using

credit card YYY4. Verify order amount5. Verify order is ordered6. Open existing orders for customer

X7. Verify just ordered order exists8. Cancel this order9. Close application

Page 14: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

How does this Testing DSL looks like?

Page 15: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

How does such an architecture look like?

GUI Test

Support

Framework

Rub

y

Java

Testing DSL

Testing

DSL

Developer

Rub

y

Test case

Scripter

Test case scriptsRub

y

DSL

IBM Rational

Functional

Tester

Java - API

GUI Objects Map

GUI Test

Technolog

y

Swing/SWT

HTML

.Net

Etc..

Page 16: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

DSL Example: Inventory Management

Page 17: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Test automation using Groovy & internal DSL

Page 18: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test-Automation

DSL Example: Groovy Testscript snippets

Page 19: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automation

Conclusion using DSLs

BenefitsHigher abstraction > better productivity in testscriptingBetter flexiblity over Keyword-driven testing (graybox)

DrawbacksNeed some development experience of (host language) to create

testscriptsTechnology dependencies

Page 20: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Highspeed Test Automatisierung

Vision: data-, keyword-, model driven testing

Testplan: sample # 1login user: „foo“, password „bar“

buy_cds datapool[„cd-pool1“]

Scenario: login user, passwdlogin_screen {

enter username:user, password:passwd

[advanced]click login

} alternative: advanced {

check advanced_login}

Context: login_screenfixture: {title: „Login .*“}guimap: [username, password: textbox,

advanced: checkbox, login: button]

Testplan: sample # 2login user: „foo“, password „bar“ using advanced

Page 21: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Thank you for your

attention!

Page 22: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Page 23: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Page 24: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Page 25: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.

Page 26: FT 2009 Highspeed Test Automation

[email protected] www.saxsys.de

Saxonia SystemsWir lieben IT.