大佬講MBT

大佬講MBT

網址:https://www.youtube.com/watch?v=TnuiEGS6iyc

獲取模型:

1.手工創建(Manual creation)

2.基於事件接口(Event based inference)

  • Apply regular language learning algorithms to traces
  • Minimize over/under approximation through multi objective optimization

2012 ICST-Finding the Optimal Balance between Over and Under Approximation of Models Inferred from Execution Logs.

Grammer learning:Algorithms to learn a regular language from its sentences(e.g.,k-tail)

兩個問題:Over-approximation:behaviors that are admitted by the model,but are impossible in reality最小化模型尺寸

Under-approximation:behaviours that are possible,but are not admitted by the model 多目標優化算法

Metrics:SIZE,UNOBS,UNREC

unobserved even sequences and a small number of unrecognized traces

take all the traces that are available and to put them in parallel as an only mystic choice among them if you do that

多目標優化

select non dominated models->update paretofront->Model union/intersection

Add trace/merge states

we cycle and after a number of iterations we get minimized

Model union & intersection

Non-deterministic union/union+powerset construction/intersection

可以將模型轉換爲非確定有限自動機轉換爲確定

3.基於狀態接口(Stated based inference)FSM

  • Manually define the abstraction function
  • Infer the abstraction function through clustering and multi-objective optimization

Automated Generation of stated abstraction functions using data invariant inference.AST-2013

ReAjax:a review engineering tool for Ajax Web applications.2012.

State clustering -> Invariant inference

Automated generation based on clustering & data invariant inference

Partitioning problem

Given a set of concrete states,find a partition such that the invariants obtained from each subset in the partition produce an optimal model when used as abstraction functions

減少模型尺寸,減少非確定性轉換

select non dominated partitions->update pareto front->apply genetic operators

Evolving the model

1.Manual evolution

2.Inference from scratch,using the new traces

3.Automated,incremental model update

a new state and new transitions are added to the model

Revolution : Atumatic Evolution of Mined Specifications.2012

Using the model

1.test sequence generation

  • Random,depth-first,breadth first
  • Semantic interactions
  • Maximum diversity

BFS/DFS First Algorithm

the notion of semantic interactions

<text,submit >

<submit,text>

<subject,submit>

<submit,subject>

the coverage of pairs of events interact semantically

test suite diversity

Frequency based diversity is maximized

Distance metrics:minimum Euclideon distance between event execution frequencies of test cases or sum of distances from the average frequency

DIV多樣性矩陣

2.test data generation

TC generator -> FSM monitor -> SUT

Transition coverage onModel is satisfied iff branch coverage on FSM Monitor is satisfied

Test generator: Any test case generator supporting branch coverage(Evosuite)

combinatorial input data generation

1554798793706

Each pairwise combination is covered by at least one test sequence

infeasible test sequences

Finite State Models express an abstraction of the semantics

  • Not all dependencies and constraints are represented
  • Test cases may violate missing dependencies and constraints

3.test case feasibility

infeasibility can cause a lot of trouble in the actual execution of tests against the application it can reduce coverage and for detection substantially and at end it invovle substantial manual effort so

Predicting feasible test sequences

In NLP,N-grams are used for word prediction

In MBT,N-grams can be used to predict the next feasible event in a test sequence.

Test case derivation:2-Grams

Interpolated N-Grams for Model Based TestingICSE

Defining the oracle

1.Manual definition

Add assertions to express:

  • Contracts(pre/post conditions,invariants)
  • Expected test case results

2.Model as oracle

TC=<add,add,empty>

  • Expected SUT state should match actual SUT state

3.Crash oracle

4.Automated oracles

anomaly detectors

圖的遍歷產生測試序列

N-gram based test sequence generation from finite state models.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章