CTFTP: A Test Case Generation Strategy for General Boolean Expressions Based on Ordered Binary Label-Driven Petri Nets

Boolean expression testing requires certain types of tests for each Boolean expression in program specification or implementation. Fault-based testing essentially uses a subset of the exhaustive test set to detect certain special types of faults. A fault-based Boolean expression testing strategy called constraint true and false test point (CTFTP) is proposed. The test consists of two test case generation strategies, namely a unique constraint true point (UCTP) strategy and a near constraint false point (NCFP) strategy. An ordered binary label-driven Petri net model is presented to analyze the interaction between Boolean transitions and Boolean literals and yield the test paths of a singular term for the irredundant disjunctive normal forms (IDNFs). On the basis of the test paths, we develop a configuration-based IDNF test generation algorithm, which is employed to obtain the UCTP, NCFP, and CTFTP test sets for the IDNFs. The proposed test generation algorithm based on literal substitution is applied to extend the CTFTP strategy and generate a test suite for general Boolean expressions, which are evaluated using TCAS II specifications. Experimental results show that the CTFTP strategy can detect the same seven types of faults similar to the MUMCUT strategy when testing IDNFs, but only a subset of the MUMCUT test set is required. Five types of faults of general Boolean expressions can also be detected using CTFTP strategies.


I. INTRODUCTION
The correctness and validity of Boolean expressions lay the foundation for the correctness and robustness of those software applications. Boolean expression testing requires certain types of tests for each Boolean expression in program specification or implementation. Given a Boolean expression with n variables, an exhaustive testing requires 2 n different test cases, and the test size will grow exponentially as the number of variables increases [1]. Selecting subsets from all possible test cases based on the test criteria can yield small and effective test suites, but their fault detection capabilities are reduced relative to exhaustive testing [2]. Therefore, new test strategies need to be introduced in view of ensuring that The associate editor coordinating the review of this manuscript and approving it for publication was Shouguang Wang . a given Boolean expression can be tested thoroughly, thus maximizing the fault detection capabilities while keeping the number of test cases as small as possible.
Test case generation strategies for Boolean expressions have attracted considerable attention over the past two decades. Tai and Su [3] proposed two test case generation algorithms to ensure that operator errors could be detected. Weyuker et al. [4] designed a family of meaningful impact (MI) strategies that can generate test cases automatically for a given Boolean specification, among which the MAX-B strategy is the most powerful because it subsumes all the other strategies in the family. MI strategies have been applied to the fault detection of the irredundant disjunctive normal form (IDNF) of Boolean expressions and exhibited extremely effective detection capabilities. A Boolean expression in disjunctive normal form is said to be irredundant if none of its terms can be omitted from the expression and none of its literals can be omitted from any term in the expression [5]. Chen and Lau [6], [7] proposed three test case selection strategies, namely, multiple unique true point (MUTP), multiple near false point (MNFP), and the corresponding unique true point (UTP) and near false point (NFP) pair (CUTPNFP) strategies; in this manner, two types of faults in the Boolean expressions, namely, literal insertion faults (LIFs) and literal reference faults (LRFs), can be detected. The above strategies and the MI strategies can detect seven types of faults in IDNFs, but the aforementioned three strategies are more cost-effective than the MAX-B strategy in detecting faults because the selected test cases typically form a subset of those cases selected by the MAX-B strategy [7]. Chen et al. [5] integrated the three strategies into the MUMCUT strategy, which requires fewer test cases than the MAX-A and MAX-B strategies when detecting the same seven types of faults. However, all the aforementioned strategies are suitable only for testing Boolean expressions in some restricted forms, such as IDNF, but not the original expressions. Testing a general form of the Boolean expression by using IDNF-oriented strategies always results in excessive test costs and misses the detection of certain faults.
Software practitioners are more likely to write conditions and logical decisions in general form rather than in IDNF, but their approach may introduce faults in the general form context [8]. A single fault in the general Boolean expression may cause more than one fault in the corresponding equivalent restricted form. Chen et al. [8] confirmed experimentally that the MUMCUT strategy has high efficiency in detecting the faults of general Boolean expressions and their mutation expressions and is more effective in detecting the faults of the original expressions than those of the mutants. Following the work of Chen et al. [8], Sun et al. [9] presented the characteristics of undetected faults of general Boolean expressions and their certainty of being undetected by the MUMCUT, then they analyzed why a MUMCUT test suite would fail to detect five undetected mutation patterns by means of forward/reverse MUMCUT experiments for fault-based testing of general Boolean expressions. However, mutation patterns may be undetected for each type of fault in a general Boolean expression. Sun et al. [10] evaluated and compared 18 faultbased testing strategies by means of a series of experiments, using more than 4000 randomly generated fault-based general Boolean expressions. Their experiments showed that the family of fault-based testing strategies, such as the MUMCUT, would usually provide the best performance.
Kapoor and Bowen [11] calculated the necessary and sufficient conditions to detect ten different types of fault categories of general Boolean expressions and proved the fault hierarchy relationship. However, their study overlooked the possibility of a mutant of the Boolean specifications as an equivalent in the testing. Hence, each of the fault relationships was either incorrect or presented an incorrect proof. Chen et al. [12] used counterexamples to reveal the incorrect fault relationships and provide new proof to validate fault relationships. A co-stronger fault relation was introduced to establish a new fault class hierarchy for general Boolean specifications. Gargantini and Fraser [13] proposed a test case generation approach for general Boolean expressions. The approach was a mutation-based method designed to detect all the ten types of faults studied in [11] and [12]. Wang et al. [14] proposed the minimal failure-causing schema (MFS) and probabilistic failure-causing schema (PFS) to describe the characteristics of the failure test cases for general Boolean specifications. The experiments results based on TACS II specifications [15] indicated that the PFS model is more competitive than the MFS model for the input-level fault localization scenario. In [16], the fault detection ability of the combinatorial test was verified to be better than that of the random test by means of the fault detection experiment of general Boolean expressions. However, the mutation analysis technology involved excessive test costs and yielded inaccurate test results [17].
Petri nets are a promising tool for describing and studying systems that are characterized as concurrent, asynchronous, distributed, parallel, nondeterministic, and/or stochastic [18]. Gong and Huang [19] proposed a generalized Boolean operator (BOR)-MI strategy based on predicate driven Petri nets to generate test cases for general Boolean expressions. However, the BOR-MI strategy can only detect BOR faults. In this study, we focus on detecting faults in Boolean expressions by developing an extended Petri net approach and generating test cases directly from a given general form of a Boolean expression. An ordered binary label-driven Petri net (OBLDPN) is developed to analyze the interaction between Boolean transitions and Boolean literals and yield test paths of a singular term for IDNFs. A Boolean transition is an intuitive representation of the logical relationship between an input and an output represented as a Boolean expression (Fig.1). By using OBLDPN, we propose a fault-based test strategy called the constraint true and false test point (CTFTP) strategy consisting of two test case generation strategies, namely, a unique constraint true point (UCTP) strategy and a near constraint false point (NCFP) strategy. A configuration-based IDNF test generation algorithm is further proposed to obtain the UCTP, NCFP, and CTFTP test sets for the IDNFs. The proposed CTFTP strategy is used to test the IDNF of the Boolean expressions in view of guaranteeing the detection of seven types of faults the same as those of the MUMCUT strategy, but the test set used by the CTFTP strategy is smaller.
Then, the CTFTP strategy is extended to directly test the general Boolean expressions. A general Boolean expression can be expressed as a Boolean function in the form of ''sum of products of sums,'' which is composed of multiple IDNF subexpressions [20]. When the CTFTP strategy is applied to test a general Boolean expression, a test set of each sub-expression of the Boolean expression is generated. Subsequently, an algorithm called general Boolean expression test generation based on literal substitution is developed to generate the required test cases for the general Boolean expressions. We use the TCAS II specifications to evaluate the CTFTP test strategy. The empirical result shows that the CTFTP strategy can detect five types of faults for a general form of a Boolean expression.
The rest of this article is organized as follows. In Section II, the UCTP, NCFP, and CTFTP strategies for generating the IDNF test cases are proposed. In Section III, we define an OBLDPN model and describe its dynamic properties by means of the behavior function. In Section IV, an algorithm is proposed for generating automatically a CTFTP test set for the IDNF, and a set of test adequacy criteria is provided for the path coverage criterion based on the OBLDPN. In Section V, we extend the CTFTP test strategy to generate test cases for the general Boolean expression and present a general Boolean expression test generation algorithm based on literal substitution. Section VI reports the experimental results on the basis of the TCAS II specifications. The related works are described in Section VII. The conclusions are given in Section VIII.

