1. An apparatus for detecting an error, the apparatus comprising: a measuring unit configured to measure a deterministic progress index (DPI) and a program counter (PC) value when an instruction is executed; a setting unit configured to set, as a verification set, a DPI and a PC value measured when the instruction is executed without an error; and a detector to set, as a measurement set, the DPI and the PC value measured by the measuring unit, and to detect a runtime error of the instruction by comparing the measurement set to the verification set.