Interaction Testing. Chapter 15

Similar documents
Interaction Testing! Chapter 15!!

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

Specifications and Modeling

Verification Finite-state process modeling and reachability analysis

Hierarchical FSMs with Multiple CMs

Thirty one Problems in the Semantics of UML 1.3 Dynamics

Chapter 18: Database System Architectures.! Centralized Systems! Client--Server Systems! Parallel Systems! Distributed Systems!

WEEK 5 - APPLICATION OF PETRI NETS. 4.4 Producers-consumers problem with priority

By: Chaitanya Settaluri Devendra Kalia

Petri Nets. Petri Nets. Petri Net Example. Systems are specified as a directed bipartite graph. The two kinds of nodes in the graph:

Concurrent Objects and Linearizability

Concurrency, Mutual Exclusion and Synchronization C H A P T E R 5

IT 540 Operating Systems ECE519 Advanced Operating Systems

Programming at Scale: Concurrency

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL

Stochastic Petri nets

[module 2.2] MODELING CONCURRENT PROGRAM EXECUTION

HARDWARE SOFTWARE CO-DESIGN

Operating Systems Overview. Chapter 2

Concurrency. Lecture 14: Concurrency & exceptions. Why concurrent subprograms? Processes and threads. Design Issues for Concurrency.

Introduction to Software Testing Chapter 3, Sec# 1 & 2 Logic Coverage

Lecture 7: Mutual Exclusion 2/16/12. slides adapted from The Art of Multiprocessor Programming, Herlihy and Shavit

Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt

Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Processor speed. Concurrency Structure and Interpretation of Computer Programs. Multiple processors. Processor speed. Mike Phillips <mpp>

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

CSE 486/586 Distributed Systems

The concept of concurrency is fundamental to all these areas.

MS Windows Concurrency Mechanisms Prepared By SUFIAN MUSSQAA AL-MAJMAIE

Parallel and Distributed Computing (PD)

Concurrent Systems, CSP, and FDR

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Distributed Systems Programming (F21DS1) Formal Verification

Chapter 3. Set Theory. 3.1 What is a Set?

System Models. 2.1 Introduction 2.2 Architectural Models 2.3 Fundamental Models. Nicola Dragoni Embedded Systems Engineering DTU Informatics

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Multiparty Communications CS 118. Computer Network Fundamentals Peter Reiher. Lecture 4 Page 1 CS 118. Winter 2016

Concurrent & Distributed 7Systems Safety & Liveness. Uwe R. Zimmer - The Australian National University

Combinatorial Clause Coverage CoC

Following are a few basic questions that cover the essentials of OS:

CA314 Object Oriented Analysis & Design - 7. File name: CA314_Section_07_Ver01 Author: L Tuohey No. of pages: 16

Multiprocessor scheduling

Process Modelling using Petri Nets

MITOCW watch?v=kz7jjltq9r4

Chapter 5 Asynchronous Concurrent Execution

Modal Logic: Implications for Design of a Language for Distributed Computation p.1/53

CSL373: Lecture 5 Deadlocks (no process runnable) + Scheduling (> 1 process runnable)

The University of Texas at Arlington

CSE332: Data Abstractions Lecture 25: Deadlocks and Additional Concurrency Issues. Tyler Robison Summer 2010

The UPPAAL Model Checker. Julián Proenza Systems, Robotics and Vision Group. UIB. SPAIN

EE 249 Discussion: Synthesis of Embedded Software using Free- Choice Petri Nets

Multi-Core Computing with Transactional Memory. Johannes Schneider and Prof. Roger Wattenhofer

EE249 Discussion Petri Nets: Properties, Analysis and Applications - T. Murata. Chang-Ching Wu 10/9/2007

fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik /11/15

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

Tracing Data Flows to Find Concurrency Errors

Formal Methods in Software Engineering. Lecture 07

On the Definition of Sequential Consistency

COMP Parallel Computing. CC-NUMA (2) Memory Consistency

Characteristics of Mult l ip i ro r ce c ssors r

1. Introduction to Concurrent Programming

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Coordination Principles

PROGRAM MODELING CONCEPTS UNIT IV