II. CTFTP TEST STRATEGY A. NOTATION AND TYPES OF FAULTS
We follow the notation and terminology proposed in [1], [5], and [21]. In this study, the BORs of AND (or ''∧''), OR (''∨''), and NOT (or ''¬'') are denoted as ''·'', ''+'', and '' − '', respectively. If the context is clear, then the operator ''·'' can be omitted. The set of all truth values is represented by B, that is, B = {0, 1}. The n-dimensional Boolean space is denoted by B n . In Boolean expressions, a positive literal or a negative literal may denote an occurrence of a Boolean variable. For example, b and b represent the positive and negative literals in the Boolean expression bc + bd, respectively. A Boolean expression with n variables uniquely defines a Boolean function f : B n → B but not vice versa. We will not distinguish a Boolean function from a Boolean expression in this article. Here, suppose a general Boolean function G( x) can be expressed in the form of ''sum of products,'' that is, where the Boolean vector x = (x 1 , x 2 , · · · , x n ) ∈ B n , k is the total number of terms, and f ( x) is the i-th term. In G( x), each term f i ( x), 1 ≤ i ≤ k may be expressed in the form of ''product of sums,'' which contains some sub-expressions in the IDNF. We first consider the test case generation of IDNFs in testing the general Boolean expressions. Suppose the IDNF f ( x) with n variables is represented as where m is the number of terms, and the i-th term p i ( x), 1 ≤ i ≤ m is a singular term that does not contain the operator ''+'' and occurs only once for each variable. Let where k i is the number of literals and expressed as |p i | = k i , x i j in which the j-th literal occurs, and all literals appear in lexicographical order. By negating the literal x i j of p i ( x), we obtain For simplicity, we abbreviate the IDNF f ( x) as f = p 1 + p 2 + · · · + p m without ambiguity. A test case (or test point) t is a value of the Boolean vector x. Let t = (t 1 , t 2 , · · · , t n ) be expressed directly as t = t 1 t 2 · · · t n , where t j ∈ B and 1 ≤ j ≤ n. Table 1 shows the test point and test set of (2). In this study, we consider the seven types of faults detection of IDNFs as reported in [4], [5], and [21]. For Boolean expressions in program specification or implementation, typical programming errors involve missing or extra literals/variables and the use of incorrect operators and operands [8]. These faults include expression negation fault (ENF), literal negation fault (LNF), term omission fault (TOF), operator reference fault (ORF), literal omission fault (LOF), LIF, and LRF.

B. CTFTP TEST STRATEGY FOR IDNFS
In this section, we describe the CTFTP test strategy of (2) containing two test case generation strategies, namely, UCTP and NCFP strategies.

