software testing methodologies (stm)

31
Narasimha Rao.P Narasimha Rao.P ompiled with reference from: mpiled with reference from: Software Testing Techniques: Boris Beizer Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain Marrick Craft of Software Testing: Brain Marrick Unit 3 – Transaction Flow Unit 3 – Transaction Flow

Upload: rumer

Post on 06-Jan-2016

102 views

Category:

Documents


8 download

DESCRIPTION

Software Testing Methodologies (STM). Unit 3 – Transaction Flow. Compiled with reference from: Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain Marrick. Narasimha Rao.P. U2. Transaction-Flow Testing. We will see in this part of Unit 2: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Software Testing Methodologies     (STM)

Narasimha Rao.PNarasimha Rao.P

Compiled with reference from:Compiled with reference from: Software Testing Techniques: Boris BeizerSoftware Testing Techniques: Boris Beizer Craft of Software Testing: Brain MarrickCraft of Software Testing: Brain Marrick

Unit 3 – Transaction FlowUnit 3 – Transaction Flow

Page 2: Software Testing Methodologies     (STM)

ref boris beizer 2

Transaction-Flow TestingWe will see in this part of Unit 2:

• Concepts of Transaction flows

• Transaction-flow testing

U2

Page 3: Software Testing Methodologies     (STM)

ref boris beizer 3

Transaction-Flow TestingContentsContents

1. Definitions of Transaction, Transaction flow, Transaction flow graph2. It’s representation, implementation architecture in an O.S. & implementation in a system3. A perspective of TFG model. View wrt DFG, CFG

4. Handling cases – decisions, biosis, mitosis, transactional junction, absorption & conjugation5. TFG is not structured - Reasons

Transaction Flow Testing Techniques

1. Building transaction flows2. Inspections, Reviews, and walkthroughs3. Path selection4. Path sensitization5. Instrumentation6. Test data bases

7. Test Execution

8. Transaction-flow implementation & testing related comments1. Translation based systems2. Hidden languages

U2

Page 4: Software Testing Methodologies     (STM)

ref boris beizer 4

Definitions of Transaction,Transaction-flow, TFG

Transaction-flow

Transaction-flow represents a system’s processing. Functional testing methods are applied for testing T-F.

Transaction-flow Graph

TFG represents a behavioral (functional) model of the program (system) used for functional testing by an independent system tester.

Transaction

• is a unit of work seen from system’s user point of view.

• consists of a sequence of operations performed by a system, persons or external devices.

• is created (birth) due to an external act & up on its completion (closure), it remains in the form of historical records.

U2

Page 5: Software Testing Methodologies     (STM)

ref boris beizer 5

A Simple Transaction

Example: the sequence of steps in a transaction in an online information retrieval system

1. accept inputs 7. Accept Inputs

2. Validate inputs (Birth of tr.) 8. Validate inputs

3. Transmit ack. to the user 9. Process the request

4. Process input 10. Update file

5. Search file 11. Transmit output

6. Request direction from user 12. Record transaction in log & cleanup (Closure)

Users View of a transaction : Single step

Systems view : Sequence of many operations

U2-B

Page 6: Software Testing Methodologies     (STM)

ref boris beizer 6

Example of a Transaction flow (diagram)

User (terminal) Terminal controller CPU

U2

User User BeginBegin

Request order

from CPU

Request Type

cancel

order

help

AcceptOrder from

CPU

ProcessForm

B

BTransmitPage to terminal

CAcceptInputField

MoreFields?

Y

TransmitTo CPU

D

User wantsReview?D

CPU-AcceptConfirm

Valid ?Y

MorePages ?

NDoneDone

TransmitDiagnosticto Terminal

C

N

Set upReview

Page 7: Software Testing Methodologies     (STM)

ref boris beizer 7

Definitions

Transaction-flow Graph : a scenario between users & computer

Transaction-flow : an internal sequence of events in processing a transaction

Uses of Transaction-flow

Specifying requirements of big, online and complicated systems.

Airline reservation systems, air-traffic control systems.

