def test20_calculate_risk_reduction_test_coverage_zero_division_error( self): """ (TestSoftware) calculate_risk_reduction should return a 10 error code when attempting to divide by zero when calculating test coverage """ self.DUT.level_id = 2 self.DUT.lst_test_selection = [[1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [1, 0], [1, 1], [0, 0], [1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [1, 1], [0, 0]] self.DUT.test_effort = 1 self.DUT.labor_hours_test = 15 self.DUT.labor_hours_dev = 150 self.DUT.budget_test = 15286.0 self.DUT.budget_dev = 150894.0 self.DUT.schedule_test = 15 self.DUT.schedule_dev = 186 self.DUT.nm_test = 4 self.DUT.nm = 0 self.DUT.interfaces_test = 10 self.DUT.interfaces = 12 self.DUT.tu = 3 self.DUT.tt = 5 _error_code = _calculate_risk_reduction(self.DUT) self.assertEqual(_error_code, 10)
def test17_calculate_risk_reduction_schedule(self): """ (TestSoftware) calculate_risk_reduction should return a 0 error code on success when using schedule """ self.DUT.level_id = 3 self.DUT.lst_test_selection = [[1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [1, 0], [1, 1], [0, 0], [1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [1, 1], [0, 0]] self.DUT.test_effort = 3 self.DUT.labor_hours_test = 15 self.DUT.labor_hours_dev = 150 self.DUT.budget_test = 15286.00 self.DUT.budget_dev = 150894.00 self.DUT.schedule_test = 15 self.DUT.schedule_dev = 186 self.DUT.branches_test = 61 self.DUT.branches = 85 self.DUT.inputs_test = 10 self.DUT.inputs = 12 self.DUT.tu = 3 self.DUT.tt = 5 _error_code = _calculate_risk_reduction(self.DUT) self.assertEqual(_error_code, 0) self.assertAlmostEqual(self.DUT.te, 1.0) self.assertAlmostEqual(self.DUT.tm, 0.9) self.assertAlmostEqual(self.DUT.tc, 1.2895070) self.assertAlmostEqual(self.DUT.t_risk, 1.1605563)
def test19_calculate_risk_reduction_test_method_zero_division_error(self): """ (TestSoftware) calculate_risk_reduction should return a 10 error code when attempting to divide by zero when calculating test method """ self.DUT.level_id = 3 self.DUT.lst_test_selection = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]] self.DUT.test_effort = 2 self.DUT.labor_hours_test = 15 self.DUT.labor_hours_dev = 150 self.DUT.budget_test = 15286.00 self.DUT.budget_dev = 150894.00 self.DUT.schedule_test = 15 self.DUT.schedule_dev = 186 self.DUT.branches_test = 61 self.DUT.branches = 85 self.DUT.inputs_test = 10 self.DUT.inputs = 12 self.DUT.tu = 3 self.DUT.tt = 5 _error_code = _calculate_risk_reduction(self.DUT) self.assertEqual(_error_code, 10)
def test15_calculate_risk_reduction_labor(self): """ (TestSoftware) calculate_risk_reduction should return a 0 error code on success when using labor hours """ self.DUT.level_id = 2 self.DUT.lst_test_selection = [[1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [1, 0], [1, 1], [0, 0], [1, 1], [0, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [1, 1], [0, 0]] self.DUT.test_effort = 1 self.DUT.labor_hours_test = 15 self.DUT.labor_hours_dev = 150 self.DUT.budget_test = 15286.00 self.DUT.budget_dev = 150894.00 self.DUT.schedule_test = 15 self.DUT.schedule_dev = 186 self.DUT.nm_test = 4 self.DUT.nm = 5 self.DUT.interfaces_test = 10 self.DUT.interfaces = 12 self.DUT.tu = 3 self.DUT.tt = 5 _error_code = _calculate_risk_reduction(self.DUT) self.assertEqual(_error_code, 0) self.assertEqual(self.DUT.te, 1.0) self.assertAlmostEqual(self.DUT.tm, 0.9) self.assertAlmostEqual(self.DUT.tc, 1.2244898) self.assertAlmostEqual(self.DUT.t_risk, 1.1020408)