Definition 1 (UCTP Strategy):
The points in test set T i of (3) are obtained from the UTP set UT P i (f ). For any point in T i , if for all variables not occurring in (3), only one variable has a value of 1 (or 0), and the other variables have a value of 0 (or 1) in the corresponding position, then T i is said to satisfy the UCTP strategy. The test set T i is called the UCTP test set and is represented by UCT P i (f ). If UCT P i (f ) is an empty set, then whenever possible, a point t i is selected from UT P i (f ), while a corresponding NFP t i,j is selected from each NFP i,j (f ), j = 1, 2, · · · , k i , in that t i and t i,j differ only in the truth value of the j-th literal appearing in (3). Then, t i and each t i,j are added to UCT P i (f ) and the corresponding NCFP i,j (f ), respectively. The set of all UCTPs test strategy can ensure that faults, such as ENF, LNF, TOF, ORF, and LIF, are detectable.
In this study, the IDNF example considered for generating test cases is written as The UTP set of abc in (5) is UT P 1 (f 0 ) = {11100, 11110}, but the UCTP set of abc is UCT P 1 (f 0 ) = {11110}.
Definition 2 (NCFP Strategy): The points in test set T ij of (3) are obtained from the NFP set NFP i,j (f ), j = 1, 2, · · · , k i . For any point in T ij , if for all variables not occurring in (3), only one variable has a value of 1 (or 0), and the other variables have a value of 0 (or 1) in the corresponding position, then T ij is said to satisfy the NCFP strategy. The test set T ij is called the NCFP test set and represented by NCFP i,j (f ). If NCFP i,j (f ) is an empty set, then whenever possible, a point t i,j is selected from NFP i,j (f ), while a corresponding UTP t i is selected from UT P i (f ), in that t i,j and t i differ only in the truth value of the j-th literal appearing in (3). Each t i,j and t i are added to the corresponding NCFP i,j (f ) and UCT P i (f ), respectively. The set of all NCFPs of (3) is given NCFP test strategy can ensure that faults, such as ENF, LNF, ORF, and LOF, are detectable.
For example, for the first, second, and third literals of abc in (5), the points 01100, 10100, and 11000 are NFPs, but they are not NCFPs. Points 01110 and 11010 are the NCFPs of the first literal a and the third literal c of abc, respectively. However, the NCFP set of the second literal b is an empty set. Therefore, we select the NFP 10100 from NFP 1,2 (f 0 ) as the NCFP, that is NCFP 1,2 (f 0 ) = {10100}. A unique truth point 11100 with a different truth value only at the corresponding position of the second literal is selected from UT P 1 (f 0 ) as the UCTP, in that UCT P 1 (f 0 ) = {11100, 11110}.
Neither the UCTP strategy nor the NCFP strategy can detect separately the LRF, but they can detect the LRF when used in combination. The CTFTP strategy is defined as follows.
Definition 3 (CTFTP Strategy): Each element in the test set T i of (3) is composed of a UCTP t i and multiple NCFPs t i,ī 1 , t i,ī 2 , · · · , t i,ī r of (3), where t i ∈ UCT P i (f ) and a certain j exists, and thus, t i,ī h ∈ NCFP i,j (f ), that is, i h = j. t i and each t i,ī h , h = 1, 2, · · · , r differ only in the truth value of the j-th literal appearing in (3). In this case, T i is said to meet the CTFTP strategy. The CTFTP test set of (3) is written as The CTFTP test set of (2) is given by CTFT P i (f ), which guarantees the detection of the LRF.
For abc in (5) are not difficult to obtain, in which ∅ denotes the space set. Hence, we select test point 10100 from NFP 1,2 (f 0 ) and add it to NCFP 1,2 (f 0 ), that is, NCFP 1,2 (f 0 ) = {10100}. According to Definition 2, the point 11100 in UT P 1 (f 0 ) also needs to be added to UCT P 1 (f 0 ). We obtain UCT P 1 (f 0 ) = {11100, 11110}. The CTFTP test set of abc is given by CTFT P 1  The MI strategy can detect five types of faults, such as ENF, LNF, TOF, ORF, and LOF, in IDNFs, but it may not be able to detect LIF and LRF [5], [21]. In this study, the proposed CTFTP strategy not only can detect the same five types of faults, but also LIF in the IDNFs; however, the test case set used is smaller than that of the MUMCUT strategy. Consider using the CTFTP strategy to detect LRF. Suppose the j-th literal x i j of (3) is replaced by the literal x i l that does not occur in (3), that is, In CTFT P i (f ), an element whose UCTP and corresponding NCFP differ only in the truth value of x i j exists, while the truth value of x i l is 0. Then, LRF can be detected. The following theorem proves that the CTFTP test set is a non-empty set.
Theorem 1: For any UCTP t in UCT P i (f ) of (3), an NCFP t always exists in NCFP i (f ), in that t and t differ only in the corresponding truth value of a certain literal of (3) and vice versa.

