12
The UML 2.0 Testing Profile and Its Realization in Eclipse Ina Schieferdecker Fraunhofer FOKUS, Berlin Eclipse BOF @ ECOOP 2003 www.fokus.fraunhofer.de/u2tp 2 Eclipse BOF @ ECOOP, Darmstadt, July 2003 Outline Introduction The Testing Profile Its Relation to Eclipse

The UML 2.0 Testing Profile and Its Realization in Eclipse

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The UML 2.0 Testing Profile and Its Realization in Eclipse

The UML 2.0 Testing Profile and Its Realization in Eclipse

Ina SchieferdeckerFraunhofer FOKUS, Berlin

Eclipse BOF @ ECOOP 2003

www.fokus.fraunhofer.de/u2tp 2Eclipse BOF @ ECOOP, Darmstadt, July 2003

Outline

• Introduction• The Testing Profile• Its Relation to Eclipse

Page 2: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 3Eclipse BOF @ ECOOP, Darmstadt, July 2003

Introduction

Developer

Heterogeneityincreases

Testingthroughout the

processIntegrator

SystemsIntegrator

www.fokus.fraunhofer.de/u2tp 4Eclipse BOF @ ECOOP, Darmstadt, July 2003

Introduction: Balanced View

Testing tightto Services

e.g. TTCN-3

Testing tightto Development

e.g. JUnit

Developer

Integrator

SystemsIntegrator

Page 3: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 5Eclipse BOF @ ECOOP, Darmstadt, July 2003

An Answer: Modell-Based View

� � � � � � � �

� � � � � � � �

� � � � � � � � �

� � � � � � � � � � � � � �

� � � � � � � � � � � � �

� � � � � � � � � �

� � � � � � � � � � �� � � � � � � � �� � � � � � � �

use case diagrams

� � � � � �

! � " � # $ �

% � & ' ( ) * ' ) � (

+ $ � , ) � $

% � � $ � - $ ' � $ �

