1. A method for modeling a defect management routine in a production process and for handling the defect during the production process based on the defect management routine, both the modeling and the handling being executed within a manufacturing execution system, which comprises the steps of: during an engineering phase, performing the steps of: modeling the production process to create a library of possible defect types which may occur during the production process; assigning the defect types to at least one defect group reresenting a hierarchical clustering to collect different but related defect types; creating a library of defect specifications, each defect specification being linked to the defect types; creating a library of defect type specification details assigning the defect types to a resource-related context; creating at least one runtime defect criteria used to link the defect type to a certain production volume; creating a runtime defect measurement routine monitoring a result of a corrective measure executed after an identification of the defect type; and during a runtime production phase, performing the steps of: evaluating a product produced according to the production process against predetermined quality criteria; identifying, for the product, the respective defect type out of the library of defect types in case of a violation of the predetermined quality criteria; using an identified defect type to: determine and prosecute a corrective measure for the product, determine a runtime defect criteria identifying a resource causing the defect type, determine a production volume possibly affected by the defect type, and run the runtime defect measurement routine in order to identify whether the corrective measures have been successful and whether the product can be re-introduced into a normal workflow.