Testing Object Interactions

Testing Collection Classes

Collection classes are tested using techniques for primitive classes (see Chapter 5). A test driver will create instances[3] that are passed as parameters in messages to a collection being tested. Test cases center primarily around ensuring that those instances are correctly incorporated into and removed from the collection. Some test cases address any limitations placed on the capacity of the collection. The precise class of each of the objects used in testing a collection class is insignificant in determining the correct operation of the collection class since there is no interaction between a collection instance and the objects in a collection. If forty or fifty items might be added to ...

Get A Practical Guide to Testing Object-Oriented Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.