• No results found

How To Write A Test Program For Eclipse (Eclipse)

N/A
N/A
Protected

Academic year: 2021

Share "How To Write A Test Program For Eclipse (Eclipse)"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

Testing Tools inside Eclipse

Michael G Norman, PhD

CEO Scapa Technologies

(2)

TPTP – Formerly Hyades

ƒ

Launched 2002, 1.0 GA alongside Eclipse 2.1, 3.0/3.0, 4.0/3.1

ƒ

Multi-vendor contribution/adoption strategy

ƒ

IBM*, Scapa*, Intel*, CA*, SAP†, FOKUS, OC Systems, Compuware

ƒ

Layered and flexible integration/adoption model

ƒ

Test, trace, profile, monitor

ƒ

Cross-lifecycle

ƒ

May operate in source-code free environments

ƒ

Initial motivation was consumption by other tools

ƒ

Sample tools are relatively low function

ƒ

Some overall useability issues

ƒ

A project “theme” to improve exemplary tools

* Strategic Developer

† Strategic Consumer

(3)

TPTP Project Structure

Eclipse Foundation

Project Management Committee

TPTP Platform

Project

Project Lead Committe rs Develope rs

TPTP Testing

Tools Pr

oject

Project Lead Committe rs Developer s

TPTP Tracing &

Profiling Tools Pr

oject

Project Lead Committ ers Develope rs

TPTP Monitoring

Tools Pr

oject

Project Lead Committ ers Develope rs

Requirements

Group

Architecture

Group

Planning

Group

Marketing

Group

Requirements

Council

Architecture

Council

Planning

Council

Marketing

Committee

(4)

Some issues

ƒ

Genuine diversity of experience & interest

ƒ

Different Development Processes

ƒ

Different objectives

ƒ

Collaborators sometimes compete in the marketplace

ƒ

Concerns about auto-commoditization

ƒ

Vendors need to understand how TPTP contributions impact their own

markets – “value point” migration & timing thereof

ƒ

We have to pay our staff

ƒ

Layered adoption model

ƒ

Product re-engineering costs money & can often be very difficult

ƒ

Migration is disruptive to installed base

(5)
(6)

The Unofficial Hyades Architecture Diagram

Execution

Environment

Application

Presentation System

Test

Trace

EMF Data Models

Log

Statist

ical

XMI

Real Time

Export

Runtime

Monitor / log

Trace Analy

sis

And P

rofiling

Test Creation

and Exec

ution

Artifact

Managem

ent

Eclipse TPTP GUI

Standard Widgets and

Core Plug-ins

Reference Perspectives

And Workflow

Target System

Data Collection

Data Collect

ion

Interface

In

jecti

onCorrel

ation

Log Collection

Trace Collection

System Performance

Monitor

JVMPI Monitor

Data Loader

Distributed

Data Collection

Framework

Agent

Control Interface

Agent

Control Interface

Distributed

Control

Framework

Testability Interface

Test Engine

Eclipse Platform

JVMTI Monitor

FUTURE

(7)

What’s an EMF data Model

ƒ

The problem

ƒ

how do I store/retrieve my data?

ƒ

How do I share data with other tools?

ƒ

EMF

ƒ

A model is a UML/MOF description of the “things” the tool deals with

ƒ

Auto-generated API within the workbench to persist/retrieve

ƒ

Bound into the Eclipse workspace model

ƒ

Serialization/deserialization etc handled “for free” to XMI

ƒ

Tools interoperate if they use the APIs and respect the semantics in

the model

(8)

The 4 models

• Test data model supports test cases, input data, results and

execution history. It consists of three models

• A data model for creation, definition and management of test artifacts.

This implements UML 2 Testing Profile meta model

• A data model for test case behaviors. It implements UML 2 Interaction

meta model.

• A data model for test execution history. It supports execution traces

and results from disparate test types.

• Trace data model supports traces of local and distributed execution

stacks and heaps

• Log data model supports sequence of CBEs and other logged

messages that are transformable into CBE.

• Statistical data model supports snapshots of arbitrary data over

time

(9)
(10)
(11)

Data Models (Test Model)

Behavioral model

ƒ

The behavioral portion of the Test Model is an implementation of UML2

Interactions.

ƒ

Behavioral model is optional

ƒ

An extension point to glue in pre-existing tools engines as external

behaviours

ƒ

Possible to mix e.g. wrap External test tools inside TPTP behaviour

ƒ

Interface is via a façade

ƒ

