Testing Plan for dvi3v project
v3.9.2.208
Table of Contents
- 1. Introduction
- 2. Test Categories
- 2.1. Category 1: Baseline Validation Tests
- 2.2. Category 2: Material and Contrast Tests
- 2.3. Category 3: Shape Complexity Tests
- 2.4. Category 4: Size Range Tests
- 2.5. Category 5: Positioning Tests
- 2.6. Category 6: Lighting Condition Tests
- 2.7. Category 7: A4 Reference Detection Tests
- 2.8. Category 8: Edge Cases and Failure Modes
- 2.9. Category 9: Software Option Tests
- 2.10. Category 10: Real-World Object Tests
- 3. Test Execution Plan
- 4. Test Documentation Requirements
- 5. Test Equipment and Materials
- 6. Quality Metrics
- 7. Automated Testing Strategy
- 8. Expected Outcomes
- 9. Risk Assessment
- 10. Conclusion
1. Introduction
1.1. Purpose
This document defines a comprehensive testing plan for the dvi3v
system (jig + software) to validate functionality, identify edge cases,
and establish quality baselines.
1.2. Scope
- Hardware jig validation
- Software object extraction accuracy
- Scale detection reliability
- Edge case handling
- Quality metrics establishment
1.3. Success Criteria
- 95% successful extraction for standard objects
- Scale accuracy within ±2% for A4 reference
- Graceful degradation for edge cases
- Clear error messages for failures
2. Test Categories
2.1. Category 1: Baseline Validation Tests
2.1.1. Purpose
Establish system works correctly under ideal conditions.
2.1.2. Test Objects
Simple Geometric Shapes
- Black circle (25mm, 50mm, 75mm diameter)
- Black square (25mm, 50mm, 75mm sides)
- Black rectangle (50mm × 100mm)
- Black triangle (equilateral, 80mm sides)
Why: Known dimensions for accuracy validation Expected: ±1mm accuracy, clean contours
Reference Standards
- Printed reference card with known dimensions
- Calibration target (checkerboard pattern)
Why: Establish baseline measurement accuracy Expected: Exact dimensional match
2.1.3. Validation Method
- Measure physical objects with calipers (±0.1mm)
- Compare SVG dimensions with physical measurements
- Calculate error percentage
- Document scale detection method (A4 vs base-feet when implemented)
2.1.4. Success Metrics
- Dimensional error < 2% for all baseline objects
- Contour completeness 100% (no gaps)
- Consistent scale detection across multiple captures
2.2. Category 2: Material and Contrast Tests
2.2.1. Purpose
Test detection across different materials and contrast levels.
2.2.2. Test Objects by Material
Matte Materials
- Matte black paper cutout
- Matte colored paper (red, blue, green)
- Cardboard (brown)
Why: No reflections, ideal for detection Expected: Near-perfect extraction
Glossy Materials
- Glossy black paper
- Laminated card
- Photo print
Why: Reflections may confuse edge detection Expected: May need lighting adjustment or threshold tuning
Textured Materials
- Fabric swatch
- Textured cardboard
- Cork
Why: Texture may create noise in binary threshold Expected: May need morphological operation tuning
Transparent/Translucent
- Clear plastic shape
- Frosted plastic
- Colored acetate
Why: Edge case - minimal contrast Expected: Likely to fail, documents limitations
Metallic/Reflective
- Aluminum cutout
- Copper shape
- Chrome-plated object
Why: Specular reflections, extreme edge case Expected: High failure rate, documents limitations
2.2.3. Test Matrix
| Material Type | Black | White | Red | Blue | Green | Yellow |
|---|---|---|---|---|---|---|
| Matte paper | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Glossy paper | ✓ | - | ✓ | - | - | - |
| Textured | ✓ | - | - | - | - | - |
| Transparent | - | - | ✓ | ✓ | - | - |
| Metallic | - | ✓ | - | - | - | - |
✓ = Required test, - = Optional
2.2.4. Validation Method
- Document threshold value needed for successful extraction
- Note any preprocessing required (lighting adjustment)
- Measure extraction quality score
- Photograph failure cases for documentation
2.3. Category 3: Shape Complexity Tests
2.3.1. Purpose
Validate handling of increasingly complex shapes.
2.3.2. Test Objects (Ordered by Complexity)
Level 1 - Convex Shapes (No Holes)
- Circle, square, triangle (already in baseline)
- Ellipse
- Pentagon, hexagon, octagon
- Smooth organic shape (leaf outline)
Expected: Perfect extraction
Level 2 - Concave Shapes
- Star shape (5-pointed)
- Crescent moon
- Hand silhouette
- Letter shapes (C, G, S)
Expected: Good extraction, may need contour simplification
Level 3 - Shapes with Holes
- Ring (donut shape)
- Letter O, B, P, A
- Picture frame shape
- Swiss cheese pattern (multiple holes)
Expected: Requires
--no-holesflag testing Critical: Known issue to validate fix forLevel 4 - Thin Features
- Scissors (thin blades)
- Key (thin shaft)
- Fork/spoon (tines/handle)
- Wire frame object
Expected: Thin features may disappear with threshold Test: Threshold sensitivity
Level 5 - High Detail
- Gear (teeth)
- Snowflake pattern
- Lace doily
- Circuit board outline
Expected: Detail loss at coarse threshold Test: Auto-threshold feature
2.3.3. Complexity Metrics
- Perimeter-to-area ratio
- Number of concave vertices
- Number of holes
- Minimum feature width
- Contour point count in SVG
2.3.4. Validation Method
- Visual inspection of SVG overlay on original photo
- Measure detail preservation percentage
- Test different threshold values (manual and auto)
- Document optimal threshold range per complexity level
2.4. Category 4: Size Range Tests
2.4.1. Purpose
Establish minimum and maximum object size limits.
2.4.2. Test Objects
Minimum Size Tests
- 10mm × 10mm square
- 15mm × 15mm square
- 20mm × 20mm square
- 5mm diameter circle
- 10mm diameter circle
Why: Find lower detection limit Expected: Below certain size, lost in noise or margin
Maximum Size Tests
- 180mm × 250mm rectangle (nearly full A4)
- Object extending to paper edges
- Object larger than paper (partially off-frame)
Why: Test margin handling and cropping Expected: Margin settings become critical
Aspect Ratio Extremes
- 200mm × 10mm strip (20:1 ratio)
- 10mm × 200mm strip (1:20 ratio)
- Very elongated ellipse
Why: Test bounding box calculation Expected: Should handle well but may challenge auto-cropping
2.4.3. Validation Method
- Binary search for minimum detectable size
- Test with different margin settings (0mm, 2mm, 5mm)
- Document size limits in documentation
- Verify no clipping at maximum sizes
2.5. Category 5: Positioning Tests
2.5.1. Purpose
Validate center-priority detection algorithm.
2.5.2. Test Scenarios
Center Position (Baseline)
- Object exactly centered on A4
Expected: Always selected correctly
Off-Center Positions
- 25mm from center (4 directions: N, S, E, W)
- 50mm from center
- 75mm from center
- Near edge of A4 (10mm margin)
Expected: Should still detect if within reasonable distance
Multiple Objects Test
- Two identical objects: one centered, one at edge
- Three objects: small centered, large at edges
- Multiple small objects scattered
Expected: Center object selected Validation: Confirms center-priority algorithm
Rotated Placement
- Object rotated 45°, 90°, 180°
Why: Ensure rotation doesn't affect detection Expected: No impact on detection
2.5.3. Validation Method
- Photograph grid positions (3×3 grid on A4)
- Test each grid position
- Document detection success rate vs. distance from center
- Create heat map of detection reliability
2.6. Category 6: Lighting Condition Tests
2.6.1. Purpose
Establish lighting requirements and robustness.
2.6.2. Test Conditions
Uniform Lighting (Baseline)
- Diffuse overhead light
- Shadowless, even illumination
Expected: Ideal conditions, 100% success
Directional Lighting
- Single light source from left
- Single light source from above
- Creates shadow on one side
Expected: Shadow may be detected as part of object Test: Shadow impact on dimensions
High Contrast Lighting
- Direct sunlight
- Very bright studio lights
Expected: May cause overexposure or harsh shadows Test: Threshold adjustment needed
Low Light
- Dim indoor lighting
- Evening/twilight conditions
Expected: Reduced contrast, may need exposure adjustment Test: Camera exposure compensation needed
Mixed Color Temperature
- Daylight + incandescent
- Fluorescent + LED
Expected: Color cast may affect colored object detection Test: Impact on threshold for colored objects
2.6.3. Measurement
- Use light meter if available
- Document lux levels
- Photograph test setup showing lighting
- Record camera exposure settings (ISO, shutter, aperture if DSLR)
2.6.4. Validation Method
- Test same object under different lighting
- Compare threshold values required
- Measure dimensional accuracy variance
- Document acceptable lighting ranges
2.7. Category 7: A4 Reference Detection Tests
2.7.1. Purpose
Validate scale detection reliability.
2.7.2. Test Scenarios
Optimal A4 Placement
- A4 fully visible, flat, parallel to camera
Expected: 100% detection, accurate scale
Partial A4 Obscuration
- Object covering corner of A4
- Object covering 25% of A4
- Object covering 50% of A4
Expected: Detection fails above certain threshold Test: Find maximum acceptable obscuration
A4 Variations
- White A4 (standard)
- Colored A4 (blue, as in WhatTheCameraSees.jpeg)
- Grid-printed A4
- Textured A4
Expected: Color shouldn't matter if high contrast with base Test: Validate
--paper-coloroptionNon-A4 Papers
- A3 paper (297mm × 420mm)
- A5 paper (148mm × 210mm)
- Letter paper (216mm × 279mm)
Expected: Requires
--paper-formatoption Test: Validate other ISO formatsNo Reference Paper
- Object alone on base (no A4)
- Using
--reference-mmmanual override
Expected: Falls back to estimation or manual scale Test: Accuracy with manual reference
2.7.3. Validation Method
- Measure A4 detection success rate
- Compare scale accuracy: A4 detected vs. estimated
- Test all supported paper formats
- Document when manual override is necessary
2.8. Category 8: Edge Cases and Failure Modes
2.8.1. Purpose
Document system limitations and error handling.
2.8.2. Edge Cases to Test
Extremely Low Contrast
- Gray object on gray background
- White object on white paper
Expected: Detection fails Validation: Error message is clear
Object Color Same as Base Feet
- Red object on red base feet
Expected: May confuse detection Test: Base-feet detection impact
Highly Irregular Shapes
- Crumpled paper ball (3D object)
- Tangled string/wire
- Natural twig/branch
Expected: 2D projection may not match expectations Validation: Document as out-of-scope for 3D objects
Transparent Objects with Opaque Features
- Clear ruler with black markings
- Transparent protractor
Expected: Only opaque parts detected Test: Partial extraction behavior
Motion Blur
- Intentionally defocused image
- Camera shake simulation
Expected: Fuzzy edges degrade quality Test: Quality metric correlation
Multiple Overlapping Objects
- Two objects touching
- One object partially behind another
Expected: Detected as single merged object Validation: Document requirement for object separation
2.8.3. Validation Method
- Photograph each edge case
- Document error messages or failure modes
- Categorize: "Works with adjustment", "Acceptable degradation", "Documented limitation"
- Update documentation with limitations
2.9. Category 9: Software Option Tests
2.9.1. Purpose
Validate all command-line options work correctly.
2.9.2. Options to Test Systematically
- Color Options (
-c, --color)- All named colors (black, red, blue, etc.)
- Hex colors (#FF0000, #00FF00, etc.)
- Invalid colors (error handling)
- Margin Options (
-m, --margin-mm)- 0mm (no margin)
- 2mm (default)
- 5mm, 10mm (large margins)
- Negative value (error handling)
- Threshold Options (
-t, --threshold)- Range sweep: 20%, 30%, 40%, 50%, 60%, 70%, 80%
- Optimal value per object type
- Auto-threshold (
-a) validation
- Auto-Threshold (
-a, --auto-threshold)- Different TRIES values (3, 5, 7, 10)
- Compare auto vs manual results
- Performance impact measurement
- No-Holes Flag (
--no-holes)- Objects with holes (ring, letters O/B/P/A)
- Objects without holes (should be identical)
- Known bug validation (if still present)
- Paper Format (
-p, --paper-format)- A4, A3, A5, Letter
- Invalid format (error handling)
- Debug Mode (
-d, --debug)- Verify all debug images generated
- Check debug directory structure
- Validate debug image content
2.9.3. Validation Method
- Create test matrix: Object × Option × Value
- Automated testing where possible (script-driven)
- Document which options affect which object types
- Create "best practices" guide from results
2.10. Category 10: Real-World Object Tests
2.10.1. Purpose
Validate practical usefulness with actual use-case objects.
2.10.2. Common Use-Case Objects
Office/Craft Supplies
- Scissors (thin metal)
- Paperclip (wire)
- Pen/pencil
- Stapler
- USB drive
- Key
Why: Common small objects Expected: Mixed results due to reflectivity and thin features
Electronic Components
- Arduino board
- Raspberry Pi
- PCB (circuit board)
- Component footprints
Why: Technical documentation use case Expected: Good for rectangular boards, challenging for components
Natural Objects
- Leaf (various species)
- Flower petal
- Feather
- Rock/pebble cross-section
Why: Organic shapes, educational use Expected: Good for flat objects, poor for 3D
Fashion/Textiles
- Button
- Zipper pull
- Fabric swatch
- Pattern template
Why: Design/craft use case Expected: Flat items good, 3D items poor
Maker/Prototyping
- 3D printed part
- Laser-cut template
- Gasket/washer
- Mechanical part
Why: Reverse engineering, documentation Expected: Excellent for flat parts
2.10.3. Validation Method
- Prioritize objects from actual user requests/use cases
- Create gallery of successes and failures
- Document workarounds for common object types
- Build "object type → settings" recommendation table
3. Test Execution Plan
3.1. Phase 1: Baseline
- Category 1: Baseline validation
- Category 4: Size range (partial - standard sizes)
- Establish measurement procedures
- Create test templates and documentation forms
Deliverable: Baseline accuracy report, measurement protocols
3.2. Phase 2: Systematic Coverage
- Category 2: Materials
- Category 3: Shape complexity
- Category 5: Positioning
- Build test object library
Deliverable: Material compatibility matrix, shape complexity limits
3.3. Phase 3: Environmental
- Category 6: Lighting conditions
- Category 7: A4 reference detection
- Document environmental requirements
Deliverable: Setup guide, lighting requirements
3.4. Phase 4: Edge Cases
- Category 8: Failure modes
- Category 9: Software options (systematic)
- Document all limitations
Deliverable: Known limitations document, troubleshooting guide
3.5. Phase 5: Real-World Validation
- Category 10: Practical objects
- Integration testing
- User acceptance scenarios
Deliverable: Use case gallery, best practices guide
3.6. Phase 6: Regression (Ongoing)
- Maintain test suite
- Test with each software version
- Add tests for bug fixes
Deliverable: Automated test suite
4. Test Documentation Requirements
4.1. For Each Test
Record:
- Test ID and category
- Object description and photo
- Physical measurements (caliper readings)
- Camera settings used
- Lighting conditions
- Command line used
- SVG output
- Dimensional comparison (actual vs SVG)
- Error percentage
- Notes on quality/issues
4.2. Test Result Database
Structure:
test_results/ ├── baseline/ │ ├── circle_50mm/ │ │ ├── photo.jpg │ │ ├── output.svg │ │ ├── Measurements.org │ │ └── Notes.org │ ├── square_100mm/ │ └── ... ├── materials/ ├── complexity/ └── ...
4.3. Success/Failure Criteria Matrix
| Category | Success Rate | Max Error | Notes |
|---|---|---|---|
| Baseline geometric | > 95% | < 2% | Fundamental |
| Matte materials | > 90% | < 3% | Common case |
| Glossy materials | > 70% | < 5% | May need tuning |
| Complex shapes | > 80% | < 4% | Level dependent |
| Size range (20-180mm) | > 90% | < 3% | Normal range |
| A4 detection | > 95% | < 1% | Critical |
5. Test Equipment and Materials
5.1. Required Equipment
- Google Pixel 9a (or equivalent smartphone) - primary camera
- Digital calipers (±0.1mm precision)
- Light meter (optional but recommended)
- Color reference card (X-Rite ColorChecker or similar)
- Ruler/straightedge (300mm, metric)
5.2. Test Materials to Acquire
- Black matte paper (A4 sheets)
- Colored matte paper (red, blue, green, yellow)
- Glossy photo paper
- Cardboard samples
- Transparent acetate sheets
- Aluminum sheet (thin, cuttable)
- Various A4 colored papers for reference tests
- A3, A5, Letter size papers
5.3. Test Object Creation
Precision-cut geometric shapes (laser cut or die cut), 3D printed test shapes, and printed patterns on cardstock. The 3D printed shapes are the primary dimensional standard in current use; the material below documents how they are made, measured, and why, folded in from a former standalone note.
5.3.1. Directory Structure
TestInstrumentation/GeometricShapes/ holds one subdirectory per
test object, each named for its known dimensions (Circle50mm/,
Square25mm/, Rectangle50x100mm/, Triangle80mm/, etc.). The
reference calibration target lives separately, in
TestInstrumentation/ReferenceCard/ — see ReferenceCard.org.
Each geometric shape directory holds:
ObjectName.scad— OpenSCAD source with precise dimensionsObjectName.stl— exported STL for 3D printing (optional, can be regenerated from the.scad)ObjectName.3mf— PrusaSlicer project with the actual manufacturing settings usedPhysicalMeasurements.org— caliper measurements after printingNotes.org— observations about the printed object
Org-mode files (points 4-5) were chosen for structured tables and
checkboxes, LaTeX/PDF export if a report is needed, and plain-text,
version-control-friendly storage — consistent with the rest of the
project. .3mf files (point 3) capture the complete manufacturing
context (slicer settings, print orientation, material, infill,
perimeters, supports) in one place, alongside the .scad source, so
a print can be reproduced exactly, what actually worked (vs. what
was merely recommended) is on record, and settings are easy to
compare if a print fails.
5.3.2. Actual Manufacturing Settings
All geometric test shapes were printed with these settings
(recorded in each object's own .3mf):
- Material
- Black PLA (matte finish)
- Printer
- Prusa XL with 0.6mm HF nozzle
- Tool used
- Tool 1 / Extruder 1 (second extruder)
- Layer height
- 0.2mm
- Infill
- 100% (solid objects)
- Speed
- 30mm/s (perimeters, infill, external perimeters); 40mm/s first layer
- Nozzle temperature
- 230°C (PLA)
- Bed temperature
- 60°C
30mm/s was chosen deliberately over the printer's 200mm/s capability,
trading print time for dimensional accuracy. These are test
instrumentation settings, distinct from the hardware/jig components
(see ManufacturingConfig.org), which use PETG on tool 0.
Black matte PLA specifically, rather than the jig's PETG: PLA shrinks less than PETG (~0.3% vs ~0.7%, mattering for dimensional accuracy), a matte surface minimizes reflections in photographs, black gives high contrast against white A4 paper, PLA prints at lower temperature with less warping, and it is lower cost for consumable, deliberately-replaceable test objects.
5.3.3. Post-Processing and Measurement
After printing:
- Remove carefully from the bed; let cool completely (30+ minutes)
- Remove any brim/raft carefully
- Measure with calipers (±0.1mm precision)
- Record actual dimensions in
PhysicalMeasurements.org - Compare to the
.scadsource's nominal dimensions - Accept if within ±0.2mm tolerance
The known dimensions — from both the .scad source and the
physical caliper measurements — are what dvi3v's extracted SVG
dimensions are validated against.
6. Quality Metrics
6.1. Dimensional Accuracy
Error_% = |SVG_dimension - Actual_dimension| / Actual_dimension × 100
6.2. Contour Completeness
- Visual inspection: complete/incomplete
- Point count comparison (complex shapes)
6.3. Detection Reliability
Reliability = Successful_detections / Total_attempts × 100
6.4. Processing Time
- Measure end-to-end time per object
- Identify performance bottlenecks
6.5. Quality Score
Composite metric (0-100):
- Dimensional accuracy: 40 points
- Contour completeness: 30 points
- Edge smoothness: 20 points
- Hole preservation: 10 points
7. Automated Testing Strategy
7.1. Script-Based Testing
Create test harness:
#!/bin/bash
# test_runner.sh
for test in test_cases/*.jpg; do
name=$(basename "$test" .jpg)
dvi3v "$test" "results/${name}.svg"
# Validate output
# Record metrics
done
7.2. Validation Scripts
- SVG dimension extractor
- Comparison with ground truth
- Automated report generation
7.3. Regression Testing
- Maintain known-good test set
- Run on each version release
- Flag dimensional changes > 0.5%
8. Expected Outcomes
8.1. Documentation Deliverables
- Test Results Database
- Material Compatibility Matrix
- Shape Complexity Limits Guide
- Lighting Requirements Specification
- Best Practices Guide
- Troubleshooting Decision Tree
- Known Limitations Document
8.2. Software Improvements
Based on testing, prioritize:
- Auto-threshold refinement
- Better error messages for edge cases
- See
FutureResearch.orgfor tracked, not-yet-implemented features (base-feet detection, multi-object detection, perspective correction, etc.)
8.3. Hardware Improvements
If needed:
- Lighting recommendations (LED ring?)
- Background color optimization
- Camera position fine-tuning
9. Risk Assessment
9.1. High Risk Items
- Glossy/reflective objects may have low success rate
- Very small objects (<15mm) may be unreliable
9.2. Mitigation Strategies
- Document workarounds for problematic materials
- Establish minimum size guidelines upfront
10. Conclusion
This comprehensive testing plan provides systematic validation of the
dvi3v system across multiple dimensions: object types, materials,
sizes, lighting conditions, and software options.
Working through the phases establishes quality baselines, documents limitations, and guides development priorities.
The structured approach ensures reproducibility and builds a knowledge base for users and developers.