Testing-Aeronautical Engineering And Computer Programming-Lecture Slides, Slides of Aeronautical Engineering

Prof. Balamohan Pawar delivered this lecture at Allahabad University for Aeronautical Engineering and Computer Programming course. Its main points are: Testing, Technique, Classes, System, Error, Case, Fault, Coverage, Box, Specification, Black

Typology: Slides

2011/2012

Uploaded on 07/20/2012

savitha_48
savitha_48 🇮🇳

3

(1)

109 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
3
Testing
Testing is a process of executing a software program
with the intention of finding a error
is one that has a high probability of
finding an as-yet undiscovered error
test is one that uncovers an as-yet
undiscovered error”
(Glen Myers,“The art of software testing”)
systematically uncover different
classes of errors
4
Test Techniques 1
used to measure the adequacy of a set
of test cases:
Coverage-based testing
coverage of the product to be tested
Fault-based testing
the adequacy
Error-based testing
of the typical errors that people make
Primary objectives
A good test case
A successful
Secondary Objectives
Design tests that
Do so with a minimum of time and effort
Provide reliable indications of software quality
Classified according to the criterion
• Testing requirements are specified in terms of the
• Fault detecting ability of the test set determines
• Focus on error-prone points, based on knowledge
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Testing-Aeronautical Engineering And Computer Programming-Lecture Slides and more Slides Aeronautical Engineering in PDF only on Docsity!

3

Testing

  • Testing is a process of executing a software program with the intention of finding a error
  • is one that has a high probability of finding an as-yet undiscovered error
  • test is one that uncovers an as-yet undiscovered error” (Glen Myers, “The art of software testing” )
  • systematically uncover different classes of errors

4

Test Techniques 1

used to measure the adequacy of a set

of test cases:

  • Coverage -based testing

coverage of the product to be tested

  • Fault -based testing

the adequacy

  • Error -based testing

of the typical errors that people make

Primary objectives

A good test case

A successful

Secondary Objectives Design tests that

Do so with a minimum of time and effort Provide reliable indications of software quality

• Classified according to the criterion

  • Testing requirements are specified in terms of the
  • Fault detecting ability of the test set determines
  • Focus on error-prone points, based on knowledge

5

(Definitions)

• Error

result

• Fault

fault. A fault thus is the manifestion of an error

• Failure

are

failures

6

PRS

Exception handling is used to capture:

  • Error is a human action that produces an incorrect
  • Consequence of an error is software containing a
  • If encountered, a fault may result in a failure

• What we observe during testing

1. Errors

2. Faults

3. Failures

4. I am still sleeping …

Inputs causing anomalous behaviour

Outputs which reveal the presence of defects

9

Black-Box Testing

I e

O (^) e

System

Inputs causing

behavior

Outputs which reveal

I

O

10

Equivalence Partitioning

into different classes where all members

of a class are related

partition where the program behaves in

an equivalent way for each class member

partition

Input test data

Output test results

anomalous

the presence of defects

• Input data and output results often fall

• Each of these classes is an equivalence

• Test cases should be chosen from each

11

Equivalence Partitioning

12

‘equivalence sets’

5-digit integer between 10,000 and 99,999 equivalence partitions are

sets

Equivalence Partitioning

• Partition system inputs and outputs into

  • If input is a
    • <10,
    • 10,000-99,
    • 99,

• Choose test cases at the boundary of these

System

Outputs

Invalid inputsInvalid inputsInvalid inputs Valid inputsValid inputs

System

outputs

invalid inputs valid inputs

15

Testing Guidelines (Sequences)

have only a single value

different tests

and last elements of the sequence are

accessed

16

(T) ( ) ( ) 17 17 0 17 45 23 25

• Test software with sequences which

• Use sequences of different sizes in

• Derive tests so that the first, middle

• Test with sequences of zero length

Array Element Single value In sequence Single value Not in sequence More than 1 value First element in sequence More than 1 value Last element in sequence More than 1 value Middle element in sequence More than 1 value Not in sequence

Input sequence Key Key Output Found, L true, 1 17 false, ?? 17, 29, 21, 23 true, 1 41, 18, 9, 31, 30, 16, 45 true, 7 17, 18, 21, 23, 29, 41, 38 true, 4 21, 23, 29, 33, 38 false, ??

Search Routine - Input Partitions

17

program structure. Knowledge of the

program is used to identify additional test

cases

statements

White Box Testing

Component code outputs

18

White Box Testing

  • independent paths within a module at least once
  • logical decisions on their true and false sides
  • loops at their boundaries and within their operational bounds
  • structures to assure their validity

• Also called Structural testing

• Derivation of test cases according to

• Objective is to exercise all program

Test

Test data

Tests Derives

Exercise all

Exercise all

Exercise all

Exercise all internal data

22

Selective Testing

23

Basis Set

• of execution paths = set of paths

that will execute all statements and all

conditions in a program at least once

• defines the number

of independent paths in the basis set

• Goal : Define test cases for basis set

• Basis path testing

• Condition testing

• Loop testing

• Dataflow testing

loop < = 20x

Basis set

Cyclomatic complexity

• Basis set is not unique

24

Flow Graph Notation

25

Basis Path Testing

measure

+1 (uses flow-graph notation)

execution paths

tests that must be executed to guarantee coverage of all programs

Derive a logical complexity

Cyclomatic complexity CV(G)

  • Number of simple decisions (compound decisions have to be split)
  • Number of enclosed areas

In this case, CV(G) = 4 Use CV(G) to define a basis set of

CV(G) provides an lower bound of

1

2

6

3

7

4

8

5

11

9 10

6 4,

9

8

2,

1

7

10

11

Graph Cyclomatic Number V(G) = e - n + 1 Cyclomatic Complexity CV(G) = V(G) + 1

R 2 R 3 R 1

R 4

Ri

m Node Edge Region

28

Selective Testing

29

Condition Testing

program module

  • Simple condition:
  • Compound condition:

((a=b) and (c>d))

• Basis path testing

• Condition testing

• Loop testing

• Dataflow testing

• Exercises each logical condition in a

• Possible conditions:

  • Boolean variable (T or F)
  • Relational expression (a<b)
  • Composed of several simple conditions

30

Condition Testing Methods

• Branch testing:

exercised at least once

• Domain testing:

a<b:

  • 2 n^ tests required

31

Selective Testing

  • Each branch of each condition needs to be
  • Relational expression
    • 3 tests: a<b, a=b, a>b
  • Boolean expression with n variables

• Basis path testing

• Condition testing

• Loop testing

• Dataflow testing

34

n

n

Testing Simple Loops

loops

  • skip the loop entirely through the loop
  • through the loop
  • m passes through the loop m < n
  • (n-1) , n , and (n+1) passes through the loop

n = passes

35

Testing Nested Loops

loops to minimum values

range or excluded values

nested loops to typical values

Minimum conditions - simple

  • only one pass two passes

maximum number of allowable

• Just extending simple loop testing

  • number of tests grows geometrically

• Reduce the number of tests:

  • start at the innermost loop; set all other
  • conduct simple loop test; add out-of-
  • work outwards while keeping inner
  • continue until all loops have been tested

36

Testing Concatenated Loops

other:

37

Bad Programming!

Testing Unstructured Loops

• Loops are independent of each

  • Use simple-loop approach

• Loops depend on each other:

  • Use nested-loop approach