コード例 #1
0
    def test_4(self):
        """Test Paths for Prime Path Coverage"""
        o = M()

        #Test path is [3,8,9,12,23,26,27] and TRs for Prime-Path  coverage covered are {[3,8,9,12,23,26,27]}
        o.m([], 0)

        #Test path is [3,9,12,23,26,27] and TRs for Prime-Path  coverage covered are {[3,9,12,23,26,27]}
        o.m([], 1)

        #Test path is [3,8,9,13,14,23,24,27] and TRs for Prime-Path  coverage covered are {[3,8,9,13,14,23,24,27]}
        o.m([0], 0)

        #Test path is [3,8,9,13,17,18,23,24,27] and TRs for Prime-Path  coverage covered are {[3,8,9,13,17,18,23,24,27]}
        o.m([0, 1], 0)

        #Test path is [3,8,9,13,17,22,23,24,27] and TRs for Prime-Path  coverage covered are {[3,8,9,13,17,22,23,24,27]}
        o.m([0, 1, 2], 0)

        #Test path is [3,9,13,14,23,24,27] and TRs for Prime-Path  coverage covered are {[3,9,13,14,23,24,27]}
        o.m([0], 1)

        #Test path is [3,9,13,17,18,23,24,27] and TRs for Prime-Path  coverage covered are {[3,9,13,17,18,23,24,27]}
        o.m([0, 1], 1)

        #Test path is [3,9,13,17,22,23,24,27] and TRs for Prime-Path  coverage covered are {[3,9,13,17,22,23,24,27]}
        o.m([0, 1, 2], 1)
        pass
コード例 #2
0
 def test_3 (self):
     """Comment"""
     o = M ()
     # EPC does not differ from EC
     # since infeasible edge pairs exist
     # those feasible are covered by EC
     pass
コード例 #3
0
 def test_1(self):
     """RT={[ "", 0],[ "a", 0],[ "ab", 0],[ "abc", 0]}"""
     o = M()
     o.m("", 0)
     o.m("a", 0)
     o.m("ab", 0)
     o.m("abc", 0)
コード例 #4
0
 def test_4 (self):
     """Comment"""
     o = M ()
     # Similar to EPC, PPC does not differ from EC
     # since infeasible prime paths exist
     # and those feasilbe are already covered by EC
     pass
コード例 #5
0
    def test_4 (self):
        """TR_{PPC} = {[3,8,9,12,23,25,27],[3,9,12,23,25,27], [3,8,9,13,14,23,24,27],
         [3,9,13,14,23,24,27], [3,8,9,13,17,18,23,24,27],[3,9,13,17,18,23,24,27], 
         [3,8,9,13,17,21,23,24,27],[3,9,13,17,21,23,24,27] }
         all paths need to be covered"""
        o = M ()
        self.change_stdout()

        o.m('', 0)  # 3,8,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero')

        o.m('', 1)  # 3,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero')

        o.m('t', 0) # 3,8,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('t', 1) # 3,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('te', 0) # 3,8,9,13,17,18,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')

        o.m('te', 1) # 3,9,13,17,18,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')

        o.m('tes', 0) # 3,8,9,13,17,21,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')

        o.m('tes', 1) # 3,9,13,17,21,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')
        pass
コード例 #6
0
    def test_3 (self):
        """TR_{EPC} = {[3,8,9], [3,9,12], [3,9,13], [8,9,12], [8,9,13], 
        [9,12,23], [9,13,14], [9,13,17], [12,23,25], [13,14,23], [13,17,18],
         [13,17,21], [14,23,24], [17,18,23], [17,21,23], [18,23,24], 
         [21,23,24], [23,24,27], [23,25,27]}
         test_2 does not cover [8,9,12], make node 8 and 12 happens at the same time
         test_2 does not cover [3,9,13], make node 8 and 12 disappear"""
        o = M ()
        self.change_stdout()

        o.m('', 1)  # 3,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero')

        o.m('t', 1)  # 3,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('', 0)  # 3,8,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero')

        o.m('t', 0) # 3,8,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('te', 0) # 3,8,9,13,17,18,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')

        o.m('tes', 0) # 3,8,9,13,17,21,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')
        pass
