A defect is an error or a bug, in the application which is created. A programmer while designing and building the software can make mistakes or error. These mistakes or errors mean that there are flaws in the software. These are called defects.
Hence, any deviation from the specification mentioned in the product functional specification document is a defect.
Also see – Failure in software testing