Super simple method to create a boolean decision table

Today one of our test engineers, Manfred, presented about systematic identification of test values. One of the topics were decision tables. I was fascinated how easy he created tables with all possible combinations. Here is how:

  1. Write the conditions in seperate rows.
  2. Condition A
    Condition B
    Condition C
    
  3. Now make 2^n columns where n is the number of conditions.
  4. Condition A |   |   |   |   |   |   |   |   |
    Condition B |   |   |   |   |   |   |   |   |
    Condition C |   |   |   |   |   |   |   |   |
    
  5. Start at the bottom condition and write alternating Y and N.
  6. Condition A |   |   |   |   |   |   |   |   |
    Condition B |   |   |   |   |   |   |   |   |
    Condition C | Y | N | Y | N | Y | N | Y | N |
    
  7. Fill the next row with alternating Y Y N N …
  8. Condition A |   |   |   |   |   |   |   |   |
    Condition B | Y | Y | N | N | Y | Y | N | N |
    Condition C | Y | N | Y | N | Y | N | Y | N |
    
  9. Each row you double the number of consecutive Ys and Ns.
  10. Condition A | Y | Y | Y | Y | N | N | N | N |
    Condition B | Y | Y | N | N | Y | Y | N | N |
    Condition C | Y | N | Y | N | Y | N | Y | N |
    
  11. Do so until all rows are filled.
  12. Now you can add your decisions to the table.
  13. Condition A | Y | Y | Y | Y | N | N | N | N |
    Condition B | Y | Y | N | N | Y | Y | N | N |
    Condition C | Y | N | Y | N | Y | N | Y | N |
    ---------------------------------------------
    Decision 1  |   | X | X |   |   |   |   |   |
    ...
    

Using this algorithm you can be sure you covered all combinations. It doesn’t matter how many conditions you have and you don’t even have to think :)

Thanks Manfred!

  • Twitter
  • del.icio.us
  • DZone
  • Reddit
  • HackerNews
  • Google Bookmarks
  • Digg
  • Technorati
  • Slashdot
  • email
  1. Rayk says:

    Ha, it works! This internet is awesome!

  2. Joerg says:

    Yeah pingbacks are great, aren’t they!

  1. [...] 2009 April 5 by Rayk Fenske Triggerd by Jörgs posting about the simple creation of decission tables for later test cases I remebered a part of my thesis back in 1997: Karnaugh Veitch Tables. So, I re-LaTexed the specific [...]

Leave a Reply