The following JUnit test method purports to test the add() method from BasicCollection. Assume the setUp() method from BasicCollectionTester is used. Are there problems?

```
public void testAdd() {
assertTrue( c.isEmpty() );
assertTrue ( c.contains(“B”) );
assertTrue ( c.contains(“C “) );
assertTrue ( c.contains(“A”) );
assertEquals( c.contains(“Missing”), false );
}

```


The first test will not pass because there are 3 elements in the collection from the setup() method in BasicCollectionTester. Therefore, the testAdd() method is not relevant to evaluate the correctness of add(). Removing the first assertTrue(), we will be able to use the testAdd() method as intended.

Computer Science & Information Technology

You might also like to view...

Which answer below is the final step in the formal acceptance activity for an ICT product?

A. Extensive testing B. Quality assurance C. Closure D. Performance review

Computer Science & Information Technology

Suppose we are given an STL vector container named vec that holds values of type double. What do each of vec[0], vec.front(), *(vec.begin()), *(vec.end() – vec.size())and *(vec.rend()-1) mean?

What will be an ideal response?

Computer Science & Information Technology

________ are raw facts

A) Objects B) Data C) Queries D) Information

Computer Science & Information Technology

To help add interactivity to your buttons, Flash uses a(n) ____________________ language to interpret and execute user actions.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology