Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7 . Add Tests for matching _ parens The function matching _ parens is new, though it is similar to first _ in _ parens

7. Add Tests for matching_parens
The function matching_parens is new, though it is similar to first_in_parens in several ways. First of all, you should include all combinations of parentheses that you did in your tests for first_in_parens. However, matching_parens 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, matching_parens has a less restrictive precondition, and so it allows possibilities that first_in_parens does not, such as no parentheses or just one half of a pair of parentheses.
Design several test cases for matching_parens and add them to the test procedure tests_matching_parens. You should have at least 7 significantly different tests.
NOTE: You are expected to use the assert_equals, assert_true, assert_false functions from the introcs module to write tests_matching_parens. Do not use any other assert_ function in the Asserting Tests section of the IntroCS documentation. If you use one of the assert_true or assert_false functions, do not include not as part of the argument. For example, you would use assert_true(result) instead of assert_false(not result) or assert_false(result) instead of assert_true(not result).

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions