Model-based Testing.

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

1 CS 388: Natural Language Processing: N-Gram Language Models Raymond J. Mooney University of Texas at Austin.
UML Statechart semantics Speaker: Fei Mo Tutor: Priv.-Doz. Dr. Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen SS 07.
Language and Automata Theory
ST3236: Stochastic Process Tutorial 3 TA: Mar Choong Hock Exercises: 4.
. Markov Chains. 2 Dependencies along the genome In previous classes we assumed every letter in a sequence is sampled randomly from some distribution.
Chapter 5 Pushdown Automata
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Timed Automata.
Introduction to Uppaal ITV Multiprogramming & Real-Time Systems Anders P. Ravn Aalborg University May 2009.
Compatibility between shared variable valuations in timed automaton network model- checking Zhao Jianhua, Zhou Xiuyi, Li Xuandong, Zheng Guoliang Presented.
Flows and Networks Plan for today (lecture 2): Questions? Continuous time Markov chain Birth-death process Example: pure birth process Example: pure death.
Discrete Time Markov Chains
1 DNA Analysis Amir Golnabi ENGS 112 Spring 2008.
Markov Chains Lecture #5
1 Software Testing and Quality Assurance Lecture 36 – Software Quality Assurance.
048866: Packet Switch Architectures Dr. Isaac Keslassy Electrical Engineering, Technion Review.
An Introduction to Input/Output Automata Qihua Wang.
1 Software Testing and Quality Assurance Lecture 37 – Software Quality Assurance.
Lecture 6 & 7 System Models.
Department of CIS University of Pennsylvania 1/31/2001 Specification-based Protocol Testing Hyoung Seok Hong Oleg Sokolsky CSE 642.
1 Hidden Markov Model Instructor : Saeed Shiry  CHAPTER 13 ETHEM ALPAYDIN © The MIT Press, 2004.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
Causal-State Splitting Reconstruction Ziba Rostamian CS 590 – Winter 2008.
Normal forms for Context-Free Grammars
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
System Models Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn Lecture 6 & 7.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Zvi Kohavi and Niraj K. Jha 1 Memory, Definiteness, and Information Losslessness of Finite Automata.
Some Probability Theory and Computational models A short overview.
Pushdown Automata (PDAs)
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
Dina Workshop Analysing Properties of Hybrid Systems Rafael Wisniewski Aalborg University.
Optimization of a Finite State Space for Information Retrieval Qiang Huang School of Computing, Robert Gordon University.
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
Timed Test Cases Generation Based on MSC-2000 Test Purposes Abdeslam En-Nouaary and Gang Liu Department of Electrical and Computer Engineering Concordia.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
Generalized stochastic Petri nets (GSPN)
Synchronous Protocol Automata. Formal definitions Definition 1 A synchronous protocol automaton P is defined as a tuple (Q,S,D,V,A,->,clk,q0,qf) Channels.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
DeepDive Model Dongfang Xu Ph.D student, School of Information, University of Arizona Dec 13, 2015.
Lecture #2 How to describe a hybrid system? Formal models for hybrid system João P. Hespanha University of California at Santa Barbara Hybrid Control and.
CAP 4800/CAP 5805: Computer Simulation Concepts
John Lafferty Andrew McCallum Fernando Pereira
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Techniques for List Creation (2) Data formatting and control level processing Basics for Interactive Lists Detail lists The Program Interface Interactive.
The Dynamic Analysis Model StateCharts Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Simulation Examples And General Principles Part 2
Discrete-Event System Simulation in Java. Discrete Event Systems New dynamic systems New dynamic systems Computer and communication networks Computer.
7/7/20161 Formal Methods in software development a.a.2015/2016 Prof.Anna Labella.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Availability Availability - A(t)
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Language and Automata Theory
Jaya Krishna, M.Tech, Assistant Professor
CSE322 Finite Automata Lecture #2.
Principles of Computing – UFCFA3-30-1
UML Diagrams: StateCharts The Dynamic Analysis Model
Presentation transcript:

Model-based Testing

Model-based Testing Finite state machines Statecharts Grammars Markov chains Stochastic Automata Networks

Model-based Testing

Finite State Machine Finite state machines have the state changed according to the input. They are different from event flow graphs.

Finite State Machine Test case: {<turn on>, <decrease intensity>, <increase intensity>, <turn off>} off dim normal bright <turn on> <turn off> <incr. int.> <decr. Int.> <decr. int.>

Statecharts Statecharts specify state machines in a hierarchy. states: AND, OR, basic states AND: {B1, B2} OR: {b11, b12} basic state: {A}

