CH05.L05 . BBT-4-state transition

MaharaTech - ITI MOOCA
16 Apr 201702:46

Summary

TLDRThe video script explains the State Transition technique, essential for testing systems with dynamic states influenced by events. It's applicable in scenarios like screen dialogues, website transitions, and embedded systems. The script illustrates the technique using a car's gear stick as an example, detailing the process of creating a state diagram and table to identify valid and invalid test cases, ensuring comprehensive system testing.

Takeaways

  • πŸ”„ The State Transition technique is used for systems with changing states influenced by events.
  • πŸ“ Common applications include screen dialogues, website transitions, and embedded systems.
  • πŸš— An example provided is the transmission/speed stick in cars, illustrating the technique's application.
  • πŸ“Š Start by drawing a diagram with states in squares and arrows indicating transitions based on events.
  • 🏁 The initial state is labeled as the 'starting state', in the car transmission example, it's 'Neutral'.
  • ⬇️ Moving the stick down from Neutral transitions to 'Reverse', and moving up returns to Neutral.
  • ⬆️ From Neutral, moving the stick up progresses through gears 1st, 2nd, and 3rd.
  • ❌ Direct transition from Neutral to 3rd gear is not possible, as indicated in the diagram.
  • πŸ“‹ Move from the state diagram to a state table, detailing each state's response to actions.
  • πŸ” In the state table, 'Null' is used to indicate no change when an action is applied.
  • πŸ“ From the state table, derive the number of test cases needed, identifying valid and invalid cases.
  • πŸ“š The State Transition technique involves creating a diagram of rectangles for states, with arrows showing transitions on events, leading to a state table for test case generation.

Q & A

  • What is the State Transition technique?

    -The State Transition technique is a method used in testing to identify and cover all possible states and transitions in a system. It is particularly useful when the system has states that change based on events.

  • When should you use the State Transition technique?

    -You should use the State Transition technique when working on a system that has changing states influenced by events. This is common in systems like screen dialogues, website transitions, and embedded systems.

  • What is an example of a system where the State Transition technique can be applied?

    -An example is the transmission/speed stick in cars. The technique helps generate test cases that cover all possible states and transitions of the gear system.

  • How do you start applying the State Transition technique?

    -You start by drawing a diagram with all the states in separate squares and connecting them with arrows that represent the events causing transitions between states.

  • What is the significance of the 'starting state' in the State Transition diagram?

    -The 'starting state' is the initial state from which the system begins its operation. In the example of a car's transmission, the starting state is 'Neutral'.

  • How does the State Transition diagram help in understanding the system's behavior?

    -The diagram shows all possible states and how they transition from one to another based on events. It helps in identifying all paths and ensuring that no direct transitions are missed, such as going from Neutral to 3rd gear.

  • What is the next step after creating the State Transition diagram?

    -The next step is to move from the diagram to a state table, where you list all states and actions, and indicate the effects of each action on the state and the resulting transition.

  • What does 'Null' represent in the state table?

    -'Null' in the state table indicates that an action does not have any effect on the current state, meaning the state will remain unchanged.

  • How many test cases are typically generated from the State Transition technique?

    -The number of test cases generated depends on the complexity of the system, but in the example given, 10 test cases are made, including 2 invalid ones.

  • What are the two invalid test cases mentioned in the script?

    -The two invalid test cases are changing down from Reverse and changing up from 3rd gear, as these transitions are not allowed in the system.

  • How does the State Transition technique help in identifying valid and invalid test cases?

    -By visualizing the state transitions and creating a state table, testers can easily identify which transitions are valid and which are not, thus helping to generate comprehensive test cases.

Outlines

00:00

πŸš— State Transition Technique Overview

