Commit eee74a1
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 eee74a1
52 files changed
Lines changed: 12875 additions & 279 deletions
File tree
- src
- main/kotlin/cz/vutbr/fit/interlockSim
- context
- gui
- objects
- cells
- tracks
- sim
- util
- 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: 3 additions & 5 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 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
| 171 | + | |
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
| |||
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 | | |
| |||
Lines changed: 78 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
163 | 170 | | |
| 171 | + | |
164 | 172 | | |
165 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
166 | 180 | | |
167 | 181 | | |
168 | 182 | | |
| |||
244 | 258 | | |
245 | 259 | | |
246 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
247 | 324 | | |
248 | 325 | | |
249 | 326 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments