Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: Python 3.6.1 Interpreter: Anaconda 3.6.4 --- Program used: PyCharm --- Starter code: Shown below image --- --- def merge(listA, listB): ''' Given 2 lists

Language: Python 3.6.1

Interpreter: Anaconda 3.6.4

--- Program used: PyCharm --- Starter code: Shown below image ---

image text in transcribedimage text in transcribed

---

def merge(listA, listB): ''' Given 2 lists whose elements are in increasing order, merge them into one list of elements in increasing order :param listA: a list in increasing order :param listB: a list in increasing order :return: a list with all elements in increasing order ''' result = [] indexA = 0 indexB = 0

while indexA

# add the remaining elements if indexA

return result

Question 3 (9 points): Purpose: More practice writing test-cases and implementing test-drivers. Degree of Difficulty: Moderate In the document auqa uncsioas.py you'lfind the function . zege: Given 2 lists whose elements are in increasing crder, merge them into one list of elements in increasing order The code is below. The idea is to step through both lists one element at a time. Compare two elements one from each ist, and put the smaller into the morged ist. If you reach the end of othor list, add the rest of the other list to the end of the merged result :parax istB! a 11et 1n increasing order irosurn: 11st with all eI4nanta 1n increasing order resuls-D put the 5seller elenent in the result result.appeadcitiadexA]) index This function contains crrors Yourtask wil bo to find tho orrors using tosting, Youl hand in an cxplanation of what the errors are, and how you fixed them, but you will not hand in the corrected code. 1 Wrte white-box and black-box tests for the function er You should do this without Python, either on paper. or in a simple document Don't wory about running your tests untl you have thought about which tests you want Mako sure you have at least 3 black-bax tests, and 3 white-box tests, as a minimum More tests may be useful 2. Implement your test cases ina documentnamed aBq3 teting.py. Youcanuse either plainif-statements tas demonstrated in readings 1524 ora ist-of-dictionaries to implement your test driver (es demon- strated in class during chapter 15 exercise 31 3 Run your tests, and copy/paste the console output to a document named 888 outpt The console output you hand in should come from the program before you try to fx i 4 Try to deduce the problems with the nerg) function from the output of your testing. Then fx the emors in the function so that your test driver doos not indicate any faults

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

NMR Need help finding corrext structure

Answered: 1 week ago