This paragraph introduces the State Transition technique, a method used for systems with changing states influenced by events. It is applicable in various contexts such as screen dialogues, website transitions, and embedded systems. The paragraph provides an example of a car's transmission/speed stick to illustrate how the technique can be applied. It emphasizes the importance of creating a state diagram with all possible states and transitions, followed by a state table that details the effects of actions on each state and the resulting state changes. The example clarifies that some transitions are invalid, such as moving directly from Neutral to 3rd gear, and highlights the process of generating test cases to cover all valid states and transitions, excluding the invalid ones.

Mindmap

Keywords

πŸ’‘State Transition

State Transition is a technique used in system testing to model and analyze the behavior of a system as it moves from one state to another in response to events. In the video, it is used to illustrate how to generate test cases for a car's transmission system. The technique involves creating a diagram that shows all possible states and the events that cause transitions between them.

πŸ’‘System States

System States refer to the various conditions or modes in which a system can exist. In the context of the video, the states of a car's transmission stick are explored, such as Neutral, Reverse, 1st gear, 2nd gear, and 3rd gear. Understanding these states is crucial for testing the system to ensure it behaves correctly under different conditions.

πŸ’‘Events

Events are actions or occurrences that can trigger a change in the state of a system. In the video, events like moving the transmission stick up or down are used to transition between different gear states in a car. These events are essential for creating a state transition diagram and subsequent test cases.

πŸ’‘Starting State

The Starting State is the initial condition from which a system begins its operation. In the video, the Neutral state is identified as the starting state for the car's transmission system. This state is significant as it sets the baseline for all subsequent state transitions.

πŸ’‘End State

The End State is the final condition that a system reaches after a series of state transitions. Although not explicitly mentioned in the video, the concept is implied in the context of testing all possible state transitions to ensure the system works correctly from start to finish.

πŸ’‘State Diagram

A State Diagram is a graphical representation used to depict the states of a system and the transitions between them. In the video, a state diagram is drawn to show the states of a car's transmission stick and the events that cause transitions. This diagram is a key tool in visualizing and understanding the system's behavior.

πŸ’‘State Table

A State Table is a tabular representation that lists all possible states and the effects of actions on those states. In the video, a state table is created from the state diagram to detail how each action affects the system's state and which state it transitions to. This table is crucial for generating test cases.

πŸ’‘Test Cases

Test Cases are specific scenarios or conditions under which a system is tested to verify its functionality. In the video, test cases are generated based on the state transitions depicted in the state diagram and table. These test cases are essential for ensuring the system behaves as expected in all possible states.

πŸ’‘Invalid Test Cases

Invalid Test Cases are scenarios that are not possible or do not make sense within the context of the system being tested. In the video, examples of invalid test cases are provided, such as changing down from Reverse or changing up from 3rd gear, which are not feasible in a car's transmission system.

πŸ’‘Screen Dialogues

Screen Dialogues refer to the interactions between a user and a system that occur on a screen, such as a graphical user interface. In the video, screen dialogues are mentioned as one of the areas where the state transition technique can be applied, though the primary example given is a car's transmission system.

πŸ’‘Embedded Systems

Embedded Systems are computer systems designed to perform specific control functions within a larger system, often found in devices like cars or home appliances. In the video, embedded systems are mentioned as another area where the state transition technique is applicable, highlighting its broad utility in various technologies.

Highlights

The State Transition technique is used when a system has states that change according to events affecting those states.

Systems with changing states are common in screen dialogues, website transitions, and embedded systems.

An example is provided to clarify the application of the State Transition technique using the transmission/speed stick in cars.

The technique helps generate test cases covering all states of a system.

The process begins with drawing a diagram and writing all states in separate squares.

Arrows in the diagram represent events that cause transitions between states.

The first state in the system is called the 'starting state', illustrated as 'Neutral' in the example.

Transitions are shown from 'Neutral' to 'Reverse' and back to 'Neutral' based on the movement of the stick.

The event of moving the stick up from 'Neutral' leads to transitions through 1st, 2nd, and 3rd gear states.

It is understood from the diagram that direct transitions from 'Neutral' to 3rd gear are not possible.