III. ORDERED BINARY LABEL-DRIVEN PETRI NET A. DEFINITION OF OBLDPN
A Petri net consists of places, transitions, and arcs that connect places and transitions [18]. In this study, the basic Petri net is extended to an OBLDPN model, which is used to analyze the interaction between Boolean transitions and Boolean literals, construct test paths, and generate test cases for Boolean expressions. Definition 4 (OBLDPN): An OBLDPN of a Boolean expression in the IDNF is an ordered binary digraph in which the number of nodes is related only to the number of variables. The OBLDPN is a 12-tuple = (P, T , F, s 0 , s f , V , B, L, δ, E, In, Out).
(1) P is a finite set of literal places used to model the system state.
(2) Let T = {(lchild, rchild, ltag, rtag, sign)| lchild, rchild ∈ P, ltag, rtag, sign ∈ B} be a set of all transitions, where ltag, rtag, and sign are the local labels in the transition t, and (i) lchild and rchild are the left and right children of t, respectively, indicating the state at which t arrives; (ii) ltag and rtag are the left and right labels of t, respectively, and ltag, rtag ∈ L. For the i-th term of a Boolean expression, if t.lchild ∈V , or t.lchild = s f , then t.ltag = 1, and t.ltag = 0 otherwise; if t.rchild ∈ V , or t.rchild = s f , then t.rtag = 1, and t.rtag = 0 otherwise; and (iii) sign indicates whether an interaction occurs between the L-subnet and the R-subnet. If t.sign = 1, then an interaction has occurred; otherwise, no interaction has occurred.
(3) F is a collection of arcs representing a flow relationship, and F ⊆ (P × T ) ∪ (T × P) and P ∩ T = ∅, P ∪ T = ∅.
(4) The initial state s 0 represents the starting point of the search path in , where s 0 ∈ P.  (9) δ : L → B is a labeling function. (10) E is an event set, in which each event denotes a firing of an enabled transition. (11) In and Out are the input and output relationship sets representing the input and output actions related to the transitions, respectively, and An OBLDPN is an ordered binary digraph divided into a left sub-OBLDPN (L-subnet for short) denoted by l and a right sub-OBLDPN (R-subnet for short) denoted by r . Two transitions from the left and right subnets may have the same left and right children. In l , except for s 0 and s f , the literal in each place is a negative literal. In r , except for s f , the literal in each place is a positive literal. All literal places in l and r are arranged in lexicographical order from the initial state s 0 to the final state s f . The OBLDPN of the Boolean expressions involving five variables is shown in Fig. 1. The dot circle in transition indicates the sign of the transition, that is, t.sign = 1.

B. DYNAMIC BEHAVIOR OF OBLDPN
in an OBLDPN be the precursor literal set and the successor literal set of transition t, respectively, where the successor literals of t are t.lchild and t.rchild. Let • p = {t|(t, p) ∈ F ∧t ∈ T ∧p = s 0 ∧(t.lchild = p∨t.rchild = p)} and p • = {t|(p, t) ∈ F ∧t ∈ T ∧p = s f } be the input transition set and the output transition set of literal p, respectively. The pre-and post-conditions that fire transition t are represented by t.pre and t.post, respectively, where The firing condition of transition t is determined by its pre-conditions and postconditions. The behavior of an OBLDPN is achieved by firing all transitions. The behavior of transition t is described as follows: (1) If t.ltag = 0 and t.rtag = 1, then transition t is fired along its right-child place. At this point, t.rchild is assigned to 1. If t is in l , that is, intertag = 1, then intertag is assigned to 0. The pre-and post-conditions of transition t are represented as t.pre = (t.ltag = 0, t.rtag = 1, t.sign = 0, intertag = 1or0) and t.post = (intertag = 0, t.rchild = 1), respectively.
(4) If t.ltag = 1 and t.rtag = 1, then transition t is no longer fired, the test path scan ends, and the test path is obtained. If intertag = 1 and (t.rchild) • .sign = 1 or intertag = 0 and (t.lchild) • .sign = 1, then the OBLDPN ends. The signs in all transitions of l and r are alternately presented, as shown by the dot circles in Fig. 1.
The behavior function ρ of an OBLDPN maps a transition to all possible sets of the developed scenarios. Let = {π|π : V → B} be a scenario set and the behavior function ρ be ρ : T → 2 , which is expressed as For example, in Fig. 1, the behavior function ρ of the OBLDPN of the second term abd in (5) can be given by In an OBLDPN, if the precursor literal • t of a transition t obtains a token, then transition t is called enabled. If a transition is enabled, then its precursor literal contains a token; otherwise, it does not contain any token. An enabled transition that meets its pre-and post-conditions is called a fired transition, which is also called a label-driven transition. When a transition t fires, it removes the token from its precursor literal • t and adds a token to the successor literal t • it outputs, thereby changing the system state. The behavior function ρ of the above OBLDPN provides the label of each enable transition. When s 0 obtains the token, these transitions will be fired one by one in accordance with the label sequence starting from transition t 0 , thereby yielding the test paths of (3).
Definition 5. (test path) Given a label sequence L =< l 0 , l i 1 , l i 2 · · · , l i n >, the transition sequence T =< t 0 , t i 1 , t i 2 , · · · , t i n > can be fired successively with respect to L , where n is the number of all variables in a Boolean expression. A test path (TPH) of (3) based on the OBLDPN is defined as TPH =< i n indicating that the transition t j satisfying its pre-condition t j .pre and post-condition t j .post under the label l j can be fired. Thus, the value of the left child (or right child) x j is equal to 0 (or 1), where x j = t j .lchild (or t j .rchild).
A test case or test point of (2) under a TPH is described as Definition 6 (Configuration): In the TPH of (3), the variable sequence θ =< x i 1 x i 2 · · · x i n−k i > composed of variables not occurring in (3) is called the complement of (3), in which the variables in θ are sorted in lexicographic order. An assign- (3) is called a complementary value or a configuration of (3), where η = α i 1 α i 2 · · · α i n−k i and α i j ∈ B, 1 ≤ j ≤ n − k i . The configuration length |η| is represented as |η| = n−k i j=1 α i j .
The UCTP set UCT P i (f ) (or NCFP set NCFP i,j (f )) of (3) is the set of test points in CT P i (f ) (or CFP i,j (f )) that satisfy Definition 1 (or Definition 2).

