Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code should be in Python Write unittests for search and match functions written in class. `Empty string as a query Empty document collection Tests

The code should be in Python

Write unittests for search and match functions written in class.

`Empty string as a query

Empty document collection

Tests that differentiate string matching and Boolean term matching (i.e. the same inputs should return different outputs for different matching functions).

Test where string matching returns True, but you would not expect search to return the document.

More specifically, for search, you already have a test that includes both matching and non-matching documents. You should add

A test with an empty query

A test with an empty document list

For string_match, you already have a test for a match case, non-match case, and a partial word match case. You should add

A test with an empty query

A test with an empty document list

A test with a document matching a multi-word query

A test of string_match with a query-document pair where boolean_term_match function would return True, but string_match returns False

For boolean_term_match you should add tests for all the same inputs as you'll have for string_match (7 test functions).

In total you need to add 13 test cases (test functions) across all 3 functions under test (search, string_match, and boolean_term_match).

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

What is b if (log b' x)= 1/3x?

Answered: 1 week ago

Question

a sin(2x) x Let f(x)=2x+1 In(be)

Answered: 1 week ago