Comprehensive test suite created for the Graph Digitizer application, including integration tests for image loading, calibration workflows, and data export functionality.
-
9 Original Test Images (from Julia implementation)
-
BarGraph1.png
-
LineChart1.png, LineChart2.png, LineGraph.png
-
LineGraph_fullquality.jpeg, LineGraph_midquality.jpeg
-
LineGraph.bmp, LineGraph.tiff
-
LineChart3.webp
-
-
7 Edge-Case Test Images (programmatically generated)
-
edge_small_50x50.png- Minimum viable size -
edge_large_4000x3000.png- Large high-resolution image -
edge_tall_100x2000.png- Extreme tall aspect ratio (20:1) -
edge_wide_3000x150.png- Extreme wide aspect ratio (20:1) -
edge_high_dpi_1000x1000.png- High-DPI checkerboard pattern -
edge_square_800x800.png- Perfect square with circular gradient -
edge_single_1x1.png- Single pixel edge case
-
-
Purpose: Parameterized tests for loading all test images
-
Coverage: 16 image formats (PNG, JPEG, BMP, TIFF, WebP)
-
Tests: Verifies image loading, dimensions, error status
-
Status: 13/16 tests passing
Known Issues:
-
TIFF and WebP formats not fully supported by JavaFX Image API
-
Very large images (4000x3000) may hit memory constraints during loading
2. CalibrationIntegrationTest (src/test/java/com/digitizer/integration/CalibrationIntegrationTest.java)
-
Purpose: Tests calibration workflows and coordinate transformations
-
Tests:
-
Simple linear calibration (4-point)
-
Round-trip coordinate transformations (data↔canvas)
-
Uncalibrated state progression
-
Calibration reset behavior
-
-
Status: 4/4 tests passing
-
Purpose: Tests CSV and JSON export functionality
-
Tests:
-
CSV export with multiple datasets
-
JSON export with metadata
-
Empty dataset handling
-
Special character escaping
-
-
Status:
⚠️ 2/4 tests passing (requires calibration setup)
Known Issues:
-
JSON export tests need calibration state initialized before export
-
Requires mock CalibrationState or setup in
@BeforeEach
-
Purpose: Tests all edge-case image scenarios
-
Tests: 9 tests covering extreme dimensions and aspect ratios
-
Status: 9/9 tests passing (with temp file cleanup warning)
Known Issues:
-
Windows file locking causes temp directory cleanup warnings (non-fatal)
-
JavaFX Image objects hold file handles until GC
-
Purpose: Programmatically generate edge-case test images
-
Methods:
-
generateSmallImage(File)- 50x50 gradient -
generateLargeImage(File)- 4000x3000 grid pattern -
generateTallNarrowImage(File)- 100x2000 vertical gradient -
generateWideShortImage(File)- 3000x150 horizontal gradient -
generateHighDPIImage(File)- 1000x1000 checkerboard -
generateSquareImage(File)- 800x800 circular gradient -
generateSinglePixelImage(File)- 1x1 red pixel
-
-
Purpose: Utility test to generate all edge-case images to
src/test/resources/images/ -
Usage:
mvn test -Dtest=GenerateEdgeCaseImages -
Status: Executed successfully, 7 images generated
-
Total Tests: 36
-
Passing: 30
-
Failing: 3 ❌ (image format limitations)
-
Errors: 3
⚠️ (test setup issues)
-
Calibration workflows - All 4 tests passing
-
Edge-case image loading - All 9 tests passing (with cleanup warning)
-
PNG/JPEG/BMP image loading - 13/16 format tests passing
-
CSV export - Basic export tests passing
-
Edge-case image generation - All 7 images generated successfully
-
TIFF Support: JavaFX does not natively support TIFF format
- Workaround: Use external library (e.g., Apache Commons Imaging, TwelveMonkeys ImageIO)
-
WebP Support: JavaFX 21 has limited WebP support
- Workaround: Add WebP ImageIO plugin or upgrade JavaFX version
-
Large Images: Memory constraints for very large images (4000x3000+)
- Workaround: Load with background loading or progressive rendering
-
JSON Export Tests: Require mock
CalibrationStatebefore calling export- Fix: Add
@BeforeEachsetup with calibration initialization
- Fix: Add
-
Temp File Cleanup: Windows file locking prevents immediate cleanup
- Status: Non-fatal warning, files eventually cleaned up by JUnit
-
Fix Export Tests: Add calibration setup to
ExportIntegrationTest -
Add Image Format Support: Integrate TIFF/WebP libraries for full format coverage
-
Optimize Large Image Loading: Implement progressive loading for 4000x3000+ images
-
Add Performance Tests: Measure image loading and export performance
-
Add UI Integration Tests: Test MainWindow, CanvasPanel, ControlPanel interactions
-
Add Snapping Tests: Verify snap-to-X functionality with nearest-neighbor algorithm
-
Add Test Documentation: Document test strategies and edge cases
-
CI/CD Integration: Configure automated test execution in build pipeline
-
Code Coverage: Measure and improve test coverage metrics
mvn test
mvn test -Dtest=ImageLoadingTest
mvn test -Dtest=CalibrationIntegrationTest
mvn test -Dtest=ExportIntegrationTest
mvn test -Dtest=EdgeCaseImageTest
mvn test -Dtest=GenerateEdgeCaseImages
After running tests, view detailed reports in:
target/surefire-reports/
-
JUnit Jupiter 5.9.3 - Core testing framework
-
junit-jupiter-params 5.9.3 - Parameterized tests
-
JavaFX 21 - UI and image loading (via openjfx)
-
19 Test Images (12 original + 7 edge cases)
-
Total Size: ~15 MB (including large 4000x3000 image)
-
Formats Covered: PNG, JPEG, BMP, TIFF, WebP
Created: 2025-11-17
Last Updated: 2025-11-17
Test Coverage: 30/36 tests passing (83% pass rate)