A form of type polymorphism, often used to replace methods, classes, attributes, or functions at runtime.

History

Originated from “guerrilla patch”, referred to changing code sneakily at runtime. The word “guerrilla” is homophonous with “gorilla”, became monkey.

Use cases

useful for stubbing out a function during testing, modifying or extending the behavior of a third-party product without maintaining a private copy of the source code, or applying the result of a patch at runtime to the state in memory, instead of the source code on disk.