Loops are less as compared to CFG. Loops are used for user input error processing

U2

Page 8: Software Testing Methodologies     (STM)

ref boris beizer 8

Implementation of Transaction-Flow (in a system) U2

• Implicit in the design of system’s control structure & associated database.

• No direct one-to-one correspondence between the “processes” and “decisions” of transaction-flow, and the corresponding program component.

• A transaction-flow is a path taken by the transaction through a succession of processing modules.

• A transaction is represented by a token.

• A transaction-flow graph is a pictorial representation of what happens to the tokens.

Input S A S B S C S S

D

ES : Scheduler A, B, C, D, E : Processes

Output

Page 9: Software Testing Methodologies     (STM)

ref boris beizer 9

Implementation of Transaction-Flow U2

System Control Structure (architecture of the implementation) :

FrontEnd

InputQueue EXECUTIVE

SCHEDULER - AND / OR OPERATING SYSTEMDISPATCHER

OutputModule

OutputQueue

ProcessQueues A Processor B Processor C Processor D Processor E Processor

Application Processes

Do All B’s

Do All D’s

DiscReads

DiscReads

Do All C’s

Do All A’s

TapeWrites

TapeReads

Do All B’s

Do All E’s

DiscWrites

DiscWrites

2

1

1

2

Executive / Dispatcher Flowchart (a sample sequence)

Page 10: Software Testing Methodologies     (STM)

ref boris beizer 10

Implementation of Transaction-Flow U2

System control structureSystem control structure

System is controlled by a scheduler …

A Transaction is created by filling in a Transaction Control Block (TCB) by user inputs and by placing that token on input Q of Scheduler.

Scheduler examines and places it on appropriate process Q such as A. When A finishes with the Token, it places the TCB back on the scheduler Q.

Scheduler routes it to the next process after examining the token :

1. It contains tables or code to route a token to the next process.

2. It may contain routing information only in tables.

3. Scheduler contains no code / data. Processing modules contain code for routing.

Page 11: Software Testing Methodologies     (STM)

ref boris beizer 11

Implementation of Transaction-Flow U2

Transaction Processing SystemTransaction Processing System (simplified):

• There are many Tr. & Tr-flows in the system.

• Scheduler invokes processes A to E as well as disk & tape read & writes.

• The order of execution depends on priority & other reasons.

Cyclic structure like in this example is common in process control & communication systems.

The criteria for implementation mechanism depends on performance and resource optimization.

Page 12: Software Testing Methodologies     (STM)

ref boris beizer 12

A perspective of Transaction-Flow U2

Transaction-flow testing is a block box technique. (as we assumed nothing regarding computer, communications, environment, O.S., transaction identity or structure or state.)

1. TFG is a kind of DFG.

• TFG has tokens, & DFG has data objects with history of operations applied on them.

• Many techniques of CFG apply to TFG & DFG

2. Decision nodes of TFG have exception exits to the central recovery process.

3. So, we ignore the effect of interrupts in a Transaction-flow.

Page 13: Software Testing Methodologies     (STM)

ref boris beizer13

Transaction Flows – splitting & merging decisionsU2-B

Splits of transactions (Births)

1. A decision point in TFG

Alternative 1

Alternative 2

Daughter Tr.

ParentParent

Daughter Tr.

Daughter Tr.Parent

2.Biosis

3.Mitosis

Page 14: Software Testing Methodologies     (STM)

ref boris beizer14

Transaction Flows – splitting & merging decisionsU2

Mergers of transactionsMergers of transactions

1.1. Junction Junction

DaughterParent

Parent

3. Conjugation

Path 2

Path 1

Continue

Daughter Tr.

Predator

Predator

2. Absorption

Page 15: Software Testing Methodologies     (STM)

ref boris beizer15

TFG – splitting, merging Transactions U2

NOTES:NOTES:

• Multiple meanings now for decision and junction symbols in a TFG.

• Simple TFG model is not enough to represent multi-processor systems & associated coordination systems.

