Commit 1ceed76
Expand test coverage from 45% to 51% across 6 phases (242→662 tests, +420 tests)
This commit concludes a comprehensive test coverage expansion initiative
executed
across 6 phases by multiple agents working in parallel. The project now
achieves
51% code coverage (8,824/17,070 instructions) with 662 total tests (628
passing,
34 skipped).
Coverage by package:
- objects.tracks/: 85% (excellent) - safety-critical track operations
- xml/: 85% (excellent) - XML parsing and validation
- util/: 75% (good) - utility classes and data structures
- objects.cells/: 72% (good) - grid-based spatial representation
- context/: 70% (good) - railway network context management
- objects.paths/: 52% (medium) - route management
- sim/: 33% (limited) - simulation engine (jDisco framework
restrictions)
- Main: 22% (entry point) - CLI (some tests disabled due to System.exit)
- gui/: 0% (deferred) - GUI testing deferred per QA assessment
Phase 1: Safety-critical components (51 tests)
- TrainPhysicsTest, SimpleTrackStateTest, RailSwitchTest,
RailSemaphoreTest
- Validates railway safety properties SI-1, SI-3, SI-5
Phase 2: Simulation engine core (50 tests)
- TrainStateTransitionTest, TrainPathInteractionTest,
InOutWorkerPathHandlingTest
- Validates safety properties SI-1, SI-3, SI-4, SI-6
Phase 3: Path and track integration (54 tests)
- AbstractPathTest, SimpleTrackEnterLeaveTest, PathTrackIntegrationTest
- TrackTestMocks utility infrastructure created
Phase 4: Main entry points and cell edge cases (92 tests)
- MainArgumentParsingTest (28 tests disabled - System.exit issue)
- ExampleLoadingTest, ContextInitializationTest, NodeCellTest
Phase 5: Generator and advanced simulations (76 tests)
- GeneratorTest, ShuntingLoopOperationalTest, TimetableTest, TimeTest
Phase 6: Exception handling and edge cases (156 tests)
- SimulationExceptionTest (51 tests), PathValidationTest (36 tests)
- DeadlockDetectionTest, InvalidNetworkTest, RaceConditionTest
RailSwitch.kt enhancements:
- Added lock/unlock mechanism for safety property SI-5 (prevent
configuration
changes during train movement)
- Enhanced PropertyChangeSupport for observer pattern migration
- Added convenience methods: isNormal(), isReverse(), getConf()
Source files updated for improved testability:
- DefaultContext.kt, Train.kt, Generator.kt, InOutWorker.kt,
SimpleTrack.kt
- Point.kt, RailwayNetGridCanvas.kt
build.gradle.kts:
- Increased test JVM heap: -Xmx1g -Xms512m for large test suite
- Added forkEvery=100 to prevent test executor crashes
- Re-enabled parallel test execution (8 cores: 2x speedup)
- Migrated from AssertJ to AssertK 0.28.1 (Kotlin-native assertions)
- All 662 tests use AssertK with fluent Kotlin syntax
- Custom AssertKExtensions for railway domain assertions
Test files created by parallel agent coordination:
- kotlin-junior-dev: 15+ test files
- kotlin-railway-dev: 7+ test files (domain expertise)
- java-junior-developer: 10+ test files
- Total: 22 new test files + 24 enhanced existing files
CLAUDE.md:
- Updated Testing section with comprehensive phase breakdown
- Added coverage statistics and package-level metrics
- Documented 36 test classes across all phases
README.md:
- Updated test statistics (242→662 tests)
- Added coverage achievements by package
- Summarized 6-phase expansion initiative
MainArgumentParsingTest (28 tests disabled):
- Main.createContext() calls System.exit(1), killing test JVM
- Tests preserved for future re-enablement after Main refactoring
- 662 tests total (628 passing, 34 skipped, 0 failing)
- 94.9% pass rate
- 51% instruction coverage (+6pp from 45% baseline)
- Zero build failures after bugfix phase
- Parallel execution enabled (8-10s vs 18-20s serial)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent cb60631 commit 1ceed76
55 files changed
Lines changed: 12909 additions & 286 deletions
File tree
- src
- main/kotlin/cz/vutbr/fit/interlockSim
- context
- gui
- objects
- cells
- tracks
- sim
- util
- xml
- test/kotlin/cz/vutbr/fit/interlockSim
- context
- objects
- cells
- paths
- tracks
- sim
- testutil
- util
- xml
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
| |||
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
479 | | - | |
| 481 | + | |
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | | - | |
| 486 | + | |
485 | 487 | | |
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
492 | | - | |
493 | | - | |
494 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
498 | | - | |
| 500 | + | |
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | 504 | | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
506 | | - | |
| 508 | + | |
507 | 509 | | |
508 | 510 | | |
509 | | - | |
| 511 | + | |
510 | 512 | | |
511 | 513 | | |
512 | 514 | | |
513 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
514 | 547 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 548 | + | |
521 | 549 | | |
522 | | - | |
523 | | - | |
524 | | - | |
| 550 | + | |
525 | 551 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
| 552 | + | |
530 | 553 | | |
531 | | - | |
532 | | - | |
| 554 | + | |
533 | 555 | | |
534 | 556 | | |
535 | | - | |
| 557 | + | |
536 | 558 | | |
537 | 559 | | |
538 | 560 | | |
| 561 | + | |
| 562 | + | |
539 | 563 | | |
540 | 564 | | |
541 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
427 | 440 | | |
428 | 441 | | |
429 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | | - | |
172 | | - | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| 503 | + | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
514 | 516 | | |
515 | 517 | | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
519 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
| |||
547 | 553 | | |
548 | 554 | | |
549 | 555 | | |
| 556 | + | |
550 | 557 | | |
551 | 558 | | |
552 | 559 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | | - | |
| 321 | + | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
0 commit comments