• No results found

Di 3.1. A Test Design Poster for Testers, Developers, and Architects. Peter Zimmerer

N/A
N/A
Protected

Academic year: 2021

Share "Di 3.1. A Test Design Poster for Testers, Developers, and Architects. Peter Zimmerer"

Copied!
22
0
0

Loading.... (view fulltext now)

Full text

(1)

Di 3.1

January 26-30, 2009, Munich, Germany ICM - International Congress Centre Munich

A Test Design Poster for Testers, Developers, and Architects

Peter Zimmerer

(2)

Copyright © Siemens AG 2009. All rights reserved.

Corporate Technology

OOP 2009

Munich, Germany

Peter Zimmerer

Principal Engineer Siemens AG, CT SE 1

Corporate Technology

Corporate Research and Technologies Software & Engineering, Development Techniques

81739 Munich, Germany [email protected]

http://www.siemens.com/research-and-development/

http://www.ct.siemens.com/

A Test Design Poster for Testers, Developers, and Architects

Contents

Introduction

ƒ Test design methods

Here: methods, paradigms, techniques, styles, and ideas to create, derive, select, generate a test case

ƒ Motivation – who cares about test design methods?

ƒ Examples and references

ƒ Problem statement

Poster Test Design Methods on One Page Guidelines and experiences

Backup – Details on test design methods

(3)

Page 3 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Introduction – Test design methods

Good test design, i.e. high-quality test cases, is very important

There are many different test design methods and techniques

ƒ Static, dynamic

ƒ Black-box, white-box, grey-box

ƒ Based on fault model, experience, exploratory

ƒ Statistical (user profiles), random (monkey) The challenge is to adequately combine these methods dependent on the given problem, domain, and requirements

ƒ This is art as well!

Black-box test design methods are often based on models – model-based testing

Some systematic methods for test design

Black-box (models, interfaces, data)

ƒ Requirements-based (traceability matrix)

ƒ Use case-based testing, scenario testing

ƒ Design by contract

ƒ Equivalence class partitioning

ƒ Classification-tree method

ƒ Boundary value analysis

ƒ State-based testing

ƒ Cause-effect graphing

ƒ Decision tables, decision trees

ƒ Combinatorial testing (n-wise)

White-box (internal structure, paths)

ƒ Control flow testing

ƒ Data flow testing

Selection, usage, and

applicability depends on the

ƒ specific domain (domain knowledge is required!)

ƒ used software technology

ƒ test requirements: required test intensity, quality criteria, risks

ƒ existing test basis:

specifications, documents, models

ƒ project factors: constraints

and opportunities

(4)

Page 5 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Who cares / should care about test design methods?

Requirements engineers Æ Requirements testing

Architects Æ Architecture testing

Developers Æ Unit testing

Test engineers Æ All the rest: system testing, …

Important: collaboration between the different stakeholders

Test levels – example V model with architecture testing

System Requirements

Architecture, Design

Unit Specification

Acceptance Testing System Testing Integration

Testing Unit

Testing User

Requirements

Code Quality Management Architecture

interrogation:

interviews, interactive workshops

Evaluation, prototyping, simulation

Architecture testing

– any testing of architecture and architectural artifacts Test case design

Analysis, reviews, previews, inspections

Load model specification

based on

Coding

Static testing

(5)

Page 7 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Test design methods ÅÆ Preventive Testing ≈ TDD

Preventive testing is built upon the observation that

one of the most effective ways of specifying something is to describe (in detail) how you would accept (test) it

if someone gave it to you.

David Gelperin, Bill Hetzel (<1990) Given any kind of specification for a product,

the first thing to develop isn't the product, but how you'd test the product.

Don’t start to build a product till you know how to test it.

Tom Gilb The act of designing tests is one of the

most effective bug preventers known.

Boris Beizer, 1983

Test design methods ÅÆ Test basis

Selection, usage, and applicability of test design methods depends on the existing test basis: specifications, documents, models

Therefore, any person who is involved in any specification activity should know about test design methods, at least a little …

Example Architect:

Specify your architecture (especially the dynamic behavior) by using the right models, formats, and notations

to provide an adequate test basis

to enable more effective and more efficient testing

BTW, how can you do this adequately without knowing anything