• Petrinet model uses operations for all the above. But Petrinets are applied to H/W, N/W protocol testing – but not Software.

Page 16: Software Testing Methodologies     (STM)

ref boris beizer16

Simplified TFG model U2

Simplify TFG modelSimplify TFG model

• Add New Tr-Flows for Add New Tr-Flows for Biosis, Mitosis, Absorption, ConjugationBiosis, Mitosis, Absorption, Conjugation

• Problems for programmer, designer & test designer.

• Need to design specific tests – possibility of bugs.

Page 17: Software Testing Methodologies     (STM)

ref boris beizer17

Transaction-flow Structure U2-B

Reasons for UnstructurednessReasons for Unstructuredness

1.1. Processes involve Human UsersProcesses involve Human Users

1.1. Part of Flow from External SystemsPart of Flow from External Systems

1.1. Errors, Failures, Malfunctions & Recovery ActionsErrors, Failures, Malfunctions & Recovery Actions

1.1. Transaction Count, Complexity. Customer & EnvironmentTransaction Count, Complexity. Customer & Environment

Page 18: Software Testing Methodologies     (STM)

ref boris beizer18

Transaction-flow Structure U2-B

Reasons for Unstructuredness …Reasons for Unstructuredness …

5.5. New Transactions, & ModificationsNew Transactions, & Modifications

6.6. Approximation to RealityApproximation to Reality

• Attempt to StructureAttempt to Structure

Page 19: Software Testing Methodologies     (STM)

ref boris beizer19

Transaction - Flow Testing - Steps U2-B

First, Build / Obtain Transaction FlowsFirst, Build / Obtain Transaction Flows

• Represent ExplicitlyRepresent Explicitly

• Design details the Main Tr-FlowsDesign details the Main Tr-Flows

• Create From PDLCreate From PDL

• HIPO charts & Petrinet RepresentationsHIPO charts & Petrinet Representations

Objective – Trace the transactionObjective – Trace the transaction

Page 20: Software Testing Methodologies     (STM)

ref boris beizer20

Transaction - Flow Testing - Steps U2-B

1.1. Inspections, Reviews & WalkthroughsInspections, Reviews & Walkthroughs

Start From Preliminary DesignStart From Preliminary Design

1.1. Conducting WalkthroughsConducting Walkthroughs

• Discuss enough Transaction Types (Discuss enough Transaction Types (98% Transactions))

• User needs & Functional terms User needs & Functional terms (Design independent)

• Traceability to RequirementsTraceability to Requirements

Page 21: Software Testing Methodologies     (STM)

ref boris beizer21

Transaction - Flow Testing - Steps U2-B

1.1. Inspections, Reviews & Walkthroughs …Inspections, Reviews & Walkthroughs …

2.2. Design Tests for C1 + C2 coverageDesign Tests for C1 + C2 coverage

3.3. Additional Coverage (> C1+C2)Additional Coverage (> C1+C2)

• Paths with loops, extreme values, domain boundaries• Weird cases, long & potentially troublesome Tr.

4.4. Design Test cases for Tr. Splits & mergersDesign Test cases for Tr. Splits & mergers

5.5. Publish Selected Test Paths earlyPublish Selected Test Paths early

6.6. Buyer’s Acceptance – functional & acceptance testsBuyer’s Acceptance – functional & acceptance tests

Page 22: Software Testing Methodologies     (STM)

ref boris beizer22

Transaction - Flow Testing Techniques U2-B

2.2. Path SelectionPath Selection

1.1. Covering Set (C1+C2) of Functionally Sensible Tr.Covering Set (C1+C2) of Functionally Sensible Tr.

2.2. Add Difficult PathsAdd Difficult Paths

• Review with designers & implementers

• Exposure of interface problems & duplicated processing

• Very few Implementation bugs may remain

Transaction-flow Path Covering Set belongs inSystem Feature Tests

Page 23: Software Testing Methodologies     (STM)

ref boris beizer23

Transaction - Flow Testing Techniques U2-B

3.3. SensitizationSensitization

