software architecture-based regression testing

Post on 09-May-2015

387 Views

Category:

Documents

8 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Software Architecture-basedRegression Testing

Henry MucciniSoftware Engineering and Architecture Group

Università degli Studi dell'AquilaI-67100 L'Aquila, Italymuccini@di.univaq.it

Marcio DiasDepartment of Computer Science and

e-Science Research Institute, University of Durham, UK

Debra J. RichardsonDonald Bren School of Information

and Computer Sciences, University of California Irvine, USA

2SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

My main research areas: Analysis

» SEA Group

- Software Engineering and Architecture Group

» Software Architecture Analysis:

- Model-Checking SAs (the CHARMY framework)

- SA-based Testing

- SA-based Regression Testing (the SARTE project)

- Model-checking driven Testing (the ModTest approach)

» Product Line:

- Modeling Product Line Architecture

- Testing and Model Checking of Product Line

3SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Our Experience on SA-based analysis

Requirements

SoftwareArchitecture

M.C.[NOK]

refine SA OK [test case selection]

drive

identifyModel

Checking

SA conformance to requirements through MC

SA model functionalproperties

SoftwareArchitecture

SystemImplementation

TestExec

[NOK]Fault removal

Map SATCinto real

Test Cases

TestProcedures

Testing

Extract SA-levelTest cases

Implementation conformance to SA through Testing

SATC

provide confidence on the implementation fulfillment to its

architectural specSA-based Testing

Charmy Project

validate the SA model conformance

with respect to selected functional properties

[www.di.univaq.it/charmy]

4SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

ModTest: Model-Checking driven Testing

Requirements

SoftwareArchitecture

M.C.[NOK]

refine SA OK [test case selection]

drive

identifyModel

Checking

SA conformance to requirements through MC

SA model functionalproperties

SystemImplementation

TestExec

[NOK]Fault removal

Testing

Implementation conformance to SA through Testing

Test spec

TestProcedures

RequirementsSpecification

ArchitecturalSpecification

CharmyAnalysis

OK

NOK Criticalsub-systemsidentification

SA Revision

TeStor

Test CaseImplementation

Test CaseExecution

System Release

OK

NOK

SystemImplementation

ImplementationRevision

a1

a2

a3

a4

a5 a7

a6

a8

5SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Our Recent experience in SA-based Analysis

» Industrial Experience

- PSTDA Italy [ICSE00,ICSE01]

- Telcordia

- Marconi [FME 03]

- Siemens [ITM 04]

» Academic Experience

- [FASE 04][IEEE TSE04]

- [CBSE 05][COMPSAC05]

6SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Considerations

» What happens if the (architectural) model changes?

- Usually, we need to remake analysis from scratch

Software Architecture SA1(version 1)

Component A Component C

Component B

Software Architecture SA2(version 2)

Component AComponent C'

Component B

Component Y

7SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

How changes affect ModTest

Requirements

SoftwareArchitecture

M.C.[NOK]

refine SA OK [test case selection]

drive

identifyModel

Checking

SA conformance to requirements through MC

SA model functionalproperties

SystemImplementation

TestExec

[NOK]Fault removal

Testing

Implementation conformance to SA through Testing

Test spec

TestProcedures

Test Caseselection

SA spec

Test implementation

Test execution

8SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

SA-based Regression Testing [WADS05] [COMPSAC05]

Code1(version 1)

Code2(version 2)

Software Architecture SA1(version 1)

Component A Component C

Component B

Software Architecture SA2(version 2)

Component AComponent C'

Component B

Component Y

Code

Software Architecture SA1(version 1)

Component A Component C

Component B

Code1(version 1)

Test Reuse

Test Reuse

Test Reuse

SA evolution

Code evolution

9SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Traditional Regression Testing

» Test modified software to provide a certain confidence that no new errors are introduced into previously tested code.

» Two key phases:

i) testing the program P with respect to a specified test suite T, and

ii) when a new version P' is released, regression testing of the modified version P' versus a test suite T'

» Selective RT:

- Goal: selecting T' as a “relevant” subset of T

> t1 in T is included in T ' if there is the potential that it could produce different results on P' than it did on P

10SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

First phase: SA-based Code Testing» The code conformance to the SA has been already tested

Component

Component

Component

Connector

Code “P”Software Architecture “S”

Run TC over P andEvaluate Results

Refine SA-level testsinto Code-level tests

Steps 0 - 2

Identify relevantSA-level Test Cases

Step 3 Step 4

XClient

ClientA ClientB

ClientC

Class--------------------------

11SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

SArTe – Goal 1 (code evolution)

Code1(version 1)

Code2(version 2)

Software Architecture SA1(version 1)

Component A Component C

Component B

Software Architecture SA1(version 1)

Component A Component C

Component B

Code1(version 1)

Test Reuse

» Test Conformance of a Modified Implementation P' to the initial SA

- Context:

> P correctly implements the SA S

> P' modifies P: some objects are modified, and/or some new objects are introduced.

- Goal: Test the conformance of P' with respect to S,

> while reusing previous test information for selective regression testing, thereby reducing the test cases that must be retested.

- To handle Architectural Drift

12SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

SArTe – Goal 2 (SA evolution)

Code2(version 2)

Software Architecture SA1(version 1)

Component A Component C

Component B

Software Architecture SA2(version 2)

