Learn How Decision Tables Can Help To Set Out Traffic Regulation

Yuliia Kuprii
3 min readSep 13, 2021

--

Photo by K. Mitch Hodge on Unsplash

Let me show you how I managed to apply the decision table for traffic regulation. Keep reading to see a fresh and fun example of the decision table usage.

A decision table is one of the techniques represented in black-box testing. Great for uncovering business logic on a very high end.

Initial decision table

Conditions

I took three conditions and built a table with boolean values TRUE/FALSE (T and F).

The formula is simple.

Values_number^Conditions_number: 2³ = 8 rules.

Values: [true], [false].

Conditions: [Traffic lights on?], [Priority signs installed?], [Traffic officer present?]

I want to mention, this decision table is built upon Ukrainian traffic rules and serves to demonstrate how the test design technique works.

Actions

Once we set our conditions and rules, it’s time to define our actions (aka expected results).

In our case, we need to check who or what will regulate transport on the roads.

According to Ukrainian traffic rules, there are certain conditions that define the city traffic control.

Let’s take a look at the first test. All three conditions are set to TRUE.

The expected result (what comes out from this set of rules) is to ignore the traffic lights and priority signs. A traffic officer is a person who regulates traffic on the streets.

Now let’s consider the second test. The first two conditions are set to TRUE and the last one to FALSE.

The expected result for this particular case is to ignore priority signs since they don’t have any power over traffic lights.

The third test has the same expected result as the first test. Hence, we can collapse them into one test as we don’t care (DC) about the presence of priority signs. The traffic officer is the one who will regulate city transport.

We can collapse tests 5 and 7 the same way. As traffic officers come over priority signs.

1&3 and 5&7 tests collapsed

What’s left? Tests 2 and 4 are collapsed as the first condition was satisfied and other conditions don’t have any impact on the result.

2&4 tests collapsed into one test

Of course, we could go further to combine tests 1 and 5. But let’s leave traffic light conditions untouchable. If we would need to check the traffic lights’ behavior in the field, it would have mattered whether the traffic lights were working in a normal mode or in flashing yellow mode. In both cases, there is a traffic officer expected to substitute traffic lights.

As a result, we got 5 tests in our decision table for traffic regulation.

Empty cells in the Actions are the good example of what can be explored further. Is the last action from the table applicable to tests 1, 2, 5 and 6? As we know for sure test 8 has no regulation over city transport. Hence, it should be controlled by the rule where the driver gives the way to the traffic on its right.

To Sum Up

In the future articles I’m going to imply another technique to cover cases with road users. I will bring actors to the table and correlate them with a traffic officer.

--

--