MODEL BASED TEST DESIGN AT UNITY

Specific Proposals for the Use of Petri Nets in a Concurrent Programming Course

Section 1.1 Logic LOGIC

Software Engineering using Formal Methods

Algorithmic Verification. Algorithmic Verification. Model checking. Algorithmic verification. The software crisis (and hardware as well)

Multiprocessor and Real- Time Scheduling. Chapter 10

Specifications and Modeling

Fundamental Algorithms for System Modeling, Analysis, and Optimization

Concurrency: Mutual Exclusion and Synchronization. Concurrency

The University of Texas at Arlington

Logic Coverage. Moonzoo Kim School of Computing KAIST. The original slides are taken from Chap. 8 of Intro. to SW Testing 2 nd ed by Ammann and Offutt

NAME: STUDENT ID: MIDTERM 235 POINTS. Closed book, closed notes 70 minutes

Petri Nets ee249 Fall 2000

Testing Systems Specified as Partial Order Input/Output Automata

Reminder from last time

Growth. Individual departments in a university buy LANs for their own machines and eventually want to interconnect with other campus LANs.

Timo Latvala. January 28, 2004

ANALYZING PROCESS MODELS USING GRAPH REDUCTION TECHNIQUES

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version

Petri Nets ~------~ R-ES-O---N-A-N-C-E-I--se-p-te-m--be-r Applications.

Thinking parallel. Decomposition. Thinking parallel. COMP528 Ways of exploiting parallelism, or thinking parallel

Computer Science Curricula 2013

Fair exchange and non-repudiation protocols

Concurrent and Distributed Systems Introduction

Introduction to Computing and Systems Architecture

Concurrency. Glossary

Assignment-2 (TCS/TIT 503)

2. Introduction to Software for Embedded Systems

Linked Lists: The Role of Locking. Erez Petrank Technion

Safety SPL/2010 SPL/20 1

Ravi K. Gedela, Sol M. Shatz and Haiping Xu Concurrent Software Systems Lab The University of Illinois at Chicago Chicago, IL USA

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

An Efficient Method for Multiple Fault Diagnosis

Transcription:

Interaction Testing Chapter 15

Interaction faults and failures Subtle Difficult to detect with testing Usually seen after systems have been delivered In low probability threads Occur after a long time large numbers of thread execution Difficult to reproduce To be able to test interactions need To understand what they are Mathematical description Look at requirements specification Concerned with unexpected interactions IAT 2

Context of interaction It is a relationship InteractsWith among Data Events Threads Actions Ports The relationship reflexive It is binary relation between Data & events Data & threads Events & threads There are too many relationships to be of direct use Indicates that something is missing In this case location Time and place Select location to be an attribute of the other entities instead of being a new entity Short coming of requirements to not include it IAT 3

Meaning of the location attribute Time An instant When something happens Ask before and after type questions An interval Interested in duration Location Have a coordinate system For software use processor residence What does this mean? Location is binary in / out? IAT 4

Events & states Two meanings for event Causes confusion, ambiguity, wordy explanations Use two words Use event for instant Use state, activity for duration Occurs between two events IAT 5

Properties of threads and processors Threads have duration They are activities A processor can be executing only one thread at a time The processor is in a state of executing a thread Timesharing, multiprocessing interleaves thread execution Processor changes state for each thread Here thread durations overlap in time IAT 6

Properties of threads and processors 2 On one processor events can be simultaneous within the minimum resolution of time-grain markers BUT reality (hardware) puts an order on those events puts them in a sequence As far as we can tell it is a random choice At another occurrence the events may be ordered in a different sequence That is a difficulty in testing interaction On different processors, events can occur simultaneously Common events by definition must occur at the same time Consider a two people colliding the collision is a common event to the two people (processors) Synchronous communication for processors start and end with common events IAT 7

Properties of threads and processors 3 For a single processor Input and output events occur during thread execution From the perspective of a thread they cannot occur simultaneously, because they occur at instructions and instructions are executed sequentially From the perspective of devices port events can be simultaneous For each port events occur in time sequence Threads occur only within one processor Do not cross process boundaries Have trans-processor quiescence when threads reach processor boundaries Analogous to crossing unit boundaries in integration testing IAT 8

