Quality assurance in machining