On the design of reliable libraries

Software libraries are an important instrument for achieving reuse of both designs and programs. This goal is supported by several non-functional properties of libraries. Specifically, a library should be flexible by allowing components to be reused in different contexts with possibly changing requirements. However, reuse must not introduce new errors: the library components must remain correct in unknown contexts (robustness). Most common object-oriented libraries focus unilaterally on flexibility, neglecting robustness requirements. This paper investigates the trade-off between flexibility and robustness. We show that the desire for both flexible reuse and robustness can be met. Design patterns is identified as an important tool for structuring large object-oriented class libraries. The concepts discussed in this article have been realized in KARLA, an object-oriented library of algorithms and data structures, that currently contains more than 200 classes, and that is continuously being developed.