. ) ( $ / $ #

0 � � � � ( 1

o rde r

item

1

+ 2 � 3 3 ) ( & ! ' �

1

1

p rod uc tIt em

pr odu c t

s e rv ice Ite m

s erv ice 1

1

c lie n t

c lie n t

cu s tom er O rd e r

o rg an iz a tionO rd e r

c a rt

c a r tO r de r

ac co un tO r de r

a cc oun t

11 ..*

1 ..*1

1

0 ..1

0 ..*

1

{xo r}

{xo r}

class diagrams

se lec tA m oun t

en te rA m oun t

ok

abort

o the rA m oun t

am oun t

abort

R eadA m oun tS M

aborted

state machines4 5 N

s[u]:B s[k]:B

m3()

m3()

interactions

Developer

Integrator

SystemsIntegrator

Testing tightto Specification

e.g. TTCN-3

Testing tightto Development

e.g. JUnit

www.fokus.fraunhofer.de/u2tp 6Eclipse BOF @ ECOOP, Darmstadt, July 2003

Concepts of the Testing Profile

• Test architecture• Test structure, test components and test configuration

• Test data• Test data and templates used in test procedures

• Test behavior• Dynamic aspects of test procedures

• Test time• Time quantified definition of test procedures

Page 4: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 7Eclipse BOF @ ECOOP, Darmstadt, July 2003

An Example

6\VWHP�LQWHJUDWLRQ OHYHO WHVWV

8QLW�OHYHO WHVWV

SWIFTNet SWIFTBureau

US BankSSSB Client

ClearingCompany

OTC Market Makers

EU BankSSSB Client

687:9<;>=@?ACBED FHGJI ?

78KL9<;>=@?ACBED FHGJI ?

SWIFTBureau

6\VWHP�OHYHO WHVWV

www.fokus.fraunhofer.de/u2tp 8Eclipse BOF @ ECOOP, Darmstadt, July 2003

6\VWHP�7HVW

ATM HWControl

Bank

«import»

«import»

Money

«import»

SWIFTNetwork

«import»

«import»

An Example

Page 5: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 9Eclipse BOF @ ECOOP, Darmstadt, July 2003

System Level Test

ATM«import»

ATMTest

«testSuite»M@N>OQPJRTS U V

-verdict : Verdict-amount : IMoney-targetBank : SwiftId-targetAccount : String-sourceAccount : String

«testCase» +validWiring() : Verdict«testCase» +invalidPIN() : Verdict«testCase» -authorizeCard() : Verdict

*

-accounts«testComponent»W>XTY[Z \^]HRT_ X U `^a

IBank

«interface»b M@c c `^R[Y U

-pinOk : Boolean-enteredPIN : String-message : String-t1 : Timer

«testComponent»d^ef\^]HR[_ X U `^a

hwComIATM

IHardware

Test suite with test cases

Test component

Miscellaneous

„Test package“

www.fokus.fraunhofer.de/u2tp 10Eclipse BOF @ ECOOP, Darmstadt, July 2003

gJhjiJkmlEnJoEprqtsJu l^v wrx

y^z{hjiJ|r}~prqjsJu l^v wrx

atmPort

«sut»l^v q�iJkmlEnJoT�C�m�bankCom

� sJx x hEn>v8i>�<lEx �Q�ml^v l

«testSuite»� u l^�^� ATMSuite

c `[�[S Y��”Encrypted”

Test Configuration

«testSuite»M@N>OQPJRTS U V

-verdict : Verdict-amount : IMoney-targetBank : SwiftId-targetAccount : String-sourceAccount : String

«testCase» +validWiring() : Verdict«testCase» +invalidPIN() : Verdict«testCase» -authorizeCard() : Verdict

Utility property

SUT propery

Test componentproperty

Coding rules

Connections

Page 6: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 11Eclipse BOF @ ECOOP, Darmstadt, July 2003

�E�ATMSuite

[verdict == fail][verdict == pass]

verdict = invalidPIN

x h[�

verdict = validWiringx h[�

Test Control (Execution of Test Suite)

«testSuite»M@N>OQPJRTS U V

-verdict : Verdict-amount : IMoney-targetBank : SwiftId-targetAccount : String-sourceAccount : String

«testCase» +validWiring() : Verdict«testCase» +invalidPIN() : Verdict«testCase» -authorizeCard() : Verdict

Referring test case behaviorsReferring test

case behaviors

www.fokus.fraunhofer.de/u2tp 12Eclipse BOF @ ECOOP, Darmstadt, July 2003

�E�invalidPIN

y^z{h «sut»l^v q

storeCardData(current)

display(”Enter PIN”)

isPinCorrect(invalidPIN)

«validationAction»� l^�>�

� sJx x hEn>v

{readOnly} Integer invalidPIN; { current.isPinCorrect(invalidPIN) == false }

isPinCorrect(invalidPIN)

display(”Invalid PIN”)

display(”Enter PIN again”)

isPinCorrect : falseisPinCorrect : false

t1(2.0)

t1

{0 .. 3}

A Test CaseData partition

Arbitratedverdict

Stimulus

ObservationTiming

SUT and Test Component Lifelines

SUT and Test Component Lifelines

SUT and Test Component Lifelines

Page 7: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 13Eclipse BOF @ ECOOP, Darmstadt, July 2003

The U2TP Definition: Metamodels

• The UML-based profile• Used by UML tools to provide test specification via

profiled UML elements

• The MOF-based standalone metamodel• Used by MOF-based tools and repositories to manage

and manipulate artifacts created using the profile

www.fokus.fraunhofer.de/u2tp 14Eclipse BOF @ ECOOP, Darmstadt, July 2003

The U2TP Definition: Mappings• To enable the direct execution of U2TP

specifications by reusing existing test infrastructures

• Mappings to • The JUnit test framework

• An open source test technology for Java• Black-box tests on unit level¾Only selected concepts of U2TP can be mapped

• The Testing and Test Control Notation TTCN-3• A generic test technology by ETSI/ITU-T • Black-box/grey-box tests on unit, component, integration and

system level¾Almost all concepts can be mapped

Page 8: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 15Eclipse BOF @ ECOOP, Darmstadt, July 2003

Hyades

• One of the Eclipse tool projects• Develops an integrated test, trace and monitoring

environment in Eclipse, that provides standards, tools and tool interoperability across the test process

¾Will provide an implementation of the UML Testing Profile

¾ Is based on the Standalone Metamodel

www.fokus.fraunhofer.de/u2tp 18Eclipse BOF @ ECOOP, Darmstadt, July 2003

Test and Trace Processes in Hyades

Page 9: The UML 2.0 Testing Profile and Its Realization in Eclipse

www.fokus.fraunhofer.de/u2tp 19Eclipse BOF @ ECOOP, Darmstadt, July 2003

Hyades Architecture

Data

Collection

Test Controller

Test Control Interface

Test Engine

Testability Interface

Software Under Test

System Environment

Test and Trace Data

RuntimeMonitoring

TraceAnalysis

TestMgmt.

TestCreation

OpenAPIs

ReferenceExamples

www.fokus.fraunhofer.de/u2tp 20Eclipse BOF @ ECOOP, Darmstadt, July 2003

Test which Hyades will support

• Functional Testing• Unit Tests• Integration Tests• System Tests

• Performance Tests• Metrics

• Collection• Analysis and Patterns• Triggers and Alerts

Page 10: The UML 2.0 Testing Profile and Its Realization in Eclipse

��

www.fokus.fraunhofer.de/u2tp 21Eclipse BOF @ ECOOP, Darmstadt, July 2003

Hyades Status

• Hyades 1.0.1 – a revised code drop which contains several parts of the infrastructure

• Features in Hyades• logging APIs to create logs or logging events • dynamically attach the workbench view to a running

application that is using the logging APIs, and monitor that application live

• distributed data collection framework• JVMPI agent is also provided; basic trace information

can be collected live and viewed in a simple sequence diagram

www.fokus.fraunhofer.de/u2tp 22Eclipse BOF @ ECOOP, Darmstadt, July 2003

In the meanwhile ...

• ... JUnit• ... an Eclipse IDE for TTCN-3

• The Testing and Test Control Notation• Developed by ETSI, adopted by ITU-T• „Migrated“ to OMG via the UML Testing Profile

Page 11: The UML 2.0 Testing Profile and Its Realization in Eclipse

��

www.fokus.fraunhofer.de/u2tp 23Eclipse BOF @ ECOOP, Darmstadt, July 2003

Other Types & Values 2

77&1���8VHU

Graphical Format

Tabular Format

ASN.1 Types & Values

Other Types & Values n

TTCN-3CoreNotation

Presentation Format n

TTCN-3

UML Testing Profile

www.fokus.fraunhofer.de/u2tp 24Eclipse BOF @ ECOOP, Darmstadt, July 2003

Metamodel based IDE

EMFRepository

of a component type

TTVariable TTInvocation

TTStartTC

1

1

+theTC1

+theStart1� � � � � � � �

1

1

+theFunction1

+theStart

1� � � � � � � � � � � � � �

of a function

of a component type

TTVariable TTInvocation

TTStartTC

1

1

+theTC1

+theStart1� � � � � � � �

1

1

+theFunction1

+theStart

1� � � � � � � � � � � � � �

of a function

of a component type

TTVariable TTInvocation

TTStartTC

1

1

+theTC1

+theStart1� � � � � � � �

1

1

+theFunction1

+theStart

1� � � � � � � � � � � � � �

of a function

� �L�J�T���C C�E¡E¢ £ ¢ ¡E¤Q� ¢ ¥m¦C§�j�j¨L©:ª«¡E¥m¬J�L¦C¥Q� ¤Q� ¢ ¥m¦

� �L�J�T���C C�E¡E¢ £ ¢ ¡E¤Q� ¢ ¥m¦C§�j�j¨L©:ª«­~®��

� �L�J�T�H¯°¦<¤Q± ²m³@¢ ¦8´8§ � �L�J�T�Hµ°�J 8± ¥@²<¶·�J¦<� §¸t¹ �J¡Jº<� ¢ ¥m¦

Page 12: The UML 2.0 Testing Profile and Its Realization in Eclipse

��

www.fokus.fraunhofer.de/u2tp 25Eclipse BOF @ ECOOP, Darmstadt, July 2003

Summary• UML Testing Profile provides specification means for test

artifacts of systems from various domains• Enhances UML with concepts like test configuration, test

components, SUT, verdict and default• Seamlessly integrates into UML: being based on UML

metamodel, using UML syntax

¾Direct support for test design¾Integration with the system development process¾Will be available within the Eclipse framework by Hyades

Thank youfor your attention!

www.fokus.fraunhofer.de/u2tp

Questions?