Defect density is a measure of the number of defects in a product or system, typically expressed as the number of defects per unit of measurement, such as per line of code, per function point, or per test case. It is used to assess the quality of a product or system, with a lower defect density indicating higher quality. Defect density can be calculated by counting the total number of defects found during testing and dividing it by the size of the product or system being tested.