Coq specification and executable functions for change impact analysis, as used in build systems and tools for regression test selection.
- Author(s):
- Cyril Cohen
- Aleksandar Nanevski
- Karl Palmskog
- Laurent Théry
- License: MIT license
- Compatible Coq versions: 8.13 or later
- Additional dependencies:
- Coq namespace:
chip
- Related publication(s):
Make sure the Coq requirements are installed, then run:
git clone https://github.com/palmskog/chip.git
cd chip
make # or make -j <number-of-cores-on-your-machine>
The executable tools have the following additional OCaml requirements:
After installing the Coq requirements, install the OCaml requirements:
opam install ocamlbuild yojson extlib
To build the regular tool, run:
make impacted
To try plain change impact analysis, go to extraction/impacted
and run:
./filtering.native test/new.json test/old.json
To try hierarchical change impact analysis, run:
./hierarchical.native test/new-hierarchical.json test/old-hierarchical.json
To try topological sorting, run:
./topfiltering.native test/new-topsort.json test/old-topsort.json
To build the optimized tool:
make impacted-rbt
and look in extraction/impacted-rbt
. The programs and command-line
options are the same as above.
Coq files adapted and extended from work by Cohen and Théry:
core/extra.v
: auxiliary sequence lemmascore/connect.v
: auxiliary connect and topological sort definitions and lemmascore/kosaraju.v
: implementation and correctness proof of Kosaraju's strongly connected components algorithmcore/tarjan.v
: implementation and correctness proof of Tarjan's strongly connected components algorithm
Coq file adapted from work by Nanevski:
core/ordtype.v
: ordered type definition for the Mathematical Components library
Coq core definitions and lemmas:
core/closure.v
: basic definition of transitive closures of setscore/check.v
: set-based definitions of dependency graphs, impactedness, and freshnesscore/change.v
: correctness argument for basic change impact analysis definitionscore/hierarchical.v
: overapproximation strategy for change impact analysis in hierarchical systemscore/hierarchical_correct.v
: correctness proofs for overapproximation strategycore/hierarchical_sub.v
: compositional strategy for change impact analysis in hierarchical systemscore/hierarchical_sub_correct.v
: correctness proofs for compositional strategycore/hierarchical_sub_pt.v
: improved hierarchical compositional strategy using partition of new verticescore/hierarchical_sub_pt_correct.v
: correctness proofs for improved compositional strategycore/acyclic.v
: definition of and basic lemmas for acyclicity, parameterized acyclicity checkercore/kosaraju_acyclic.v
: acyclicity checking based on Kosaraju's algorithmcore/tarjan_acyclic.v
: acyclicity checking based on Tarjan's algorithmcore/topos.v
: definitions and lemmas on topological sorting of acyclic graphs
Coq implementation-related definitions and lemmas:
core/close_dfs.v
: refined sequence-based transitive closure computationcore/dfs_set.v
: refined transitive closure computation using MSet functor (to enable red-black trees)core/check_seq.v
: sequence-based change impact analysis definitions, optimized topological sorting using impact analysiscore/check_seq_hierarchical.v
: sequence-based hierarchical change impact analysis definitionscore/finn.v
: regular instantiation of sequence-based definitions for the ordinal finite typecore/finn_set.v
: red-black tree instantiation of sequence-based definitions for the ordinal finite type
Key OCaml files for regular tool:
extraction/impacted/ocaml/change_impact.mli
: interface to extracted codeextraction/impacted/ocaml/change_impact.ml
: mapping to extracted functionsextraction/impacted/ocaml/filtering.ml
: program for plain change impact analysisextraction/impacted/ocaml/topfiltering.ml
: program for topological sortingextraction/impacted/ocaml/hierarchical.ml
: program for two-level hierarchical change impact analysisextraction/impacted/ocaml/util.ml
: utility functions
Key OCaml files for optimized tool:
extraction/impacted-rbt/ocaml/change_impact.mli
: interface to extracted codeextraction/impacted-rbt/ocaml/change_impact.ml
: mapping to extracted functionsextraction/impacted-rbt/ocaml/filtering.ml
: program for plain change impact analysisextraction/impacted-rbt/ocaml/topfiltering.ml
: program for topological sortingextraction/impacted-rbt/ocaml/hierarchical.ml
: program for two-level hierarchical change impact analysisextraction/impacted-rbt/ocaml/util.ml
: utility functions