Model Based Testing and Runtime Verification Flashcards

1
Q

The behaviors allowed by the implementations

A

The behaviors allowed by the implementations are a subset of those allowed by the specification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The Testing Perspective

A

Test -> Implementation -> Oracle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The Runtime Verification Perspective

A

User -> Implementation -> Monitor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Monitors

A

require generalization, making things harder. Hence we need a specification language (other than the programming language itself).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A Specification Language - Finite State Automata

A

Make a list of the inputs
For each input, note the situations in which the input can be applied and when it can’t
For each situation, note further situations when the input causes different behaviors
What variables do we need to model all possible situations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Runtime Verification

A

Basically monitoring the system under test through an RV tool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

RV architecture

A

Monitoring guarantees that the system never advances beyond failure.

Upon failure one can attempt to fix the problem since we are guaranteed to stop immediately after the failure.

The cost in overheads can be prohibitive if the volume of monitored events is large.

The system can break real-time properties because of monitor-caused delays.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Building the Architecture

A

Separate specification from system requirements, this requires additional work to weave the two together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Separation of Concerns: Aspect-Oriented Programming

A

Modular abstraction techniques (OO design aims at abstracting models, sharing common parts across the implementation).

Sometimes, one modularization strategy forgoes another, requiring code replication and the merging of business logic and support code.

Aspect-Oriented programming gives ways of changing code across a whole system in a modular way.

Consider adding a logging feature for all types of money transfers, which can be toggled on or off; by adding a line to each transfer method or by using an AOP tool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Property Specification Languages: Automata

A

Finite State Automata can be a good way of allowing the specification of consequentiality behavior. Access to system data enhances expressiveness and interaction with the system.
Parameterization allows us to have a separate monitor per use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Determinism

A

Monitoring automata should be deterministic. Transitions and automata are ordered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

RV Tool

A

Larva - used in JAVA using Symbolic Timed Automata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Property Specifications

A

DATEs (Dynamic Automata with Timers and events): Automata based. Dynamic creation of new properties (automata). Replication of properties per object instance. Triggering of transitions based on program method invocations, program exceptions, real time events, and channel communication between automata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Model Based Testing

A

Testing is mainly done manually which is tedious and error prone, automation is better.
Bugs occur at the model and implementation. We can check correspondence to find bugs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Generic Model Based Testing

A

Test suite generation: Use the model to generate meaningful inputs/sequences of inputs (Decide the strategy of traversing the model).
Prioritizing Test Cases: Random, Greedy Algorithm, Lookahead.
Executing Tests: Usually automated but might need some scaffolding/adapter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Test Suite Execution

A

Offline: Generate once, execute many times (ex. Regression Testing)
Online: Generate on-the-fly, Ideal for time-bound testing (ex. Test for a whole night). Testing systems whose environment cannot be easily simulated (such as 3rd party systems).

17
Q

Oracle Problem

A

Models necessitate automation of oracle since model based testing is usually very fast and comprehensive (in terms of system functionality). Ex. Assertions can be added to FSMs to check the system still corresponds with the model.

18
Q

Measuring Test Effectiveness

A

Structural Code Coverage - Aims to exercise code or model concerning some coverage goal.
Coverage Measures:
States visited
Transitions visited
Transition pair combinations

19
Q

Test Failures

A

Fix the models because it isn’t correct
Fix the system because it isn’t correct

20
Q

JUNIT Model

A

Define a model
Normally using an FSM with variables, conditions and actions
Build graph of possible transitions
Generates abstract teszta.
- Add operation on SUT
- Update any tracked variables
- Add JUNIT assertions on SUT after applying actions

21
Q

Guards

A

You can add a guard to indicate when it is possible to choose a particular action. Add a method that returns a Boolean. It should have the same name as the action method name and end with the word Guard.

22
Q

Generating Test Cases

A
  • Random
  • Greedy Tester: Decides at the current state which transitions are yet to be visited
  • Lookahead tester: Looks ahead to find unvisited transitions