1. Functionally Sensible Paths – Simple

2. Error, Exception, External Protocol Interface Paths - Difficult

Testing Tr.–Flows with External Interfaces

• Use patches & break points, mistune, and break the rules,

Page 24: Software Testing Methodologies     (STM)

ref boris beizer24

Transaction - Flow Testing Techniques U2-B

4.4. InstrumentationInstrumentation

1. Link Counters are not Useful.

2. Need

• Trace

• Queues on which Tokens resided

• Entries to & Exits from Dispatcher

• A Running Log

Make Instrumentation as part of System Design

Page 25: Software Testing Methodologies     (STM)

ref boris beizer25

Transaction - Flow Testing Techniques U2-B

5.5. Test Data basesTest Data bases

1. Design & Maintenance of a Test Data base - Effort

2. Mistakes

• Unawareness about design of a centrally administered test DB

• Test DB design by Testers

• Using one DB for all tests (need 4 to 5)

Need experienced System & Test Designers

Page 26: Software Testing Methodologies     (STM)

ref boris beizer26

Transaction - Flow Testing Techniques U2-B

6.6. Test ExecutionTest Execution

1. Use Test Execution Automation

2. Have to do a large # of Tests for C1+C2 coverage

Page 27: Software Testing Methodologies     (STM)

ref boris beizer27

Transaction - Flow Testing - Implementation U2-B

1.1. Transaction based systemsTransaction based systems• TCBTCB

1.1. Centralized, Common Processing QueuesCentralized, Common Processing Queues• Just O(n) Queues for Links of O(nJust O(n) Queues for Links of O(n22))

2.2. Transaction DispatcherTransaction Dispatcher• Uses tables & Finite State MachinesUses tables & Finite State Machines

3.3. Recovery & Other LogsRecovery & Other Logs• Key events in Tr – Flow Key events in Tr – Flow

4.4. Self-Test SupportSelf-Test Support• Privileged modes in Transaction control tablesPrivileged modes in Transaction control tables

Page 28: Software Testing Methodologies     (STM)

ref boris beizer28

Transaction - Flow Testing - Caution U2-B

Hidden Languages (flow control language)Hidden Languages (flow control language)

• Transaction Flows based on control codes in TCB or DBTransaction Flows based on control codes in TCB or DB

• Undeclared. Syntax & Semantics are not debugged.Undeclared. Syntax & Semantics are not debugged.

• Possibility of bugsPossibility of bugs

Page 29: Software Testing Methodologies     (STM)

ref boris beizer 29

Software Testing Methodology

To Unit 3 : Data flow testing …

U2

Page 30: Software Testing Methodologies     (STM)

ref boris beizer30

Data - Flow Testing - Basics U2

• Data Flow Testing (DFT) uses control flow graph (CFG) to explore Data Flow Testing (DFT) uses control flow graph (CFG) to explore dataflow anomalies.dataflow anomalies.

• DFT is a family of test strategies based on selecting paths through DFT is a family of test strategies based on selecting paths through the program’s control flow in order to explore the sequence of events the program’s control flow in order to explore the sequence of events related to the status of data objects.related to the status of data objects.

• For example:For example:• Pick enough paths to assure that every data item has been Pick enough paths to assure that every data item has been

initialized prior to its use, or that all objects have been used for initialized prior to its use, or that all objects have been used for something.something.

Page 31: Software Testing Methodologies     (STM)

ref boris beizer31

Data - Flow Testing - Basics U2

MotivationMotivation

• To feel confident about the programTo feel confident about the program

• Data dominated designData dominated design. . Code migrates to data..

• ½ of source code for Data Declarations½ of source code for Data Declarations

• Data flow Machines vs Von Neumann’sData flow Machines vs Von Neumann’s

• Abstract M I M D Abstract M I M D • Language & compiler take care of parallel computationsLanguage & compiler take care of parallel computations

• DFG is a spec. for relations among the data objects. Explore all DFG is a spec. for relations among the data objects. Explore all relations under some test.relations under some test.