Various apparatus and methods are disclosed for identifying errors in
program code. Respective numbers of observances of at least one
correctness rule by different code instances that relate to the at least
one correctness rule are counted in the program code. Each code instance
has an associated counted number of observances of the correctness rule
by the code instance. Also counted are respective numbers of violations
of the correctness rule by different code instances that relate to the
correctness rule. Each code instance has an associated counted number of
violations of the correctness rule by the code instance. A respective
likelihood of the validity is determined for each code instance as a
function of the counted number of observances and counted number of
violations. The likelihood of validity indicates a relative likelihood
that a related code instance is required to observe the correctness rule.
The violations may be output in order of the likelihood of validity of a
violated correctness rule.