Question: Review and execute the Assignment3.py file, and the manual for the Python unit test library. import unittest print 'Assignment 3 Python reference code' numbers =

Review and execute the Assignment3.py file, and the manual for the Python unit test library.

import unittest print 'Assignment 3 Python reference code'

numbers = [[4, 3], [1,2], [154,233], [555,-444], [555,-444]]

def return_add_pair(pair): return str(pair[0]) + '+' + str(pair[1]) + '= ' + str(pair[0] + pair[1])

print ' return_add_pair examples' print return_add_pair(numbers[0]) print return_add_pair(numbers[1]) print return_add_pair(numbers[2]) print return_add_pair(numbers[3])

print ' Automated Test of show_add_pair'

class TestAssignment3(unittest.TestCase):

def test_one(self): self.assertEqual(return_add_pair([2, 3]), '2+3= 5')

if __name__ == '__main__': unittest.main()

A. Add at least 2 additional tests cases that you could use to test the return_add_pair function after test_one. Modify the function of return_add_pair to include a space between the + sign (i.e., 1+2 vs 1 + 2), and update the tests accordingly so that they pass .

B. How would you describe the software process you used to accomplish question A? Which of the primary software activities did you perform, and in what order?

C. If you were to accomplish Question A again, would you use the same process you used the first time? Given the opportunity to do it again, what would you change about your approach to Question A and why?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!