Component AComponent C'

Component B

Component Y

Code

Test Reuse

Test Reuse

» Test Conformance of an Evolved Software Architecture

- Context:

> P correctly implements the SA S

> S’ modifies S, adding or removing components

> A modified implementation P' may have been also developed.

- Goal: Test the conformance of P’ with respect to S',

> while reusing previous test information for selective RT, thereby reducing the test cases that must be retested.

13SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Goal 1: P changes

Step 0SA-spec for S

Testing Criterion

Map ATCs into Code-levelTest Cases

as a way to select T for P

Extract SA-levelTest Cases (ATCs)

Run T over Pand Evaluate Results

Step 1

Step 2

Step 3

Step 4

Build the GPgraph for P

Build the GP’graph for P’

Compare GP with GP’

Create a Test History

Select T' for P'

SA-basedRegression Testing

- Goal 1 -

SA-based Code Testing

Step B

Step C

Step D

Step A

14SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Considerations

» Differences with respect to traditional code-based selective RT techniques:

- code-level test cases are always selected starting from a well formalized architectural specification.

- the oracle in SA-based RT is the software architecture specification itself.

» Advantages:

- as in traditional RT, we reduce the size of the test suite for P', eliminating all those tests which do not need to be reapplied to P', and

- when conformance faults are detected, we can gather information on how to adjust the initial architecture.

15SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Goal 2: SA changes

Step 0

SA-spec for S

Testing Criterion

Map ATCs into Code-levelTest Cases

as a way to select T for P

Extract SA-levelTest Cases (ATCs)

Run T over Pand Evaluate Results

Step 1

Step 2

Step 3

Step 4

SA-based Code Testing

SA-spec for S’’

Compare S and S’’

Select ATCs’’ from S that needto be retested in S’’

Map ATCs’’ into Code-level TestCases as a way to select T’’ for P’’

Run T’’ over P’’ and Evaluate Results

SA-basedRegression Testing

- Goal 2 -Step a

Step c

Step d

Step e

Step f

Testing CriterionStep b

16SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Goal 2 Idea» Compare the two architectural specifications to identify

changed/unchanged portions of the SA.

- Both structural and behavioral changes are taken into account

> We compare the topology changes (if the SA structure changed)

> We compare the behavioral changes (if the SA behavior changed)

- and, in a fashion similar to traditional code-based RT,

> ATC needs to be re-run in S'‘, if it traverses a path modified when moving from S to S''

17SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Experiment 1: the Elevator SA

BuildingPanel

ElevatorPanel1

ElevatorADT1

ElevatorPanel1

ElevatorADT1

Scheduler

ElevatorPanel2

ElevatorADT2

BuildingPanel

Elevator SystemVersion 1

Elevator SystemVersion 2

18SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Experiment 2: the Cargo Router System

Graphics Binding (GB)

CargoRouter(CR)

PortArtist (PA)

VehicleArtist (VA)

NextShipment (NS)

Cargo Router, Version 1

WarehouseArtist (WA)

Port(P)

Vehicle(V)

Warehouse(W)

CargoRouter2(CR2)

PortArtist2 (PA2)

VehicleArtist2 (VA2)

Translator (T)

WarehouseArtist2 (WA2)

Cargo Router, Version 2

Clock(C)

PlannerArtist(PlA)

Planner (P)Bus1

Bus2

Bus2A Bus2B

Bus3ABus3

Bus4

Bus3C

a) b)

Note: In Version2, the connection (*)is replaced with the connections (**)

(*)(**)

(**)

19SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Future Work

» To reconstruct the actual architecture when the first goal determines that the code no longer conforms to the initial SA

» Regression Testing of Component-based Software Architectures

» Regression-based Analysis of ModTest

» Apply/refine this approach into real systems (SiemensC.N.X., Terma GmbH)

20SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

Contact Information» Henry Muccini

- Dipartimento di Informatica, Universita' dell'Aquila, L'Aquila, Italy

- muccini@di.univaq.it

» Marcio Dias

- Department of Computer Science and e-Science Research Institute, University of Durham, UK

- marcio.dias@dur.ac.uk

» Debra J. Richardson

- Donald Bren School of Information and Computer Sciences, University of California Irvine, USA

- djr@ics.uci.edu

21SEA Group

© 2005 by H. Muccini, WADS 2005 SEA Group

SA diff

ATC1 in T ATC2 in T ATC1 in T’

S1

e1

S0

e1

e1e10

in(x)

S3e5

e0

e4in(y)S2S4

S6

e6e9

S7

S5

in(a)

e8e7

out(z)

in(z)

out(c)

in(b)

e6

e4

S1

e1

S0

e1

e1e10

in(x)

S3e5

e0

e4in(y)S2S4

S6

e6e9

S7

S5

in(a)

e8e7

out(z)

in(z)

out(c)

in(b)

e6

e4

S1

e1

S0

e1

e1e10

in(x)

S3e5

e0

e4in(y)S2S4

S6

e6e9

S7

S5

in(a)

e8e7

out(z)

in(z)out(w)

out(c)

in(b)S5'

e6

e4

S1

e1

S0

e1

e1e10

in(x)

S3

e0

e4in(y)S2S4

S6

e6e9

S7

S5

in(a)

e8e7

out(z)

in(z)out(w)

out(c)

in(b)S5'

e6

e4

top related