Properties of threads and processors 4 What we want is sane behaviour This results from considering events to be in a linear sequence For example synchronous communications take into account message transmission time break the communication into events such as Sender starts sending Receiver receives starts receiving Sender ends sending Receiver ends receiving For interaction faults and failures need to go down to this level Implies time-grain markers need to have very fine resolution IAT 9

Taxonomy of interactions Static interactions in a single processor Static interactions in multiprocessor Dynamic interactions in a single processor Dynamic interactions in multiprocessor IAT 10

Square of opposition Given two propositions P and Q They are contraries if both cannot be true Sub-contraries if both cannot be false Contradictories if exactly one is true Q is a subaltern of P if the truth of P guarantees the truth of Q i.e. P Q IAT 11

Why logic? Consider the following data interactions Precondition for a thread is a conjunction of data propositions Contrary or contradictory data values prevent execution Context-sensitive input port events usually involve contradictory or contrary data Case statement clauses, if correct, are contradictories Rules in a decision table, if correct, are contradictories IAT 12

Static interactions in a single processor Analogous to combinatorial circuits Model with decision tables and unmarked event-driven Petri nets Telephone system example Call display and unlisted numbers are contraries Both cannot be satisfied Both could be waived IAT 13

Static interactions in a multiprocessor Location of data is important Telephone example 1 Calling party in location of one processor (area) Receiving party in another processor Checking for contrary data such as caller id and unlisted numbers Can only check when caller and receiver are connected by a thread A contrary relationship exists as a static interaction across multiple processors when they interact IAT 14

Static interactions in a multiprocessor 2 Telephone example 2 static distributed interaction Call forwarding is defined Alice has call forwarding to Bob Bob has call forwarding to Charlene Charlene has call forwarding to Alice The call forwarding data is contrary cannot all be true at the same time Have distributed contraries Call forwarding is a property of a local office A thread sets a forwarding location Have a fault but not a failure until Donald places a call to one of Alice, Bob or Charlene IAT 15

Static interactions summary The same in both single processor and multiprocessor systems More difficult to detect in multiprocessor systems IAT 16

Graph connectedness for dynamic interactions Make use of n-connectedness in graphs IAT 17

Data-data connectedness 0-connected Logically independent 2-connected sub-alternation 3-connected bidirectional contraries, contradictories and sub-contraries IAT 18

Dynamic, single processor interactions Six potential pairs interact Combination pairs of: data, events and threads Each interaction can exhibit 4 different graph connectedness attributes Result is 24 sub-categories for these interactions IAT 19

Dynamic, single processor interactions 2 Examples 1-connected data-data Two or more data items are input the same action 2-connected data-data When a data item is used in a computation 3-connected data-data When data are deeply related, as in repetition and semaphores 1-connected data-event Context-sensitive port input events IAT 20

Dynamic, single processor interactions 3 Do not analyze all possibilities Interaction faults only result in failure when threads establish a connection Thread-thread interaction occurs Through events Through data IAT 21

Petri net external inputs and outputs External inputs Places with in-degree 0 Can be port or data pre-condition place External outputs Places with out-degree 0 Can be port or data post-condition place For an example see Figure 15.5 IAT 22

Thread-thread interaction Each thread can be represented by an EDPN The symbolic names of the places and transitions correspond to those in the EDPN for the system Synonyms in the thread nets need to be resolved when they interact Threads only interact through external input and output events The intersection of the external input and output places for the threads indicates where they interact with each other For an example see Figures 15.6 & 15.7 IAT 23

Thread-thread interaction 2 External events always remain external External data may become internal Output of one thread is input to another Call forwarding IAT 24

Thread-thread connectedness definition T1 and T2 are threads where EI1, EI2, EO1 and EO2 are the external inputs and outputs of the threads 0-connected EI1 EI2 = EO1 EO2 = EO2 EI1 = EO1 EI2 = 1-connected EI EO 2-connected only through data places EO2 EI1 = EO1 EI2 = 3-connected only through data places EO2 EI1 = EO1 EI2 = IAT 25

