Wrapper function

A wrapper function is a function (another word for a subroutine) in a software library or a computer program whose main purpose is to call a second subroutine[1] or a system call with little or no additional computation.

Wrapper functions simplify writing computer programs by abstracting the details of a subroutine's implementation.

For example, the MouseAdapter and similar classes in the Java AWT library demonstrate this.

A test driver is a kind of wrapper function that exercises a code module, typically calling it repeatedly, with different settings or parameters, in order to rigorously pursue each possible path.

In a programming language that does not support multiple inheritance of base classes, wrapper functions can be used to simulate it.