about test design methods???

(6)

Page 9 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Test design methods ÅÆ Risks

Test design methods address risks

ÆSee especially fault-based test design methods

Test design methods are a rich source describing what might go wrong in the product or system

Test design methods are very helpful

ƒ to identify and analyze risks w.r.t. architecture, software technologies, etc.

ƒ to built-in better design for testability (DFT)

Test design methods are an integral part of the testing strategy

BTW, how can you do this adequately without knowing anything about test design methods???

What is a Test Case?

A set of input values, execution preconditions, expected results and execution postconditions, developed for a particular objective or test condition, such as to exercise a particular program path or to verify compliance with a specific requirement. ISTQB 2007, IEEE 610

A Test Case should include

ƒ unique identification – who am I?

ƒ test goal, test purpose – why? ÅÆ link to requirements

ƒ test conditions/requirements – what? ÅÆ coverage!!!

ƒ preconditions – system state, environmental conditions

ƒ test data – inputs, data, actions

ƒ execution conditions – constraints, dependencies

ƒ expected results – oracles, arbiters, verdicts, coverage, traces

ƒ postconditions – system state, expected side effects, expected invariants, traces,

environmental conditions

(7)

Page 11 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Test design methods and test cases

Test design methods mainly help us to identify the

ƒ test data – inputs, data, actions i.e. especially the input values for the test cases

and hopefully provide us some information about the

ƒ expected results – oracles, arbiters, verdicts, coverage, traces at least to some extent

Typically test design methods alone cannot supply

ƒ preconditions – system state, environmental conditions

ƒ execution conditions – constraints, dependencies

ƒ expected results – oracles, arbiters, verdicts, coverage, traces

ƒ postconditions – system state, expected side effects, expected invariants, traces,

environmental conditions

Generally these items must be determined from the test basis

depending on the context: project, domain, requirements, constraints

Example – There are always too many test cases ...

(8)

Page 13 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Examples – Demo

ƒ Microsoft PowerPoint

ƒ Microsoft Word 2002

Test effectiveness and formal (systematic) test design

There are studies showing advantages of systematic test design.

There are also studies showing advantages of random testing.

Æ But do you really want to design your test cases only randomly?

Formal test design was almost twice as effective in defect detection per test case as compared to expert (exploratory) type testing, and much more effective compared to checklist type testing.

Bob Bartlett, SQS UK, 2006

(9)

Page 15 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Many testing books cover test design to some extent

ƒ Boris Beizer: Software Testing Techniques

ƒ Robert V. Binder: Testing Object-Oriented Systems: Models, Patterns, and Tools

ƒ Lee Copeland: A Practitioner's Guide to Software Test Design

ƒ Rick D. Craig, Stefan P. Jaskiel: Systematic Software Testing

ƒ Tim Koomen et. al.: TMap Next: For Result-driven Testing

ƒ Glenford J. Meyers: The Art of Software Testing

ƒ Torbjörn Ryber: Essential Software Test Design

ƒ James Whittaker: How to Break Software

ƒ James Whittaker, Herbert Thompson: How to Break Software Security