To provide a more semantically familiar programming model (loops and

decisions, not combined interaction fragments with operators.)

ƒ

To facilitate interop among tests from different test tool vendors

(multiple ways of representing the same transaction)

ƒ

To (potentially) allow TPTP based products to access behavior that is

not modeled (via another implementation of the same façade interface.)

(12)

Data Models (Test Model)

Execution Histories

ƒ

Stores the results of test executions

ƒ

References to test, trace, deployment info

ƒ

Verdicts

ƒ

Test Log messages and console out from test

(13)
(14)

Execution Capabilities

ƒ

TPTP Provides

ƒ

extension points for external execution

ƒ

It’s own extensible runtime/code generation for sample test tools based

around façade & native behaviours (more later)

ƒ

Combinations of native and ezternal behaviours (e.g. jUnit)

ƒ

A generic non-test-specific external behaviour is also emerging through

leveraging BPEL/WSDL/XSD/XPATH

ƒ

Finally provides us with a testability interface – WSDL

ƒ

Also allows all TPTP agents to be controlled via WSDL

ƒ

Will leverage WTP

(15)

TPTP Agent Controller

Target Machine

TPTP Data

Collection and

Control

Framework

(Client)

Agent Controller

Agents

S o ck et T ran sp or t L ay er Pa yl o ad N or m aliz er Co m m an d E xt ract or Na m ed P ip e T ran sp o rt L ay er Pa yl oa d N o rm aliz er Co m m an d E xt ract or

Te

m

p

la

te

s

Key

= You write this part = TPTP Provides this part = Provided but replaceable

Workbench Machine

(16)

Test Execution explained

ƒ

The Execution Components are remoted via the TPTP Platform Execution

Environment

ƒ

The Test Execution Harness invokes methods of the Execution Components

locally in the Workbench process, and the agent controller marshals and

invokes the methods on the target execution environment.

(17)

Test Execution explained

ne

Test JVM

Test Runner /

Test

Target Machi

Session JVM

Execution

Environment

Executor

Remote

Hyades

Component

Executable

Object

Workbench Machine

Workbench JVM

Execution

Environment

Test

Execution

Harness

Executor

Remote

Hyades

Component

Executable

Object

Execution

Environment

Adapter

Executable

Object

Adapter

(18)

Sample Tools

ƒ

URL Test - Performance Testing of Web Applications

ƒ

Junit (within TPTP framework)

ƒ

Manual test (assisted)

ƒ

Test Creation / Recording (Web)

ƒ

Editing

ƒ

Generating Java code

ƒ

Deploying & Running test

ƒ

Analyzing test results

(19)

What about the other models?

(Prehistoric slide)

Trace

Trace Analysis

Trace Analysis

Trace

Application

Execution

Application

Execution

External

Test Case

Test Case

Test Execution

Test Execution

Test

Trace

Test

Trace

Test Analysis

Test Analysis

Requirements

Requirements

Models

Models

Code Analysis

Code Analysis

Test

Management

Test

Management

System

Management

System

Management

Project

Management

Project

Management

(20)

What about the other models?

(Updated slide)

Trace

Trace

Application

Execution

Application

Execution

Test Execution

Test Execution

Execution

History

Execution

History

Code Analysis

Code Analysis

Trace Analysis

Trace Analysis

External

Statistical

Data &/or

Logs

Statistical

Data &/or

Logs

Test and Trace

External

Requirements

Requirements

Models

Models

Test Case

Test Case

Test Analysis

Test Analysis

Test

Management

Test

Management

Project

Management

Project

Management

System

Management

System

Management

(21)

TPTP in action – It’s all one thing!

Desktop Client

Firewall

Application

Server

Non-J2ee

Business logic

Oracle

Database

ƒIt’s not My fault, honest

ƒLoosely Fictionalized Scenario –

ƒreal customer, finance sector, Europe

ƒhosting company, ISV, Integrator

ƒBased on Scapa 3.1 but almost equivalent scenario could be

performed with out-of-the-box TPTP for some system technologies

(22)
(23)
(24)
(25)
(26)

Futures

ƒ

Significant UI enhancements to sample tools

ƒ

BIRT-based reporting

ƒ

Trace->test conversion

ƒ

Some sample tooling based on SOA runtimes

ƒ

ANYONE IN THE WORLD CAN SUBMIT AN ENHANCEMNT

REQUEST TO TPTP

ƒ

TPTP has a broad contribution base. We would love to see it

getting even broader.

References

Related documents