Definition of Bug:
Small insect. Also a problem in software.
The part of code that makes the program behave in an unwanted manner. The sooner a bug is detected in the software lifecycle, the lower the cost involved in fixing it.
The term bug came from the fact that a moth flew into an early computer that ran on vacuum tubes.