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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started