In the world of software testing the terms bugs, defects and bugs are encountered every second of the day. But to the uninitiated or to a beginner in this field, all these terms may seem synonyms of each other. Therefore, it becomes useful to understand each of these terms individually.
A bug is nothing but a programming error found in an application before it goes into production. It may cause the program to perform irrationally, come up with incorrect responses and then crash all together.
In the simplest of terms, defect is the difference observed between expected behaviour and the actual results which are noted post the event of testing a software. Essentially it marks the deviation of the product's performance from the customer's requirements. It differs from a bug in the fact that a defect is found out after the product goes into production.
An error is a programming mistake, generated due to incorrect loops or wrong syntax. Thus the birth of an error takes place at the time of coding itself. Its chief causes are an inadequate understanding of the internal structure of code, neglect on the part of memory management, etc.