ƒ Standard for Software Component Testing by the British Computer Society Specialist Interest Group in Software Testing (BCS SIGIST) (see http://www.testingstandards.co.uk/)

There are many different training offerings by different providers

Test design tools are typically focused and implement only a few test design methods – some examples

ƒ ATD – Automated Test Designer (AtYourSide Consulting, http://www.atyoursideconsulting.com/): cause-effect graphing

ƒ BenderRBT (Richard Bender, http://www.benderrbt.com/):

cause-effect graphing, quick design (orthogonal pairs)

ƒ CaseMaker (Diaz & Hilterscheid, http://www.casemaker.de/):

business rules, equivalence classes, boundaries, error guessing, pairwise combinations, and element dependencies

ƒ CTE (Razorcat, http://www.ats-software.de/): classification tree editor

ƒ MaTeLo (All4tec, http://www.all4tec.net/): markov chains

ƒ Qtronic (Conformiq, http://www.conformiq.com/): state-based testing

ƒ Reactis (Reactive Systems, http://www.reactive-systems.com/):

generation of test data from, and validation of, Simulink and Stateflow models

ƒ Test Designer (Smartesting, http://www.smartesting.com/): state-based testing

ƒ TestBench (Imbus, http://www.testbench.info/, http://www.imbus.de/):

equivalence classes, work-flow / use-case-based testing

(10)

Page 17 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Problem statement

Starting from a risk-based testing strategy an adequate test design is the key for effective and efficient testing.

Automation of bad test cases is a waste of time and money!

There are many different test design methods around for a long time (perhaps too many?) and a lot of books explain them in detail.

There are different

ƒ categorizations, classifications, and dimensions

ƒ naming, interpretations, and understandings

of test design methods which does not simplify their usage … When we look into practice we can see that often there is quite limited usage of these test design methods at all.

What are the reasons behind that?

How can we overcome this and improve our testing approaches?

Poster Test Design Methods on One Page (1)

Idea:

Systematic, structured, and categorized overview about different test design methods on one page

Focus more on using an adequate set of test design methods than on using only one single test design method in depth / perfection

Focus more on concrete usage of test design methods than on defining a few perfect test design methods in detail which are not used then in the project

Focus more on breadth instead on depth

ƒ Do not miss breadth because of too much depth

Do not miss the exploratory, investigative art of testing

(11)

Page 19 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Poster Test Design Methods on One Page (2)

Effort / Difficulty / Resulting Test Intensity (5 Levels) Key

Methods, Paradigm s, Techniques, Styles, and Ideas to Create a Test Case Categorization

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-based Coverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection

Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports

Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values

Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise)

Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing

Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains)

CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

Poster Test Design Methods on One Page (3)

Categories of test design methods are orthogonal and independent in some way but should be combined appropriately.

The selection of the used test design methods depends on many factors, for example:

ƒ Requirements of the system under test and the required quality

ƒ Requirements for the tests – quality of the tests, i.e. the required intensity and depth of the tests

ƒ Testing strategy: effort / quality of the tests, distribution of the testing in the development process

ƒ Existing test basis: specifications, documents, models

ƒ Problem to be tested (domain) or rather the underlying question (use case)

ƒ System under test or component under test

ƒ Test level / Test step

ƒ Used technologies (software, hardware)

ƒ Suitable tool support: for some methods absolutely required

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-basedCoverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise) Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains) CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

(12)

Page 21 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Poster Test Design Methods on One Page (4)

The effort / difficulty for the test design methods or rather the resulting test intensity is subdivided into 5 levels:

ƒ 1 very low, simple

ƒ 2 low

ƒ 3 medium

ƒ 4 high

ƒ 5 very high, complex

This division into levels is dependent on the factors given above for the selection of the test design methods and therefore can only be used as a first hint and guideline.

A test design method also may be used continuously from

“intuitive use” up to “100% complete use” as required.

In addition describe every test design method on one page to explain their basic message and intention.

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-basedCoverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise) Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains) CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

Guidelines and experiences (1)

For beginners

ƒ perhaps you are confused about the many test design methods

ƒ start simple, step by step

ƒ ask for help and advice by an experienced colleague, coach or consultant For advanced, experienced testers (and developers!)

ƒ check your current approach against this poster, think twice, and improve incrementally

Use the poster as a checklist for existing test design methods

Selection of test design methods is dependent on the context!

So, you should adapt the poster to your specific needs.

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-basedCoverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise) Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains) CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

(13)

Page 23 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Guidelines and experiences (2)

Pick up this poster and

ƒ give it to every developer and tester in your team or

ƒ put it on the wall in your office or

ƒ make it the standard screensaver or

desktop background for all team members or

even use the testing on the toilet approach by Google (see http://googletesting.blogspot.com/) …

The poster increases visibility and importance of test design methods, especially also for developers to improve unit testing

The poster facilitates a closer collaboration of testers and developers: you have something to talk about ...

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-basedCoverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise) Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains) CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

Summary

There exist many different methods for adequate test design.

When looking into practice often these test design methods are used only sporadically and in a non-systematical way.

The poster Test Design Methods on One Page

containing a systematic, structured, and categorized overview about test design methods will help you to really get them used in practice in your projects

ƒ Do not miss breadth because of too much depth

This will result in better and smarter testing for testers, developers, and architects

Black-box 3

(models, interfaces, data) 3

3 3 4 4 4 4 1 3 2 4 3 2 1 5 3 5 5 4 3 4 5

Grey-box 2

3 3 3 4

White-box Control flow-basedCoverage Statements (C0), nodes 2

(internal structure, paths) (specification-based, Branches (C1), transitions, links, paths 3

model-based, Conditions, decisions (C2, C3) 4

code-based) Elementary comparison (MC/DC) 5

Interfaces (S1, S2) 4

Static metrics Cyclomatic complexity (McCabe) 4

Metrics (e.g. Halstead) 4

Read / Write access 3

Def / Use criteria 5

Positive, valid cases 1

Negative, invalid cases 3

3 5

Fault-based 2

4 3 4 3 2 2 3 1 2 2 4 5

Regression (selective retesting) 5

2 3 2 5 Communication behavior (dependency analysis)

Fault injection Test catalog / matrix for input values, input fields State-based testing (Final State Machines) Cause-effect graphing

Normal, expected behavior Error handling

T e s t D e s i g n M e t h o d s o n O n e P a g e

Ad hoc, intuitive, based on experience, check lists Bug reports Bug patterns: standard, well-known bug patterns or produced by a root cause analysis Systematic failure analysis (Failure Mode and Effect Analysis, Fault Tree Analysis) Dependencies / Relations between classes, objects, methods, functions Dependencies / Relations between components, services, applications, systems Special values Standards (e.g. ISO/IEC 9126, IEC 61508), norms, (formal) specifications, claims

Retest by risk, priority, severity, criticality Retest all

User / Operational profiles: frequency and priority / criticality (Software Reliability Engineering)

Protocol based (sequence diagrams, message sequence charts)

Test patterns (e.g. by Robert Binder), Questioning patterns (Q-patterns by Vipul Kocher) Combinatorial testing (pair-wise, orthogonal / covering arrays, n-wise) Evolutionary testing Equivalence class partitioning Features, functions, interfaces

Attack patterns (e.g. by James A. Whittaker)

Retest changed parts Error guessing Error catalogs, bug taxonomies (e.g. by Boris Beizer, Cem Kaner)

Retest by profile, frequency of usage, parts which are often used Statistical testing (markov chains) CRUD (Create, Read, Update, Delete) (data cycles, database operations) Requirements-based with traceability matrix (requirements x test cases) Use case-based testing (sequence diagrams, activity diagrams) Flow testing, scenario testing, soap opera testing

Random (monkey testing) Design by contract (built-in self test)

Data flow-based Decision tables, decision trees Classification-tree method

Syntax testing (grammar-based testing) Time cycles (frequency, recurring events, test dates) Domain partitioning, category-partition method Boundary value analysis

Trace-based testing (passive testing)

Invalid, unexpected behavior Exceptions Risk-based

Fault model dependent on used technology and nature of system under test

Exploratory testing, heuristics, mnemonics (e.g. by James Bach, Michael Bolton) Mutation testing

Retest parts that are influenced by the changes (impact analysis, dependency analysis)

(14)

Page 25 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Backup – Details on test design methods

Requirements-based with traceability matrix Inventory tracking matrix

x x

Risk 3

x x

Risk 2

x x

Risk 1 Risks

x Objective 3

x x

x Objective 2

x Objective 1

Objectives

x Use Case 3

x Use Case 2

x x

Use Case 1 Use Cases

x x

Feature 3

x x

Feature 2

x x

Feature 1 Features

x x

Requirement 3

x x

x Requirement 2

x Requirement 1

Requirements

Test Case 8 Test Case 7

Test Case 6 Test Case 5

Test Case 4 Test Case 3

Test Case 2 Test Case 1

Inventories

Test Cases

Objectives /

(15)

Page 27 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Use case-based testing – Scenario testing

A scenario is a hypothetical story used to help a person think through a complex problem or system

Based e.g. on transaction flows, use cases, or sequence diagrams

A specific, i.e. more extreme kind of scenario testing is the so-called soap opera testing

Example: Soap opera testing

Ref.: Hans Buwalda: Soap Opera Testing,

Better Software, February 2004

(16)

Page 29 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Soap opera testing – Test objectives

Corresponds to the traceability matrix

Ref.: Hans Buwalda: Soap Opera Testing, Better Software, February 2004

Equivalence class partitioning and boundary values

Goal:

Create a minimum number of black box tests needed while still providing adequate coverage.

Two tests belong to the same equivalence class if you expect the same result (pass / fail) of each. Testing multiple members of the same equivalence class is, by definition, redundant testing.

Boundaries mark the point or zone of transition from one

equivalence class to another. The program is more likely to fail at a boundary, so these are the best members of (simple, numeric) equivalence classes to use.

More generally, you look to subdivide a space of possible tests into

relatively few classes and to run a few cases of each. You’d like to

pick the most powerful tests from each class.

(17)

Page 31 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Example: a software thermostat

Ref.: Stuart Reid, EuroSTAR Conference 2006

Equivalence class partitioning and

boundary value analysis with 2 parameters

b

a b

b

a a

max

min

max min

b

a b

b

a a

max

min

max

min b

a b

b

a a

max

min

max min

# test cases for n parameters and one valid equivalence class: 4n + 1

# test cases for n parameters and one valid and one invalid

equivalence class: 6n + 1

(18)

Page 33 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Example: Classification-tree method

Ref.: CTE XL, http://www.systematic-testing.com/

Example: State-based testing

State table S new / X …

X is action (or event)

and S new is the resulting new state;

action N means “do nothing”

State transition diagram State 1

State 2

State 3

Cond_1 / A

Cond_2 / B Cond_3 / C

Cond_4 / D

3 / D 1 / C

3 / N 3 / N

State 3

2 / N 2 / N

3 / B 2 / N

State 2

1 / N 1 / N

1 / N 2 / A

State 1

Cond_4 Cond_3

Cond_2 Cond_1

State

Condition

(19)

Page 35 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Example: Cause-effect graphing

Requires dependencies between parameters and can get very complicated and difficult to implement

Example: Combinatorial Testing (pairwise testing)

Given a system under test with 4 parameters A, B, C, and D

ƒ Each parameter has 3 possible values

ƒ Parameter A: a1, a2, a3

ƒ Parameter B: b1, b2, b3

ƒ Parameter C: c1, c2, c3

ƒ Parameter D: d1, d2, d3

ƒ A valid test input data set is e.g. {a2, b1 , c2 , d3}.

Exhaustive testing would require 3 4 = 81 test cases Only 9 test cases are

already sufficient to cover

all pairwise interactions of

parameters

(20)

Page 37 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Control flow-based Unit/Module

System Integration

Use it on different levels of abstraction:

model, unit, integration, system

Data flow-based

defined / used paths

ƒ defined (d)

ƒ for example value assigned to a variable, initialized

ƒ used (u)

ƒ for example variable used in a calculation, predicate

ƒ predicate-use (p-u)

ƒ computation-use (c-u)

Test du-paths

Read / write access:

“data source“ and “data sink“

Use it on different levels of abstraction:

model, unit, integration, system

(21)

Page 39 January 27, 2009 Peter Zimmerer, CT SE 1 © Siemens AG, Corporate Technology

Example: Heuristics and mnemonics*

Boundary values

CRUD (data cycles, database operation)

ƒ Create, Read, Update, Delete

HICCUPPS (oracle)

ƒ History, Image, Comparable Products, Claims, User’s Expectations, Product, Purpose, Statutes

SF DePOT (San Francisco Depot) (product element, coverage)

ƒ Structure, Function, Data, Platform, Operations, Time

CRUSSPIC STMPL (quality criteria)

ƒ Capability, Reliability, Usability, Security, Scalability, Performance, Installability, Compatibility, Supportability, Testability, Maintainability, Portability, Localizability

FDSFSCURA (testing techniques)

ƒ Function testing, Domain testing, Stress testing, Flow testing, Scenario testing, User testing, Risk testing, Claims testing, Automatic Testing

FCC CUTS VIDS (application touring)

ƒ Feature tour, Complexity tour, Claims tour, Configuration tour, User tour, Testability tour, Scenario tour, Variability tour, Interoperability tour, Data tour, Structure tour

*Ref.: James Bach, Michael Bolton, Mike Kelly, and many more

(22)

References

Related documents