The state diagram is then converted into a state table, listing all states and actions.

The state table shows the effect of actions on each state and the resulting state transitions.

If an action has no effect, 'Null' is written in the state table.

From the 2nd gear, transitions are made to 3rd gear when changing up and to 1st gear when changing down.

The state table helps determine the number of test cases needed to cover all system states.

Two test cases are identified as invalid: changing down from reverse and changing up from 3rd.

The State Transition technique involves drawing a diagram with rectangles representing system states.

The starting and end states are indicated, with arrows showing transitions based on events.

From the diagram, a state table is created to determine valid and invalid test cases.

Transcripts

play00:03

The State Transition

play00:05

when will we use this technique?

play00:07

we use it if the system you work on

play00:09

has states that change according to

play00:11

events which affect those states,

play00:13

so you should use the

play00:15

State Transition technique.

play00:17

usually the systems with changing states

play00:19

are often exists in:

play00:21

Screen dialogues,

play00:23

Web site transitions and embedded system.

play00:25

As usual, let's have an example

play00:27

to clarify how to apply

play00:29

this technique. For example:

play00:31

the system of the transmission / speed

play00:33

stick in cars.

play00:35

The State transition technique helps us

play00:37

generate test cases that cover

play00:39

all these states. Firstly, we will start with

play00:41

drawing a diagram and write all

play00:43

the states of the stick in

play00:45

separate squares with arrows

play00:47

that relate them to each other according to

play00:49

the way we understood from the system.

play00:51

It is shown on the arrows that all the events

play00:53

which will happen to the states,

play00:55

and let it moves to the next state.

play00:57

the first state at the beginning of system

play00:59

is called "starting state " and

play01:01

this is the Neutral here. then it

play01:03

transmit to Reverse with the event of

play01:05

moving the stick down.

play01:07

and it will get back to Neutral with

play01:09

the event of moving the stick up.

play01:11

as well, the event of moving the stick up

play01:13

transmits it from the Neutral

play01:15

to the 1st gear state

play01:17

then the 2nd one then the 3rd.

play01:19

From this diagram,

play01:21

We understand that we can't transmit from Neutral

play01:23

to the 3rd gear directly.

play01:25

Secondly, we will move from

play01:27

the state diagram to the state table,

play01:29

in which we write all the states

play01:31

and all actions mentioned in the diagram

play01:33

in a form of table. In front of

play01:35

each state, we write the effect of the action on it

play01:37

and to which state it will be transmitted.

play01:39

If it doesn't have any effect, so we

play01:41

write "Null". For example, from Reverse

play01:43

it will change up to Neutral.

play01:45

But if it changed down

play01:47

there will not be any change so it

play01:49

will be "Null". At the 2nd gear,

play01:51

if w changed up it will move to 3rd gear

play01:53

and if we changed down it will move to

play01:55

the 1st gear. From this table,

play01:57

we know that we will make 10 test cases

play01:59

to cover all the system states.

play02:01

2 test cases of them are invalid

play02:03

which are: change down from reverse

play02:05

and change up from 3rd

play02:07

Finally, we can

play02:09

summarize the idea of applying the State

play02:11

transition technique which starts with drawing

play02:13

a diagram consists of rectangles, in which

play02:15

all the system states are written.

play02:17

The first state from which the system starts

play02:19

is the Starting State.

play02:21

and the state to which it transmits is the End State.

play02:23

also an arrow between them

play02:25

on which the events are written

play02:27

and it means that system will transmit from

play02:29

state A to state B when this

play02:31

event happens.

play02:33

from the data of this diagram,

play02:35

we will write the state table.

play02:37

From the table we can know the number of test cases

play02:39

and which one of them will be valid or invalid.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
State TransitionSystem TestingEvent HandlingDiagram CreationState TableTest Case GenerationAutomotive SystemsGear TransmissionSoftware TestingQuality Assurance