コード例 #7
0
 def test_1 (self):
     """Comment"""
     o = M ()
     # NC
     o.m([], 0)
     o.m([1], 0)
     o.m([1,2], 0)
     o.m([1,2,3], 0)
     pass
コード例 #8
0
 def test_2 (self):
     """Comment"""
     o = M ()
     # NC
     o.m([], 0)
     o.m([1], 0)
     o.m([1,2], 0)
     o.m([1,2,3], 0)
     # need 1 more case for EC
     o.m([], 1)
     pass
コード例 #9
0
    def test_1(self):
        """Test Paths for Node Coverage"""

        o = M()

        #Test path is [3,8,9,12,23,26,27] and TRs for Node coverage covered are {3,8,9,12,23,26,27}
        o.m([], 0)

        #Test path is [3,8,9,13,14,23,24,27] and TRs for Node coverage covered are {3,8,9,13,14,23,24,27}
        o.m([0], 0)

        #Test path is [3,8,9,13,17,18,23,24,27] and TRs for Node coverage covered are {3,8,9,13,17,18,23,24,27}
        o.m([0, 1], 0)

        #Test path is [3,8,9,13,17,22,23,24,27] and TRs for Node coverage covered are {3,8,9,13,17,22,23,24,27}
        o.m([0, 1, 2], 0)
        pass
コード例 #10
0
    def test_2(self):
        """Test Paths for Edge COverage"""
        o = M()

        #Test path is [3,8,9,12,23,26,27] and TRs for Edge coverage covered are {[3,8],[8,9],[9,12],[12,23],[23,26],[26,27]}
        o.m([], 0)

        #Test path is [3,9,13,14,23,24,27] and TRs for Edge coverage covered are {[3,9],[9,13],[13,14],[14,23],[23,24],[24,27]}
        o.m([0], 1)

        #Test path is [3,9,13,17,18,23,24,27] and TRs for Edge coverage covered are {[3,9],[9,13],[13,17],[17,18],[18,23],[23,24],[24,27]}
        o.m([0, 1], 1)

        #Test path is [3,9,13,17,22,23,24,27] and TRs for Edge coverage covered are {[3,9],[9,13],[13,17],[17,22],[22,23],[23,24],[24,27]}
        o.m([0, 1, 2], 1)

        pass
コード例 #11
0
    def test_2 (self):
        """TR_{EC} = { [3,8], [3,9], [8,9], [9,12], [9,13], [13,14], 
        [13,17], [17,18], [17,21], [12,23], [14,23], [18,23], [21,23], 
        [23,24], [23,25], [24,27], [25,27] }
        test_1 does not cover the path(3,9), assign 1 to i to satisfy this"""
        o = M ()
        self.change_stdout()

        o.m('', 1)  # 3,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero')

        o.m('t', 0) # 3,8,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('te', 0) # 3,8,9,13,17,18,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')
        
        o.m('tes', 0) # 3,8,9,13,17,21,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')
        pass
コード例 #12
0
    def test_1 (self):
        """TR_{NC} = {[3, 8, 9, 12, 13, 14, 17, 18, 21, 23, 24, 25, 27]}
        Satisfy node 8 by assigning 0 to i, 
        and then change the length of arg to run all possible cases
        then use assertEqual to check the print result every time"""
        o = M ()
        self.change_stdout()

        o.m('', 0)  # 3,8,9,12,23,25,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'zero') # get the last output and check

        o.m('t', 0) # 3,8,9,13,14,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'a')

        o.m('te', 0) # 3,8,9,13,17,18,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')

        o.m('tes', 0) # 3,8,9,13,17,21,23,24,27
        self.assertEqual(self.new_output.getvalue().split('\n')[-2],'b')
        pass