BUG : It occurs on development side (when Compile time or Runtime )ERROR : The Test Engineer check the application and if he find the conflict, it is known as Error.DEFECT : It founds on UAT side..
Bug is the problem found at the developers site.
When the developer doesnot correct/found it and reached to the tester and tester reports it it becomes error.
And if it has reached to the customer and customer find it , then it becomes defect.
Error : It is the Deviation from actual and the expected value.