Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7 . Add Tests for matching _ parens The function matching _ parens is new, though it is similar to first _ in _ parens
Add Tests for matchingparens
The function matchingparens is new, though it is similar to firstinparens in several ways. First of all, you should include all combinations of parentheses that you did in your tests for firstinparens. However, matchingparens does not care about what is inside a pair of parentheses, so a test A C with nothing inside parentheses is the same as a test A B C In addition, matchingparens has a less restrictive precondition, and so it allows possibilities that firstinparens does not, such as no parentheses or just one half of a pair of parentheses.
Design several test cases for matchingparens and add them to the test procedure testsmatchingparens. You should have at least significantly different tests.
NOTE: You are expected to use the assertequals, asserttrue, assertfalse functions from the introcs module to write testsmatchingparens. Do not use any other assert function in the Asserting Tests section of the IntroCS documentation. If you use one of the asserttrue or assertfalse functions, do not include not as part of the argument. For example, you would use asserttrueresult instead of assertfalsenot result or assertfalseresult instead of asserttruenot result
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