Skip to main content

Module crossing

Module crossing 

Expand description

crossing analysis — the “X” of Kazman & Cai’s DV8 hotspot patterns (Mo, Cai, Kazman, Xiao 2015 Hotspot Patterns).

A Crossing is a file that is simultaneously a hub and a sink: high fan-in (many files import it) and high fan-out (it imports many), whose changes co-occur with both the files that depend on it (upstream) and the files it depends on (downstream). It is the point where two change-flows cross, coupling its upstream and downstream together through itself — the hardest shape to change safely, because edits ripple in both directions at once.

§Fusion — two graphs CodeLore already builds

  • Structural: the imports table gives, per file, both its importers (in-edges → fan-in) and its imports (out-edges → fan-out).
  • Temporal: coupling::run_coupling Fisher-significant co-change partners.

A crossing co-changes with ≥ 1 importer AND ≥ 1 import — both flows are live, not just structurally present.

§Calibration

Both fan-in and fan-out must reach DEFAULT_MIN_FAN (the “X” needs genuine breadth on both axes), and at least one co-change partner must sit on each side. crossing_score = coupled_upstream + coupled_downstream ranks by how much change actually flows through the crossing in both directions. Accuracy follows the import resolver’s language coverage, same caveat as god_classes fan-in.

Structs§

CrossingRow
One crossing finding.

Constants§

DEFAULT_MIN_FAN
Minimum fan-in and fan-out for a file to count as a structural “X”.

Functions§

run_crossing
Run the crossing analysis. Returns crossings ranked by composite crossing score (highest first).