IV. GENERATING AUTOMATICALLY THE CTFTP TEST SET A. CTFTP TEST SET GENERATION ALGORITHM
According to OBLDPN, developing a test suite autogeneration algorithm for Boolean expressions is essential. We consider testing (3) and develop an algorithm called configuration-based IDNF test generation that generates automatically the test set UCT P i (f ) and NCFP i,j (f ) of (3). The algorithm first generates the TPTPH of (3) to obtain the sets T P i (f ) and CT P i (f ). By negating the j-th literal in the TPTPH of (3), k i FPTPHs are derived to obtain sets FP i,j (f ) and CFP i,j (f ), where 1 ≤ j ≤ k i . Finally, the set CTFT P i (f ) is constructed. The configuration-based IDNF test generation algorithm that generates the sets UCT P i (f ) and NCFP i,j (f ) is proposed as Algorithm 1.
In Algorithm 1, the transitions in the OBLDPN satisfying the pre-and post-conditions are fired to obtain the TPTPH set and corresponding truth point test case set of (3). The 2 n−k i configurations are obtained for each TPTPH. A CTP is obtained when the corresponding configuration length is 1 or n−k i −1. The corresponding k i CFPs are obtained by negating the j-th literal occurring in (3). Repeat Steps 1 to 4 to generate test sets T P i (f ), CT P i (f ), FP i,j (f ), and CFP i,j (f ), and then generate test sets UCT P i (f ), NCFP i,j (f ), and CTFT P i (f ) of (3), where j = 1, 2, · · · , k i . Algorithm 1 can be terminated.

Its time complexity is O(2 n−k i ).
Example 1: Consider (2) that can be written as a general Boolean expression, that is, Algorithm 1 Configuration-Based IDNF Test Generation Algorithm Input: OBLDPN of (2) with n variables. Output: UCT P i (f ), NCFP i,j (f ), and CTFT P i (f ). 1: Initialize the sets T P i (f ), UT P i (f ), FP i,j (f ), NFP i,j (f ), CT P i (f ), CFP i,j (f ), UCT P i (f ), and UCFP i,j (f ) to the empty set ∅. 2: In , any transition t i j that satisfies its pre-condition t i j .pre and post-condition t i j .post will be fired. If all transitions satisfy their pre-and postconditions, then these transitions will be fired in turn from the initial state s 0 to the final state s f . A TPTPH path of (3) is generated.
The corresponding test case T C i = α i 1 α i 2 · · · α i n can also be obtained, where α i j ∈ B and 1 ≤ j ≤ n. 3: Suppose θ j is the complement of (3). Let The complement θ j =< x j 1 x j 2 · · · x j n−k i > and 2 n−k i configuration η j of (3) can be obtained, that is, Similarly, we can derive the k i FPTPHs of (3) by negating the j-th literal appearing in (3) in the above TPTPH, thereby obtaining sets FP i,j (f ) and CFP i,j (f ), where 1 ≤ j ≤ k i . 5: For each term p h of (2), where h = 1, 2, · · · , m, repeat Steps 1 to 4 to generate T P h (f ), CT P h (f ), FP h,j (f ), and CFP h,j (f ). 6 T P k (f ). 7: If UCT P i (f ) = ∅ or NCFP i,j (f ) = ∅, then select a point t from UT P i (f ) and a point t from each NFP i,j (f ), j = 1, 2, · · · , k i , in that t and t differ only from the truth value of the j-th literal appearing in (3). 8: Select the test cases in NCFP i,j (f ) corresponding to the elements in UCT P i (f ) to construct CTFT P i (f ). 9: return UCT P i (f ), NCFP i,j (f ), and CTFT P i (f ).
By calling Algorithm 1, the test cases of the subexpression (7) are generated. g = bc +bd.

B. TEST-ADEQUACY CRITERIA
The adequacy of a test set is measured against a finite set of elements. Depending on the adequacy criteria of interest, the elements can be derived from the OBLDPN of the tested Boolean expression. If the corresponding coverage domain depends only on the internal structure of the source code, then the criterion is a white-box test adequacy criterion, in which the execution of the program statements can be detected through branches, loops, and paths [22]. If a path is a sub-path of at least one of the transition paths of the test case TC from the initial position to the end position, then the path is covered by the test case TC. For each path, at least one test case TC can be used to cover the path called the path coverage criterion [23]. Here, we consider a path coverage criterion based on the OBLDPN.
Path Coverage Criterion: The CTFTP test set T is considered adequate in relation to the OBLDPN if, for each element of T , each constraint TPTPH and the corresponding constraint FPTPHs from the initial state s 0 to the final state s f are executed at least once.

V. GENERATING AUTOMATICALLY TEST SETS FOR GENERAL BOOLEAN EXPRESSIONS
We extend the proposed CTFTP strategy to generate a test suite of general Boolean expressions, such as (1). Suppose the i-th term f i ( x) of (1) is written as where τ i is the number of factors consisting of literals and subexpressions and g i j , 1 ≤ j ≤ τ i is a literal or a sub-expression in the IDNF. For example, in (6), the first term a(bc +bd) contains a single literal a and a subexpression bc +bd, but the second term consists only of a single literal e.
We consider the test generation of (8), which contains the subexpressions g i j 1 , g i j 2 , · · · , g i j v , where 1 ≤ j 1 , j 2 , · · · , j ν ≤ τ i , in the form of IDNF. After replacing the subexpressions g i j 1 , g i j 2 , · · · , g i j v with the literals x i j 1 , x i j 2 , · · · , x i j v occurring in g i j 1 , g i j 2 , · · · , g i j v , respectively, Eq. (8) is transformed into a new simple conjunctive form as

Algorithm 2 General Boolean Expression Test Generation Algorithm Based on Literal Substitution
Input: OBLDPN of (1). Output: UCT P i (G), NCFP i,j (G), and CTFT P i (G). 1: Replace the subexpressions in (8) with the corresponding literals to obtain (9). 2: In (8) (9), use Algorithm 1 to generate the sets UCT P i (q i ) and NCFP i,j (q i ), where j = 1, 2, · · · , j 1 , j 2 , · · · , j v , · · · , τ i . 4: The set UCT P i (G) for (8) is given by 5: If g i j represents the literal occurring in (8), then the set NCFP i,j (G) is written by where j = j 1 , j 2 , · · · , j v . If g i j represents the subexpression g i j h appearing in (8), then the set NCFP i,j (G) is written by UCT P σ (g i j z ), k σ is the number of terms in g i j z , and j = j 1 , j 2 , · · · , j v . 6: The test cases in NCFP i,j (G) corresponding to the elements in UCT P i (G) are selected to construct CTFT P i (G). 7: return UCT P i (G), NCFP i,j (G), and CTFT P i (G).
where the literal x i j h , h = 1, 2, · · · , ν, is the last literal that appears in the subexpression g i j h in lexicographic order, but its negated literalx i j h does not occur in g i j h . If x i j h andx i j h occur in g i j h , then the previous literal x i j h −1 occurring in g i j h is selected in lexicographic order. However, x i j h −1 cannot appear in g i j h , and so on. Subsequently, we present an algorithm called the general Boolean expression test generation algorithm based on literal substitution to generate automatically the test suite for general Boolean expressions. The proposed algorithm is described as Algorithm 2.
In Algorithm 2, for each subexpression in (8), We replace the subexpression with the last literal appearing in (8) to obtain (9). For (9), we call Algorithm 1 to determine the UCTP set UCT P i (q i ) and the NCFP set NCFP i,j (q i ). Algorithm 1 is used for each term of each subexpression g i j h in (8) to generate the sets UCT P j h (g i j h ) and NCFP i,j h (g i j h ). The intersection of the set UCT P i (q i ) and the sets UCT P j h (g i j h ) of the v subexpressions g i j h yields UCT P i (G) for (8). If (8) contains no subexpressions, then the intersection of the set NCFP i,j (q i ) and the set UCT P j h (g i j h ) of the v subexpressions g i j h is generated. If (8) contains subexpressions, then the intersection of the sets NCFP i,j (q i ) and the union of all sets NCFP i,j h (g i j h ) and UCT P j z (g i j z ) of the v − 1 sub-expressions g i j z other than the j h -th sub-expression g i j h , which denotes the set NCFP i,j (G) of the j-th literal or subexpression appearing in (8), is obtained.
The sets UCT P 2 (G 0 ) and NCFP 2,1 (G 0 ) for the second term e of (6) are given by UCT P 2 (G 0 ) = {00011, 00101, 01001, 01111, 10001},  Algorithm 2 can generate automatically test cases for a given general Boolean expression. The CTFTP strategy can detect five types of faults, that is, ENF, LNF, TOF, ORF, and LOF, of general Boolean expressions. However, LIF and LRF cannot always be detected.

VI. EMPIRICAL RESULTS
We report an empirical study on the CTFTP testing strategy in this section. We use the same 20 Boolean expressions as in [4], which originated from the TCAS II specification of the aircraft collision avoidance system [15], to facilitate the comparison of results as those in [2] and [21]. We transform each TCAS II expression into an equivalent expression in the form of IDNF. The CTFTP test set of the IDNFs can be generated using Algorithm 1. Table 2 presents a comparison of the sizes of the four test sets, namely, CTFTP, MUMCUT, MAX-A, and MAX-B test sets, of the IDNF expressions. In Table 2, the CTFTP test set and the MAX-A and MAX-B test sets are generated by Algorithm 1 and the percentage of the size of the test sets relative to the size of the exhaustive test set is exhibited. For comparison, we list the MUMCUT test set generated by the G-CUN and G-UCN methods, which are two greedy incremental expansion methods, and reproduce the MAX-A and MAX-B test sets from Table 2 presented in [21].
In Table 2, Columns 2-4 list the number of variables in the expression, the length of the expression, and the weighted average of the number of literals that do not appear in all terms. The percentage of the CTFTP test set for the 20 Boolean expressions ranges from 0.70% to 35.57%, with an average value of 11.60%. The average percentage of the CTFTP test set is smaller than the average percentage of the MUMCUT test set generated by the G-CUN and G-UCN methods (11.86% and 11.96%, respectively). The size of the CTFTP test set is only slightly larger for the MUMCUT test set generated by the G-CUN and G-UCN methods in the two Boolean expressions of Specs. T01 and T19; however, the two test sets have the same size for Specs. T09, T10, T11, and T12. For the remaining Boolean expressions, the size of the CTFTP test set is relatively small.
As shown in Table 2, by using Algorithm 1, the percentage of the MAX-A test set of the 20 Boolean expressions ranges from 2.9% to 87.5%, with an average of 37.41%, while the percentage of the MAX-B test set ranges from 3.14% to 93.75%, with an average of 39.91%. For the MAX-A and MAX-B test strategies, the average percentages of the two test sets generated by Algorithm 1 are smaller than the average percentages of the two test sets generated in [21] (40.66% and 48.22%, respectively). For (3), we only select test points in which the configuration length |η| of (3) satisfies |η| = 1 or |η| = n − k i − 1. Theoretically, the maximum numbers of test points in the UCT P i (f ) test set and the NCFP i,j (f ) test set of (3) are 2(n − k i ) and 2k i (n − k i ), respectively. However, for the MAX-A test strategy, the maximum numbers of test points in the UT P i (f ) test set and the NFP i,j (f ) test set of (3) are theoretically 2 n−k i and k i · 2 n−k i , respectively. Weyuker et al. [4] reported that the MAX-A test set contains all UTPs and all NFPs associated with each term. When constructing the MAX-B test set, in addition to selecting all the elements in the MAX-A set test, one needs to select n − k i points from the set of overlapping true points of size 2 n−k i and n − k i points from the set of remaining false points of size 2 n−k i . Theoretically, the percentage is smaller when the Boolean expression contains more variables [21]. However, the size of a Boolean expression test set is related to the following factors: (1) the number of variables, (2) the length of the expression, and (3) the maximum and minimum number of literals that do not occur in all items. The maximum and minimum numbers are represented by the weighted average (i.e., mathematical expectation) of the number of literals that do not appear in all items. The size of a Boolean expression is determined by the expression length and the number of variables, in which the expression length is determined by the number of literals appearing in all terms and the number of terms. Table 2 shows the effect of the abovementioned three factors on the size of the four test sets.
(1) In general, when the number of variables is the same, the longer is the length, the more instances in which the four test cases are required, but there are exceptions. For Specs. T03, T13, and T16 with 12 variables, T03 has the largest test set. However, for Specs. T08 and T19 with eight variables, the length of T19 is smaller than that of T08, but the average number of non-appearing literals in T19 is larger than that in T08. Thus, the T19 test set is larger than the T08 test set.
(2) For the CTFTP and MUMCUT strategies, when the length of the Boolean expression is nearly the same, the higher is the number of variables, the smaller is the percentage of the test cases. This trend is consistent with the conclusion in [21]. For Specs. T01, T05, T08, and T17, Spec. T17 contains the most variables. Thus, the percentage of the CTFTP and MUMCUT test cases for T17 is the smallest.
(3) In the case of the same number of variables, if the length does not change excessively, then the larger is the average number of literals that do not appear in all terms, the larger are the four test sets. For Specs. T09 and T20 with seven variables, the length of T20 is slightly smaller than that of T09, but more literals that do not appear on the average in T20 than in T09. Thus, the four test sets of T20 are larger than those of T09. Specs. T08 and T19 are similar.
In this experiment, we present the CTFTP test suites of several Boolean expressions, as shown in Table 3. The expression S 3 represents Spec. T04, while S 4 corresponds to (5). The expression S 2 is a general form of S 1 . The following results can be deduced from Table 3: (1) The size of the CTFTP test set of a Boolean expression is related to the maximum and minimum numbers of literals that do not appear in all sub-expressions. The larger is the average number of literals that do not occur in the subexpressions of a Boolean expression, the smaller is the CTFTP test set of the expression. S 3 and S 4 have the same three factors abovementioned, but the average number of literals that do not occur in their subexpressions is different, which leads to different numbers of test cases. In S 3 and S 4 , the average number of non-appearing literals of the respective sub-expressionsb +c and bc +bd are 4 and 3, respectively. Therefore, the CTFTP test set of S 4 is smaller than S 3 .
(2) The CTFTP test set of a general Boolean expression is larger than its corresponding IDNF test set. For example, the CTFTP test set of S 2 is larger than that of S 1 . In Example 3, the CTFTP test set of (6) contains 16 test cases, which is larger than the test set of S 4 .

VII. RELATED WORK
Several strategies are used for the fault detection and analysis of Boolean expressions. Tai [25] extended the work in [3] to detect faults including BORs, Boolean and relational operators (BRO), and Boolean and relational expressions (BRE), and devised BOR-, BRO-, and BRE-adequacy testing strategies to generate the corresponding test cases. Yu et al. [21] extended and complemented the theoretical work in [7] to evaluate the cost-effectiveness of testing experimentally the IDNF by means of the MUMCUT test strategy. Their experimental results showed that the greedy CUN and UCN methods are better than other methods in generating smaller test sets, and the test set sizes are linearly correlated with the length of IDNFs. Chen et al. [26] developed a web-based Boolean expression fault-based test case generation tool called BEAT by using the MUMCUT test strategy. Kaminski et al. [27] extended the work in [7] to cover term insertion fault, term negation fault, semantic test criteria, and MUTP/NFP test criteria. Kaminski and Ammann [28] presented a new logic criterion called the Minimal-MUMCUT criterion to reduce the MUMCUT test set size in minimum DNF. The experimental study that used the TCAS II specifications determined that if feasibility is not considered, then Minimal-MUMCUT will reduce the test set size to a few percentages of the required test set size without sacrificing fault detection. However, those efforts focused only on improving the existing test adequacy criteria to reduce test set size and ignored the randomness and repeatability of selecting MUMCUT test cases. By contrast, the proposed CTFTP strategy in the present work is used to test the IDNF of Boolean expressions and ensure that the same seven types of faults similar to those of the MUMCUT strategy can be detected, but the CTFTP test set is smaller. Our experimental results show that the average size of the CTFTP test set is 1.7 and 2.5 percentage points smaller than those of G-CUN and G-UCN, respectively.
Researchers have explored in recent years some test generation techniques for Boolean expressions. Feng et al. [29] explored the application of four test strategies (partition strategy, decision table-based test, basic MI strategy, and fault-based test) in table-based specifications. They compared the four test strategies on a mathematical basis by means of a formal and precise definition of the subsumption relationship and showed in most cases that the basic MI strategy was the strongest whereas the partition strategy was the weakest. Kalaee and Rafe [30] proposed a new method to test Boolean specifications based on cause-effect graphs to generate pairwise tests. Their method used a reduced ordered binary decision diagram to reduce the Boolean specification and utilized a particle swarm optimization algorithm to select the optimal test suite, which lowered the test cost and test time. Li et al. [31] proposed an SMT-based MI strategy with high spatiotemporal performance to improve the automatic testing technology of large Boolean expressions in the field of interlocking systems. Brida and Scilingo [32] proposed a Boolean expression expander to evaluate the adequacy of a test suite. Their proposed expander was a novel mutation operator focusing on Boolean expressions, and it operated by strengthening and weakening such expressions. An overview of the research efforts regarding software combination testing with binary inputs is presented in [33]. However, those studies were used mainly for the fault detection of special Boolean expressions but could not generate directly the test suites for general Boolean expressions. On the basis of the CTFTP strategy, we propose in the present work an algorithm called general Boolean expression test generation algorithm based on literal substitution that generates automatically a test suite of general Boolean expressions.
Paul et al. [34] proposed a singular true position coverage strategy to detect LIFs in general Boolean expressions by using approximately half of the test cases with the modified condition/decision coverage (MC/DC) strategy. The MC/DC strategy, a structural code coverage metric, was originally defined in the DO-178B standard and intended to be an efficient coverage metric for evaluating software testing processes that incorporate decisions with complex Boolean expressions [35]. By considering the MC/DC criterion, Jones and Harrold [36] proposed two new algorithms for reducing test suites, break-down reduction and build-up reduction algorithms, and a new algorithm for test-suite prioritization. The experimental studies that used TCAS II specifications indicated that the proposed test suite reduction techniques could reduce effectively the test suites while providing acceptable performance. Gay et al. [37] used four real-world avionics systems to explore the effects of an implementation structure on the efficiency of test suites meeting the MC/DC criterion. Their experimental results demonstrated that the test suites that achieved MC/DC over implementations with structurally complex Boolean expressions were generally larger and more effective than the test suites that achieved MC/DC over functionally equivalent but structurally simpler implementations. Ayav [38] proposed a Fourier analysis-based prioritization method for MC/DC test suites. Under certain fault hypotheses, the strict negative correlation between the fault exposure potentials of the test cases and the influence values of their associated input conditions allowed for easy the ordering of the test cases without extensive mutation analysis. Kitamura et al. [39] developed an algorithm based on SAT solving to generate a minimum MC/DC test suite of Boolean expressions within a reasonable time. However, the MC/DC strategy has weak fault detection capabilities. Finding fault types in complex Boolean expressions is not easy, and it requires an important amount of time. Yu and Lau [24] compared MC/DC, MUMCUT, and several other related coverage criteria for logical decisions by means of formal and empirical analysis. Their results showed the MC/DC test sets were effective, but some faults might still be missed even if they can almost always be detected by a test set that meets the MUMCUT criterion. In the present study, the CTFTP test suite has the same fault detection capabilities similar to the MUMCUT strategy. The CTFTP strategy can be used to generate automatically the IDNF and general Boolean expression test cases, and it is suitable for the test case generation of complex Boolean expressions. The time complexities of the two proposed test generation algorithms are O(2 n−k i ) and O((k − µ) · 2 n−k i + µ · ν · k u · 2 2n−τ i −k w ).
Petri net and its extended models, such as stochastic timed Petri net, generalized connected self-loop free Petri net (S 4 PR), logic and threshold Petri net, Petri net with data operations, etc., are widely used in the modeling and analysis of discrete event scenarios. These models have been applied to the development of simulation engines for resource optimal provisioning analysis in emergency healthcare systems [18], the calculation of emptiable minimal siphon [40], the design of web service discovery strategy based on user requirements [41], and data-flow error detection in business processes [42]. Ding et al. [43] proposed a systematic strategy with specific algorithms to construct an interactive control model based on Petri net for human-computer interaction systems to analyze and control mobile robots. However, those Petri net models did not involve the expression of Boolean logic operation characteristics and thus could not be directly applied to Boolean expression test case generation. In the present study, the OBLDPN model is proposed to analyze the interaction between Boolean transitions and Boolean literals and generate the test paths for Boolean expressions in view of obtaining the CTFTP test suite.

VIII. CONCLUSION
In this study, we propose a novel Boolean expression test generation strategy called the CTFTP strategy, which is based on a new OBLDPN model, to generate automatically certain test cases. By using a smaller test set, the CTFTP strategy can detect the same seven types of faults similar to those of the MUMCUT strategy. The number of places in the proposed OBLDPN model is only related to the number of variables in the Boolean expression and does not require the number of terms in the Boolean expression and the number of literals in each term. We specify the structure and characteristics of OBLDPN and describe its dynamic behavior. The CTFTP strategy is further extended to generate a test suite for general Boolean expressions, and a general Boolean expression test case generation algorithm based on literal substitution is proposed. The algorithm can detect five types of faults of general Boolean expressions, but the LIF and LRF cannot always be detected.
The technologies proposed in this study are valid, and the samples provided are representative; thus, the threats to internal validity will not likely exist. We provide logical and mathematical representations of the extended Petri net method and Boolean expression testing technology and apply the proposed OBLDPN model to Boolean expression testing by means of detailed explanations and illustrations. For example, the study has investigated the relationship between the logical faults and topological changes of Boolean expressions, the relationship between path coverage and Boolean expression topology, the relationship between test path constraints and logic fault detection, and the relationship between label and behavior of then OBLDPN. All of these techniques have been tested and verified by many experiments. The results have been manually evaluated to ensure the correctness of the experiments. However, the problem of test generation of general Boolean expressions involving nested subexpressions is not considered in this study. Further work is necessary to extend the CTFTP strategy onto more particular or wider Boolean specifications taken from real programs and evaluate the adequacy of testing for general Boolean expressions. The Boolean expressions may involve nested subexpressions, implication operators, equivalent operators, and so on. Due to the complexity of the algorithm, we also need to simplify the OBLDPN model. Some alternative approaches to generate efficiently a CTFTP test suite are being investigated to reduce test costs.