Examples Overview > Test Guidelines > Test-Idea Catalogs > Test Ideas for Booleans (ANDs and ORs)

Test-Ideas Catalog: Test Ideas for Mixtures of ANDs and ORs

This catalog applies to expressions that combine ANDs and ORs. As a reminder, here's how to derive test requirements for homogenous expressions:

A1 && A2 && ... && An:

  • one test idea with All Ai's true
  • N cases, each of which has exactly one term false.

Example:

A && B && C
A B C
true true true
FALSE true true
true FALSE true
true true FALSE


A1 || A2 || ... || An:

  • one test idea with All Ai's false
  • N cases, each of which has exactly one term true.

Example:

A || B || C
A B C
FALSE FALSE FALSE
FALSE true FALSE
true FALSE FALSE
FALSE FALSE true










Two Boolean OperatorsTo top of page

(A && B) || C
A B C
FALSE true true
true true FALSE
FALSE true FALSE
true FALSE FALSE


A && (B || C)
A B C
true FALSE FALSE
true FALSE true
true true FALSE
FALSE FALSE true


A || (B && C)
A B C
true true FALSE
FALSE true true
FALSE FALSE true
FALSE true FALSE


(A || B) && C
A B C
FALSE FALSE true
FALSE true true
true FALSE true
FALSE true FALSE







Three Boolean OperatorsTo top of page

One And

To help find an expression, read down the columns. The ANDs drift from the left to the right as you read.

(A && B) || C || D   ((A || B) && C) || D
A B C D   A B C D
FALSE true true FALSE   FALSE FALSE true FALSE
true true FALSE FALSE   FALSE true true FALSE
FALSE true FALSE FALSE   true FALSE true FALSE
true FALSE FALSE FALSE   FALSE FALSE true true
true FALSE FALSE true   FALSE true FALSE FALSE


A && (B || C || D)   A || (B && (C || D))
A B C D   A B C D
true FALSE FALSE FALSE   FALSE true FALSE FALSE
true FALSE true FALSE   FALSE true FALSE true
true true FALSE FALSE   FALSE true true FALSE
true FALSE FALSE true   true true FALSE FALSE
FALSE FALSE FALSE true   FALSE FALSE FALSE true


A || (B && C) || D   A || B || (C && D)
A B C D   A B C D
true true FALSE FALSE   FALSE true true FALSE
FALSE true true FALSE   FALSE FALSE FALSE true
FALSE FALSE true FALSE   true FALSE true FALSE
FALSE true FALSE FALSE   FALSE FALSE true true
FALSE true FALSE true   FALSE FALSE true FALSE


(A||B) && (C || D)   (A || B || C) && D
A B C D   A B C D
FALSE FALSE FALSE true   FALSE FALSE FALSE true
FALSE true FALSE true   FALSE true FALSE true
true FALSE true FALSE   true FALSE FALSE true
FALSE true FALSE FALSE   FALSE FALSE true true
          FALSE FALSE true FALSE







Three Boolean OperatorsTo top of page

Two Ands

To help find an expression, read down the columns. The ORs drift from the right to the left as you read

(A && B && C) || D   ((A && B) || C) && D
A B C D   A B C D
true true true FALSE   FALSE true true true
FALSE true true FALSE   true true FALSE true
true FALSE true FALSE   FALSE true FALSE true
true FALSE true true   true FALSE FALSE true
true true FALSE FALSE   true FALSE true FALSE


A && B && (C || D)   A && (B || (C && D))
A B C D   A B C D
true true FALSE true   true true true FALSE
FALSE true FALSE true   true FALSE true

true

true FALSE FALSE true   true FALSE FALSE true
true true FALSE FALSE   true FALSE true FALSE
true true true FALSE   FALSE FALSE true true


A && (B || C) && D   (A || B) && C && D
A B C D   A B C D
true FALSE FALSE true   FALSE FALSE true true
true FALSE true true   FALSE true true true
true true FALSE true   true FALSE true true
FALSE FALSE true true   FALSE true FALSE true
true FALSE true FALSE   FALSE true true FALSE


(A && B) || (C && D)   A || (B && C && D)
A B C D   A B C D
FALSE true true true   FALSE true true true
true true true FALSE   FALSE FALSE true true
FALSE true FALSE true   FALSE true FALSE true
true FALSE true FALSE   true true true FALSE
          FALSE true true FALSE




Copyright  © 1987 - 2001 Rational Software Corporation


Display Rational Unified Process using frames

Rational Unified Process