Test Oracles and Test Script Generation in Combinatorial Testing - - PowerPoint PPT Presentation

test oracles and test script generation in combinatorial
SMART_READER_LITE
LIVE PREVIEW

Test Oracles and Test Script Generation in Combinatorial Testing - - PowerPoint PPT Presentation

Test Oracles and Test Script Generation in Combinatorial Testing Peter M. Kruse Berner & Mattner Systemtechnik GmbH Berlin, Germany Overview Classification Tree Method Expected results Executable test scripts Test Oracles and


slide-1
SLIDE 1

Test Oracles and Test Script Generation in Combinatorial Testing

Peter M. Kruse Berner & Mattner Systemtechnik GmbH Berlin, Germany

slide-2
SLIDE 2

Overview

  • Classification Tree Method
  • Expected results
  • Executable test scripts

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 2

slide-3
SLIDE 3

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 3

Combinatorial Testing Background

  • Combinatorial Interaction Testing (CIT) is a black box system testing

technique that samples inputs, configurations and parameters and combines them in a systematic fashion.

  • Creating functional tests derived from software's specifications

Thomas J. Ostrand and Marc J. Balcer. The Category-Partition Method for specifying and generating functional tests, 1988

  • Coverage Criterion: Minimum, Maximum, Pairwise, N-Wise
  • Pairwise NP Complete

Yu Lei, Kuo-Chung Tai. In-parameter-order: a test generation strategy for pairwise testing, 1998

  • N-wise NP Complete

Alan W. Williams and Robert L. Probert. A measure for component interaction test coverage, 2001

  • Constraints

Myra B. Cohen, Matthew B. Dwyer, and Jiangfan Shi. Interaction testing of highly-configurable systems in the presence of constraints, 2007

slide-4
SLIDE 4

Classification Tree Method

  • Grochtmann/Grimm 1993, Daimler Research

Two Steps:

  • 1st Design Classification Tree

– One Classification per test aspect (Parameter) – One Class for each parameter value – Resulting in a Tree of Classifications

  • 2nd Compose Test Cases

– Can be automated using TESTONA tool (formerly Classification Tree Editor)

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 4

slide-5
SLIDE 5

Example

  • Test object: Database Management System

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 5

Select a test object: decompose

5

slide-6
SLIDE 6

Input domain Determine input data space Select a test object: decompose

TESTONA – Test Design using the Classification Tree Method • October 2015

Example

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 6

slide-7
SLIDE 7

Privileges Operation Access Method

Input domain Identify relevant aspects (e.g. from specification) Determine input data space Select a test object: decompose

TESTONA – Test Design using the Classification Tree Method • October 2015

Example

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 7

slide-8
SLIDE 8

Input domain

Privileges Operation Access Method

Classify the input data space into classes

TESTONA – Test Design using the Classification Tree Method • October 2015

Example

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 8

slide-9
SLIDE 9

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 9

1 2 3

Input domain

Privileges Operation Access Method

Classify the input data space into classes Combine classes into test cases

TESTONA – Test Design using the Classification Tree Method • October 2015

Example

slide-10
SLIDE 10

Test Oracle

  • Howden (1978)

non-trivial challenge of deciding whether a test case has passed or failed

  • Categorization by Barr, Harman, McMinn,

Shahbaz, and Yoo (2015)

– non-automated – implicit – derived – specified

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 10

slide-11
SLIDE 11

11 2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing

Non-automated Oracles

  • Trivial case
  • Mapping function

f(tq) = Rq unknown Implicit Oracles

  • Indirect evaluation

(e.g. no exception)

  • Mapping function

Rq = R1 = R2 = … = Rn Derived Oracles

  • A posteriori (e.g.

Regression Test, back-to-back Test)

  • Mapping function

f(tq) = Rq not needed Specified Oracles

  • Based on (formal)

Specification

  • Mapping function

f(tq) = Rq known

slide-12
SLIDE 12

Non-automated Oracle Example

  • Manual assignment for each test case

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 12

slide-13
SLIDE 13

Test Oracles and Test Script Generation in Combinatorial Testing 13

Implicit Oracle Example

2016-04-10

No exceptions at runtime, …

  • Monitor system
slide-14
SLIDE 14

Test Oracles and Test Script Generation in Combinatorial Testing 14

Derived Oracle Example

2016-04-10

  • Run once, record results, assign to tests
slide-15
SLIDE 15

Test Oracles and Test Script Generation in Combinatorial Testing 15

Specified Oracle Example

C2 ↔ R1 C1 ʌ ( C3 v (C4 ʌ ¬C10)) ↔ R2

2016-04-10

slide-16
SLIDE 16

Specified Oracle Example

Using constraints can be problematic

  • 1. Makes computation of output more difficult,

solver must be used

  • 2. possible to write incomplete/inconsistent

mappings (e.g. C1 ↔ R1 and C1 ↔ R2)

  • 3. allows non-determinism

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 16

TESTONA has build in Solver Task of test designer

slide-17
SLIDE 17

Test Oracles and Test Script Generation in Combinatorial Testing 2016-04-10

Test Script Generation

  • Problem: How to execute test specification?

17

slide-18
SLIDE 18

2016-04-10 18 Test Oracles and Test Script Generation in Combinatorial Testing

Test Script Generation

@Test public void %TEST% throws Exception { } import org.junit.Assert.*; public class Example { }

Include these per mark in test case Include this per test case Include this once at start

slide-19
SLIDE 19

2016-04-10 19 Test Oracles and Test Script Generation in Combinatorial Testing

Test Script Generation

@Test public void %TEST% throws Exception { } import org.junit.Assert.*; public class Example { }

Include these per mark in test case Include this per test case Include this once at start

slide-20
SLIDE 20

Effort Considerations

  • Instead of implementing each test case
  • Implement each parameter
  • Less effort
  • Reusable

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 20

To be evaluated large scale Formalization in the paper

slide-21
SLIDE 21

Related Work

  • Most work on CT focuses on the calculation of

minimal size test suites, mostly pairwise.

  • Some CT approaches consider test oracles.
  • Reports on test implementation and test

execution are limited.

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 21

slide-22
SLIDE 22

Non-automated Oracles

  • All approaches

Implicit Oracles

  • AETG, ACTS

Derived Oracle

  • ACTS

Specified Oracles

  • AETG, PICT, ACTS,

ATGT, FoCuS

Related Work – Oracles

“Oracle-free Testing“ IWCT‘15

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 22

slide-23
SLIDE 23

Related Work Test Implementation

  • Integrated Approach also for

– Category Partition Method (as part of specification language) – FoCuS (using post-pressing with templates)

  • External Solutions

– AETG (use of perl script reported) – PICT – ACTS – …

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 23

slide-24
SLIDE 24

Future Work

  • Large scale evaluation
  • Effort for different test

script generation approaches with focus on test suite maintenance

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 24

– costs of adapting existing test suites, test scripts, post-processors when parameters are added, modified or removed

  • What about model import?

– UML, Statecharts, …

slide-25
SLIDE 25

Conclusion

  • Post-processing is avoided in our approach
  • Test implementation allows for the direct

execution of combinatorial test suites

  • Independent of different SUT types
  • Several kinds of oracles are supported

2016-04-10 Test Oracles and Test Script Generation in Combinatorial Testing 25 Peter M. Kruse Berner & Mattner Systemtechnik GmbH