Directed thread graph A directed thread graph can be constructed Nodes are threads External inputs & outputs are not in the node They remain external to the node. Edges connect threads according to the external input & output places Figure 15.8 is an example made from Figure 15.7 Can see connectedness relationships IAT 26

1-connected threads 1-connected threads from input places are the typical case for Petri-net mutual exclusion A token on the common input is consumed by one of the threads and other cannot proceed 1-connected threads to output places have an ambiguity We do not know which thread produced an output token Can occur from unexpected thread interaction where some threads completed execution earlier IAT 27

2- and 3-connected threads Can only occur with data places Port places cannot be both input an output Note some devices may have both input and output capability but we always split into independent input and output logical devices Problem is often time difference between the setting of data and the occurrence of a failure due to thread interaction Read-only data has infinite duration Rarely causes problems Read/write data has a duration Problem is caused by an earlier write that has been replaced Can be very difficult to diagnose and test IAT 28

Thread interaction Warning Problems occur when we Expect 0-connectedness But have 1-, 2- or 3-connectedness IAT 29

Dynamic, multi-processor interactions Problem here is threads and events occur in parallel We have concurrent behaviour with a collection of communicating sequential processors (CSP) Have non-deterministic behaviour To fully understand need to learn the mathematics of CSP Without that can only work through an example Figures and tables in Section 15.2.4 IAT 30

Dynamic, multi-processor interactions 2 Difficulties arise from Combined finite state machines grow exponentially in size and complexity May be difficult to rationalize initial marking Have mutual exclusion Contraries What is the duration of an output Is it controlled by the Petri net? Or fixed in some way? Time interval between events and model reaction time What happens to data values Output events IAT 31

Informal definition of determinism (1) A system is deterministic if, given its inputs, we can always predict its outputs (2) A system is deterministic if it always produces the same outputs for a given set of inputs For a non-deterministic system it may be difficult to demonstrate different output Process P non-deterministically chooses at every step whether to output an a or a b Process Q non-deterministically chooses once whether to output all a s or all b s traces(q) traces(p) P = (a P) (b P) Q = (a Qa) (b Qb) Qa = (a Qa) Qb = (b Qb) IAT 32

Formal definition of determinism P is deterministic s : traces (P) X refusals (P / s) X (P / s) 1 = {} P 1 = { e x traces (P) } A system is deterministic if at every step the system never refuses to engage in any external event appropriate at that step P 1 definition is the set of events in which P may engage on the first step P / s is the process after P has engaged in all of the events in the trace s A trace is a record of the external events in which a process has engaged A refusal is a set of events in which a process refuses to engage IAT 33

On non-determinism In a Petri net non-determinism arises when two or more transitions are enabled Which transition fires is random The choice can be made by An external event An internal event not stated in the textbook Deadlock occurs when no transition fires Bad but at least detectable Livelock occurs when internal events take over Even if an external event is available the system chooses an internal event Basis of infinite loops in programs IAT 34

On non-determinism 2 A thread is locally non-deterministic if we cannot predict its output with information local to the thread In many cases non-determinism vanishes when sufficient context is provided Changing the lever in windshield wiper cannot determine output By adding in the dial, the output can be determined Implication for testers When testing threads with external inputs especially data it is necessary to test the interaction with all other threads that can be n-connected (n > 0) via external inputs IAT 35

Client / Server testing The complexities Base system has program components Database, application, presentation (logical output) Have a centralized, fat server and fat client distinction Figure 15.13 Entire system includes above items plus Network GUI May have homogeneous or heterogeneous processors Lots of possibilities for finger pointing takes place when things go wrong IAT 36

Client / Server testing 2 Much of the system is stable Should testing be needed Use functional testing no source text IAT 37

Client / Server testing 3 Interesting part is the GUI Consists of multiple windows that need to synchronized Communicating sequential processors (FSMs) All events are port events Have dynamic interactions across multiple processors Use operational profiles Test individual threads Then test thread interaction Big problem if there are multiple clients such as shared bank accounts IAT 38