
Given a language's semantics, inputs, and environment, we can describe execution as a series of state changes. Code also carries human context in names, commits, and logs. A denied request might be a rule working as intended or a condition written backward. Distinguishing them requires relating the observed behavior to a specification.
1. Choose what an analysis can cover
A test runs particular inputs and uses an oracle to judge the behavior. Static analysis infers possible behavior from code. Verification expresses the relation between a specification and implementation as proof obligations. Rice's theorem rules out a total decision procedure for any nontrivial semantic property of the functions computed by general programs. Practical tools restrict the language, property, or environment, use approximations, or allow an unknown result.
Type checking rules out operations forbidden by the type system. A linter flags syntax patterns and violations of configured rules. Abstract interpretation replaces concrete states with computable summaries such as integer intervals. A sound overapproximation can show that a dangerous state is absent. It can also report a state that no concrete execution reaches.
2. Read the evidence a tool leaves
Fuzzing searches for interesting inputs. A sanitizer can make a memory violation visible when the generated input triggers it. Property-based testing samples from a generator and checks a property such as a successful encoding and decoding round trip. Shrinking takes a failing sample and searches for a smaller case that keeps failing.
Differential testing compares implementations on common inputs. A mismatch still needs to be traced back to the specification. Metamorphic testing checks whether transforming an input changes its output in the expected way, which helps when individual expected outputs are hard to compute. A model checker may report a counterexample trace. Symbolic execution may give an input for a selected path. A proof assistant can identify an outstanding obligation. Each result supports a different investigation.
3. Turn a suspicion about intent into an experiment
Two location and age predicates can both typecheck. One admits visitors abroad who are at least eighteen. The other admits visitors inside the country who are at most eighteen. A function name about viewing eligibility explains why the comparisons deserve attention. The actual policy has to come from the requirements.
A model can select cases on either side of the age threshold and run them for different locations, recording the admissions and rejections. Reviewers can then discuss a repeatable set of behaviors and compare it with the stated policy. The strength of this informal verification rests on the cases selected, the evidence captured, and the authority of the requirements.
4. Give the investigation reliable mechanisms
An agent can decide which request to trace, which inputs to try, and how to organize a debugging view. The underlying tools must execute, observe, and replay behavior reliably. Patterns mined from logs can surface unusual sequences for investigation. A rare sequence can be legitimate, and a widespread sequence can reflect a shared defect.
A task-specific view can show relevant objects and state changes, with the original records available for inspection. Some documentation can be derived from code. The rationale behind a requirement or a rejected design choice generally has to be recorded separately. A reproduction script or query built for one investigation can become infrastructure for the next.
A passing patch shows that the exercised cases now work. A series of special cases can still make later changes spread across more modules. Trying a plausible follow-up requirement on an isolated branch can expose which interfaces move, which assumptions break, and which checks need to be repeated. That experiment gives reviewers concrete evidence about the cost of evolving the design.
