Somatic hypermutation is a cellular mechanism by which the immune system adapts to the new foreign elements that confront it, as seen during class switching. A major component of the process of affinity maturation, SHM diversifies B cell receptors used to recognize foreign elements and allows the immune system to adapt its response to new threats during the lifetime of an organism. Somatic hypermutation involves a programmed process of mutation affecting the variable regions of immunoglobulin genes. Unlike germline mutation, SHM affects only individual immune cells, and the mutations are not transmitted to offspring.