Arunkumar Khannur's Software Testing Knowledge Center
   
 

9.6 Boolean Algebra


Boolean algebra was developed by George Boole around 1847. It is also referred to as “algebra of logic”. In 1938, Claude Shannon showed that Boolean algebra could be used to represent switching or two-state circuits. Due to this, Boolean algebra has become a symbolic tool to design complex logic circuits. However, in our discussion on logic based testing, we use Boolean algebra only with binary predicates where the output of logic is restricted to binary truth values: TRUE or FALSE.

With the help of Boolean algebra, we can represent predicate expressions symbolically; manipulate those predicate expressions using theorems and laws; and reduce complex predicate expressions to simple forms. In this section, we introduce predicates and relational operators; possible mistakes with predicates; notations used in Boolean algebra- Boolean constants, variables, and functions; the rules of Boolean algebra; simplification of Logic expressions using Boolean algebra; and use of Boolean algebra in test case design to find deviation from specification.

Boolean algebra is formulated using a defined set of elements, a set of operations, and a set of theorems. In this section, we discuss on using Boolean algebra in reporting any deviation from specification. In order to perform this, as a first step, we need to define set of elements.

Boolean Algebra: Notations, Constants, Variables, and Functions

In Boolean algebra, at each decision, the branch with ‘YES’ or ‘TRUE’ value is labeled with upper case letter and the branch with ‘NO’ or ‘FALSE’ value is labeled with the upper case letter with over-score. For example, for a predicate expression A, the branch with ‘YES’ or ‘TRUE’ value is labeled with A and the branch with ‘NO’ or ‘FALSE’ value is labeled with the⎯A.

Boolean constants are numerical symbols representing fixed values that never change. ‘0’ and ‘1’ are Boolean constants. ‘0’ is also represent- ed as ‘FALSE’ or ‘NO’. ‘1’ is also represented as ‘TRUE’ or ‘YES’.

Boolean variables are alphabetic symbols representing variable values like A, B, C etc or X, Y, Z etc. Each symbol may assume either TRUE or FALSE value at prescribed times.

In Boolean algebra, the basic logical operations or functions are AND. OR, and NOT and these are represented as:


The Axioms and Rules of Boolean Algebra

In the development of a system of Boolean algebra, it is necessary to start with a set of axioms.

Axioms

One of the requirements for the set of axioms is that they must be independent. This means that it should not be possible to derive some of them from others. The laws that are given below shall be taken as axioms:



In the above axioms and laws, a Boolean expression is represented by a letter. Following terminologies are useful while dealing Boolean algebra:

Literal: Each individual letter in Boolean expression is called a literal.
Product Term: A product of several literals is referred to as Product Term. Ex: ABC, ĀBC.
 
 
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
         
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
STEP-AUTO Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt