compartia / atom-kt-advance

MIT License
0 stars 0 forks source link

Invalidating changed source code results #4

Open ghost opened 8 years ago

ghost commented 8 years ago

If a user edits a C source file after its KT Advance analysis was completed, then the previous Advance results may no longer be accurate. There are some sophisticated parsing algorithms we might apply later to determine whether the analysis remains accurate after a change. Until then, perhaps we can apply a simple default rule that any change to a function automatically invalidates all previous analysis results associated with that function (INV, PPO, PEV, SPO, SEV, API).

How best to show previous results invalidated? I don't know. Can these be tagged somehow as dirty to indicate the analysis for that function must be re-performed? We don't want necessarily to remove the results altogether because the user might parse for himself whether it remains valid. Moreover we might track statistics on file/program dirty result counts.

ghost commented 8 years ago

Looking very far ahead, one idea for achieving sophisticated analysis of source code changes is to embed a C compiler front-end as a plugin. KT uses CIL as its Advance analyzer front-end. We in Palo Alto discussed the viability of using CIL in Atom to do this results invalidation task, concluding it "might" be possible. The CIL-produced abstract syntax tree (AST) would be the basis for comparison of before-after differences in source changes and might be passed to the analyzer as a "difference" indication. It is fast enough to do this without having to run the static analyzer, which could require more time and would have to run CIL anyway.

CIL is open source. It is written in OCaml and would have to be built for the user's platform and then wrapped in an Atom plugin somehow. I don't know if any sand-boxing allows local platform reference.

CIL Repository CIL Manual

The CIL source is mature, but lightly maintained by Gabriel Kerneis in Paris.

Gabriel Kerneis

compartia commented 7 years ago

With current implementation, all file-related issues are marked as 'obsolete' in case file changed.

screen shot 2016-11-09 at 11 28 09
ghost commented 7 years ago

Your idea to use strike-out text on the labels is clever and effective. I also like the obsolete tag.