A mutation is a base change to the code of DNA that can happen either by purpose or by accident. Scientists often induce mutations on purpose to see what effect the change has on a gene's function.