tests: add tests for Alpha, Fuzzy, Petri net conversion and UI flows #57

Open
opened 2026-10-06 13:54:21 +00:00 by ffrauenberger · 1 comment
Owner

Severity: improvement (medium: the untested paths hold several of the bugs found)

Where

  • app/mining_algorithms/alpha_mining.py — no tests
  • app/mining_algorithms/fuzzy_mining.py — no tests
  • app/converters/petri_net_converter.py, app/graphs/petri_net.py — no conversion or token-game tests
  • app/converters/dfg_converter.py — no tests
  • app/graphs/visualization/ — no label-escaping tests
  • app/ui/ — no controller or view tests

Problem

There are no tests for:

Area Files Bugs that tests would have caught
Alpha Miner mining_algorithms/alpha_mining.py #15, #37
Fuzzy Miner mining_algorithms/fuzzy_mining.py #5, #6, #16
Petri-net conversion and token game converters/petri_net_converter.py, graphs/petri_net.py #4 (genetic_mining_test.py exercises simulate_trace only indirectly and asserts only the graph type; the process-tree → Petri-net conversion used by Inductive/IMf is never tested)
DFG converter converters/dfg_converter.py #7
Visualization label escaping graphs/visualization/* #2
CSV import with real-world timestamps transformations, io_operations #1 (existing tests only use ISO dates or integers)
Controllers and views app/ui/** #8, #9, #12, #21

threshold_bug_test.py and threshold_filtering_test.py exist, but no test exercises _sync_thresholds together with the SPM filter (#11).

Overlaps with upstream GitHub issue SWISDATA/processintel#3 Improve and Extend Test Coverage for Process Mining Algorithms.

Fix

  • Unit tests per miner using the logs in tests/testcsv
  • A soundness test: convert process trees to Petri nets and replay the traces they generate; all must complete. Use a strict reachability check, not simulate_trace (it rejects valid traces, see #4)
  • "Hostile name" fixtures (Start, End, R&D, a<b, x:y, Pay/Pay Invoice, tau) that run through every miner and render with dot
  • Streamlit AppTest (streamlit.testing.v1) tests for the flow Home → Column Selection → Algorithm → Export

from issues/TEST-002-missing-test-coverage-for-critical-paths.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** improvement (medium: the untested paths hold several of the bugs found) ## Where - `app/mining_algorithms/alpha_mining.py` — no tests - `app/mining_algorithms/fuzzy_mining.py` — no tests - `app/converters/petri_net_converter.py`, `app/graphs/petri_net.py` — no conversion or token-game tests - `app/converters/dfg_converter.py` — no tests - `app/graphs/visualization/` — no label-escaping tests - `app/ui/` — no controller or view tests ## Problem There are no tests for: | Area | Files | Bugs that tests would have caught | |---|---|---| | Alpha Miner | `mining_algorithms/alpha_mining.py` | #15, #37 | | Fuzzy Miner | `mining_algorithms/fuzzy_mining.py` | #5, #6, #16 | | Petri-net conversion and token game | `converters/petri_net_converter.py`, `graphs/petri_net.py` | #4 (`genetic_mining_test.py` exercises `simulate_trace` only indirectly and asserts only the graph type; the process-tree → Petri-net conversion used by Inductive/IMf is never tested) | | DFG converter | `converters/dfg_converter.py` | #7 | | Visualization label escaping | `graphs/visualization/*` | #2 | | CSV import with real-world timestamps | `transformations`, `io_operations` | #1 (existing tests only use ISO dates or integers) | | Controllers and views | `app/ui/**` | #8, #9, #12, #21 | `threshold_bug_test.py` and `threshold_filtering_test.py` exist, but no test exercises `_sync_thresholds` together with the SPM filter (#11). Overlaps with upstream GitHub issue [SWISDATA/processintel#3](https://github.com/SWISDATA/processintel/issues/3) *Improve and Extend Test Coverage for Process Mining Algorithms*. ## Fix - Unit tests per miner using the logs in `tests/testcsv` - A soundness test: convert process trees to Petri nets and replay the traces they generate; all must complete. Use a strict reachability check, not `simulate_trace` (it rejects valid traces, see #4) - "Hostile name" fixtures (`Start`, `End`, `R&D`, `a<b`, `x:y`, `Pay`/`Pay Invoice`, `tau`) that run through every miner and render with `dot` - Streamlit `AppTest` (`streamlit.testing.v1`) tests for the flow Home → Column Selection → Algorithm → Export --- from `issues/TEST-002-missing-test-coverage-for-critical-paths.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

Reviewed by Codex (GPT-6) against origin/main 6bcc646eb464.

Review: partially correct.

The Alpha/Fuzzy/controller and inductive process-tree conversion gaps are supported, but the token-game coverage statement is incorrect. genetic_mining_test.py has dedicated token-game tests for completion, deadlocks, filtered traces, length-one and length-two loops, and further branching examples. They assert parsed counts and completion/deadlock outcomes, not merely the graph type. I ran four focused token-game tests successfully, alongside the six transformation tests.

The accurate gap is absence of independent strict reachability/soundness tests for build_inductive_graph() and its XOR conversion, plus possible limitations in using the existing replay implementation as its own oracle. Do not describe the repository as having no token-game tests.

Code references: tests/mining_algorithms/genetic_mining_test.py:103, tests/mining_algorithms/genetic_mining_test.py:171, tests/mining_algorithms/genetic_mining_test.py:322.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: partially correct.** The Alpha/Fuzzy/controller and inductive process-tree conversion gaps are supported, but the token-game coverage statement is incorrect. `genetic_mining_test.py` has dedicated token-game tests for completion, deadlocks, filtered traces, length-one and length-two loops, and further branching examples. They assert parsed counts and completion/deadlock outcomes, not merely the graph type. I ran four focused token-game tests successfully, alongside the six transformation tests. The accurate gap is absence of independent strict reachability/soundness tests for `build_inductive_graph()` and its XOR conversion, plus possible limitations in using the existing replay implementation as its own oracle. Do not describe the repository as having no token-game tests. Code references: [tests/mining_algorithms/genetic_mining_test.py:103](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/tests/mining_algorithms/genetic_mining_test.py#L103), [tests/mining_algorithms/genetic_mining_test.py:171](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/tests/mining_algorithms/genetic_mining_test.py#L171), [tests/mining_algorithms/genetic_mining_test.py:322](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/tests/mining_algorithms/genetic_mining_test.py#L322).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#57
No description provided.