Back to blog

2026-11-20 · 5 min read

How to Practise a Decision Table Before Writing Code

Turn a small fictional rule into a decision table, find missing cases and test expected outcomes before writing your first programme.

Start with a rule you can explain

A decision table lists the combinations of conditions that matter and the outcome expected for each. It is a useful bridge between a short written requirement and a programme: you can check the logic without first learning a particular programming language. For this exercise, use a fictional community workshop rather than real booking or payment data.

The workshop admits a visitor only when a place is available and the visitor has a confirmed reservation. A wait-list request is not a confirmed reservation. These are practice rules you control, not a claim about how a real business should operate. Write them at the top of your document so a reviewer can see the intended scope.

Build the four clear cases

Create columns for Case, Place available, Reservation confirmed and Expected outcome. Enter four rows: yes/yes means admit; yes/no means do not admit; no/yes means do not admit; no/no means do not admit. Give each row a stable label such as C01. The labels make it easier to discuss a mistake without relying on where a row happens to sit.

Before adding code, read each row aloud as a complete sentence. For example: a confirmed reservation without an available place does not permit admission under the stated rule. That may expose a requirement you would want clarified in real work. Keep the exercise rule unchanged unless you deliberately revise and record it.

Make unknown information visible

Add a separate case in which reservation status is unknown. Do not silently treat unknown as yes. Write a review outcome such as ask the organiser to confirm the reservation, and leave admission unresolved. Missing information is a different problem from a definite negative answer.

Now introduce a contradictory message: the visitor has a confirmation email but the practice reservation list says cancelled. Record the conflicting evidence and who would resolve it. A beginner's task is to recognise that the original yes/no table does not decide which source is authoritative, not to invent a policy that makes the conflict disappear.

Test the table without a programming language

Cover the outcome column and ask a learning partner to work through the stated rule. Compare answers with your expected outcomes, then investigate disagreements. If the wording supports two interpretations, improve the requirement before changing the expected result.

If you later implement the rule, enter one case at a time and record actual outcome beside expected outcome. Include the two cases where only one condition is satisfied; testing only yes/yes and no/no can miss an incorrect rule that accepts either condition. Use only your own practice project and tools you are authorised to change.

Keep a useful learning record

Save the rule, the table, a version date and a short note explaining one ambiguity you found. If you change the rule, preserve the previous version and explain which expected outcomes changed. This demonstrates reasoning more clearly than a screenshot of a programme that merely appears to work.

For a portfolio, describe it honestly as a small learning exercise. Explain what you checked and what remains outside scope, such as reservation storage, user authentication or a real booking process. Explore iTechScale's learning guides for a related next step; completing this exercise does not promise employment or a professional credential.

Frequently asked questions

Do I need a spreadsheet? No. A document or handwritten table works if the cases and outcomes remain readable.

Should every possible situation fit the first table? No. Identify missing or conflicting information explicitly, then clarify the requirement rather than guessing.

When is the exercise finished? Each defined combination has an explained outcome, unresolved cases are labelled, and a second pass produces the expected results.

Build your learning plan

Explore iTechScale courses and choose the subject that matches your career direction.

Explore iTechScale

May we use Google Analytics cookies to understand visits to our public pages? Analytics is optional. We do not send form contents, private account pages or URL query details. You can change your choice using Analytics settings.