Statecharts configuration: set of states in which a system can be simultaneously. C1={CVM, OFF} C2={CVM, ON, COFFEE, IDLE, MONEY, EMPTY} C3={CVM, ON, COFFEE, BUSY, MONEY, EMPTY}

Statecharts transition: tuple (s, l, s’) s: source, s’: target, l: label defined as e[g]/a e: trigger g: guard a: action t3: coffee[m>0]/dec

Statecharts Normal form specification: C1: {CVM, OFF} C2: {CVM, ON, COFFEE, IDLE, MONEY, EMPTY} C3: {CVM, ON, COFFEE, BUSY, MONEY, EMPTY} C4: {CVM, ON, COFFEE, IDLE, MONEY, NOTEMPTY} C5: {CVM, ON, COFFEE, BUSY, MONEY, NOTEMPTY}

Grammars Context-free grammars to generate test cases. Example of TC: 1 + 2 * 3 Problem: The test cases may be infinitely long. Weights must be inserted in the rules.

Markov Chains Markov chains are structurally similar to finite state machine, but can be seen as probabilistic automata. arcs: labeled with elements from the input domain. transition probabilities: uniform if no usage information is available.

Markov Chains input domain: {Enter, up-arrow, down-arrow} variables: cursor location = {“Sel”, “Ent”, “Anl”, “Prt”, “Ext”} project selected = {“yes”, “no”} states: {(CL = “Sel”, PD = “No”), (CL = “Sel”, PD = “Yes”), ...}

Markov Chains test case: invoke Enter select down-arrow analyze

Markov Chains

Markov Chains Analysis of the chain: Example 1: Expected length and standard deviation of the input sequences. length: 20.1 standard deviation: 15.8

Markov Chains Example 2: Estimate the coverage of the chain states and arcs. 81.25% of states appear in the test after 7 input sequences.

Markov Chains Problems with Markov Chains: Transition matrix may become very large. The growth of the number of states and transitions impacts in the readability. Maintainability – it is hard to find all transitions that should be included to keep the model consistent when a new state is added.

Stochastic Automata Networks SAN represents the system by a collection of subsystems. subsystems: individual behavior (local transitions) and interdependencies (synchronizing events and functional rates). SAN may reduce the state space explosion by its modular way of modeling.

Stochastic Automata Networks Definition of SAN: tuple (G, E, R, P, I) G = {G1, ..., Gm} global states, composed by A1 x A2 x ... x An (Ai is an automaton). E = {E1, ..., Ek} set of events. R = {R1, ..., Rk} set of event rate functions (rate of occurrence of the event). P = {P1, ..., Pk} transition probability functions, one for each pair (event, global state). I: set on initial states.

Stochastic Automata Networks Example: Automata: {Navigation, Status} Navigation = {Start, Password, Menu} Status = {Waiting, POK, PNotOK} Events E = {ST, QT, S, g, f} ST = {(Start, Wait) → (Pass, Wait)} S = {(Pass, Wait) → (Menu, POK)}

Stochastic Automata Networks QT = {(Pass, Wait) → (Start, Wait), (Menu, Wait) → (Start, Wait), (Menu, POK) → (Start, Wait)} g = {(pass, wait) → (pass, PNotOk)} f = {(pass, PNotOk) → (pass, wait)} Initial State I={(Start, Waiting)}

Markov Chain vs SAN Test case samples generated using Markov chain and stochastic automat networks. Experiments: Generation time analysis Quality of test suite

Markov Chain vs SAN Simple counter navigation MC: 9 states and 24 transitions SAN: 3 automata (2 x 5 x 6) total of 60 states, 9 global reachable states.

Markov Chain vs SAN Calendar Manager MC: 16 states and 67 transitions SAN: 5 automata (2 x 3 x 4 x 2 x 7) total of 336 states, 16 global reachable states.

Markov Chain vs SAN Form-based Documents Editor MC: 417 states and 2593 transitions SAN: 3 automata (2 x 2 x 2 x 3 x 3 x 10) total of 417 states, 720 global reachable states.

Markov Chain vs SAN Generation time (simple counter navigation)

Markov Chain vs SAN Generation time (calendar manager)

Markov Chain vs SAN Generation time (docs editor)

Markov Chain vs SAN Quality of test suite

Markov Chain vs SAN Quality of test suite

Markov Chain vs SAN Quality of test suite

Markov Chain vs SAN Quality of test suite

Markov-based GUI Testing Event flow graph Have an usage model Retrieve sequences of events Given a start and final state, one could use the properties of markov chains to generate tests.