Skip to content

nightshift: test-gap #2

@nightshift-micr

Description

@nightshift-micr

Test Gap Analysis: Microck/boilify

nightshift automated analysis — test-gap task

Summary

Analyzed test coverage for Boilify — an OpenFX video effect plugin (C++, 401 lines in Boilify.cpp). The project has zero tests — no test files, no test framework, no CI test step.

Repository Structure

File Lines Purpose
Boilify.cpp 401 Single source: OpenFX plugin with Perlin noise distortion
CMakeLists.txt 85 Build config (no test targets)
tuner/app.js ~50 Web-based parameter tuner UI
tuner/index.html ~30 Tuner HTML shell
.github/workflows/ 3 files Release builds for Linux/macOS/Windows

Test Gap Assessment

Critical Gaps (No Coverage)

Component Risk Recommended Test Type Priority
fastFloor() 🟡 Medium Unit test — boundary values (negative, zero, positive floats) High
mixBits() 🟡 Medium Unit test — known input/output pairs for hash function High
hashFast() 🟡 Medium Unit test — distribution, determinism, seed isolation High
perlinFast() 🟡 Medium Unit test — output range [0,1], continuity, seed variation High
applyNoiseType() 🟢 Low Unit test — smooth passthrough, ridged transform Medium
fbm() 🟡 Medium Unit test — octaves, amplitude normalization, noise types High
renderSlice() 🔴 High Integration test — pixel output with controlled inputs Critical
onLoad() 🔴 High Integration test — null host, missing suites High
describe() 🟡 Medium Integration test — property setup correctness Medium
describeInContext() 🟡 Medium Integration test — parameter ranges and defaults Medium
render() 🔴 High Integration test — end-to-end with mock OpenFX host Critical

Test Infrastructure Gap

Need Status Recommendation
Test framework ❌ None Add a simple C++ test runner (Catch2, doctest, or Google Test)
Mock OpenFX host ❌ None Create minimal mock OfxHost with stubbed suites for unit testing
CI test step ❌ None Add test execution to GitHub Actions workflows
Coverage reporting ❌ None Add gcov/lcov for coverage metrics

Specific Test Cases to Write

Unit Tests (no OpenFX dependency needed)

  1. fastFloor edge cases: fastFloor(-0.5)-1, fastFloor(0.0)0, fastFloor(1.9)1, fastFloor(-1.0)-1
  2. hashFast determinism: Same inputs → same output; different seed → different output
  3. hashFast distribution: 10k samples should have approximately uniform distribution in [0, 1)
  4. mixBits avalanche: Single bit change in input should change ~50% of output bits
  5. perlinFast range: Output should always be in [0, 1) for any input
  6. fbm normalization: With 3 octaves, output should be normalized to approximately [0, 1]
  7. fbm octaves: More octaves should produce different (more detailed) output
  8. applyNoiseType smooth: Should pass value through unchanged
  9. applyNoiseType ridged: Should transform to 1.0 - |2*v - 1| pattern

Integration Tests (require mock OpenFX host)

  1. render passthrough: With strength=0, output should equal input
  2. render bounds clamping: Displaced pixels should never read outside source rect
  3. render seed stability: Same seed + time → identical output (deterministic)
  4. render pixel depth: Should handle byte, short, and float pixel depths correctly
  5. render multithreading: Output should be identical for 1 thread vs N threads
  6. onLoad missing host: Should return kOfxStatErrMissingHostFeature when gHost is NULL
  7. describeInContext parameter ranges: Verify strength [0,100], size [1,600], seed [0,9999]

Build Test Gaps

  1. Build verification: CI workflows build but don't verify the .ofx plugin loads correctly
  2. Cross-platform consistency: No test that the tuner web app matches plugin parameter ranges

Quantitative Assessment

Metric Value
Source files 1 (Boilify.cpp)
Test files 0
Lines of code 401
Lines of test code 0
Test coverage 0%
Functions/methods 12
Tested functions 0
Test-to-code ratio 0:1

Recommendations

  1. Priority 1: Create a test harness with a mock OpenFX host for renderSlice testing
  2. Priority 2: Add unit tests for pure functions (fastFloor, hashFast, perlinFast, fbm, applyNoiseType) — these require no mocking
  3. Priority 3: Add Catch2 or doctest as a header-only test framework (minimal build impact)
  4. Priority 4: Add CMake test target and integrate with CI
  5. Priority 5: Test the tuner app's parameter ranges match the plugin's defined ranges

Notes

  • The pure math functions (fastFloor, hashFast, perlinFast, fbm) are highly testable in isolation — no OpenFX dependency needed
  • The renderSlice function is the most critical to test — it handles pixel memory directly and has bounds-checking logic that could silently fail
  • The OpenFX plugin architecture makes full integration testing challenging without a host application (DaVinci Resolve, Nuke, etc.), but mock-based testing covers the logic layer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions