Logic Coverage

DUE: 11:59PM, Wednesday 6 March 2019

25 points


Objectives

  • The goal of this assignment is to practice problems related to logic coverage.

Tasks

  1. (17 points) Logic Expression Coverage Criteria

    Suppose that predicate p = (a ∨ c) ∧ (b ∨ d) Answer parts (a)-(h) using predicate p.

    1. (1 point) Identify the clauses that go with predicate p.

    2. (2 points) Compute and simplify the conditions under which each of the clauses determines predicate p.

    3. (4 points) Write the complete truth table for all clauses. Label the rows starting from 1. Use the format in the example underneath the definition of combinatorial coverage in Section 3.2 of edition 1, or Section 8.1.1 of edition 2. This will make it easier for us to grade. For example, row 1 should be all clauses true. You should include columns for the conditions under which each clause determines the predicate, and also a column for the predicate itself.

    4. (2 points) Identify all pairs of rows from your table that satisfy general active clause coverage (GACC) with respect to each clause.

    5. (2 points) Identify all pairs of rows from your table that satisfy correlated active clause coverage (CACC) with respect to each clause.

    6. (2 points) Identify all pairs of rows from your table that satisfy restricted active clause coverage (RACC) with respect to each clause.

    7. (2 points) Identify all 4-tuple of rows from your table that satisfy general inactive clause coverage (GICC) with respect ot each clause. Identify any infeasible GICC test requirements.

    8. (2 points) Identify all 4-tuples of rows from your table that satisfy restricted inactive clause coverage (RICC) with respect to each clause. Identify any infeasible RICC test requirements.


  2. (8 points) Structural logic coverage of programs

    Answer parts (a) and (b) for the method leapYear(int year) below.

    public String leapYear(int year) 
    {
        boolean isDivisibleBy4;
        if (year % 4 == 0) // earlier it said x instead of year by mistake
            isDivisibleBy4 = true;
        else
            isDivisibleBy4 = false;
    
        boolean isDivisibleBy4Not100;
        if (isDivisibleBy4 && (year % 100 != 0))
            isDivisibleBy4Not100 = true;
        else
            isDivisibleBy4Not100 = false;
    
        if(isDivisibleBy4Not100 || (year % 400 == 0))
            return "yes";
        else
            return "no";
    }
    
    1. (4 points) Identify test inputs for leapYear() that achieve Restricted Active Clause Coverage (RACC).
    2. (4 points) Identify test inputs for leapYear() that achieve Restricted Inactive Clause Coverage (RICC).


Submission

Type the answers to the above questions in a document called a5.pdf. Submit the file using Assignment Submission in Canvas.