A software bug is a problem causing a program to crash or produce invalid output. A bug can be an error which may cause failure or deviation from expected results.
Most bugs are due to human errors in source code or its design. A program is said to be buggy when it contains a large number of bugs, which affect program functionality and cause incorrect results.