Skip to content

Daily Test Coverage Improver: Research and Plan #59

@github-actions

Description

@github-actions

Daily Test Coverage Improver: Research and Plan

Repository Overview

Furnace is a tensor library with support for differentiable programming, designed for machine learning, probabilistic programming, and optimization. Key characteristics:

  • Technology Stack: F#/.NET Core, uses TorchSharp and LibTorch for backend support
  • Backends: Reference backend and Torch backend
  • Main Components:
    • Core tensor operations (Furnace.Core)
    • Reference backend (Furnace.Backends.Reference)
    • Torch backend (Furnace.Backends.Torch)
    • Data utilities (Furnace.Data)

Current Testing Strategy

  • Test Framework: Uses .NET test framework with dotnet test
  • Test Location: Main tests in tests/Furnace.Tests/ directory
  • Test Structure: Comprehensive test suite with files like:
    • TestTensor.fs - Core tensor functionality
    • TestDerivatives.fs - Derivative operations
    • TestModel.*.fs - Various model components
    • TestOp.*.fs - Specific operations
    • Backend-specific tests

Current Coverage Analysis

From the coverage report in /coverage/Summary.txt:

Overall Coverage Statistics:

  • Line Coverage: 76.3% (1907/2497 lines covered)
  • Branch Coverage: 45.8% (3137/6842 branches covered)
  • Method Coverage: 67.7% (838/1236 methods covered)

Component-Specific Coverage:

  • Furnace.Backends.Reference: 73.4% line coverage

    • Opportunity: Several tensor types have low coverage (BFloat16: 51.5%, Bool: 57.1%, Float16: 51.5%)
    • Critical: Utils class has 0.0% coverage
  • Furnace.Backends.Torch: 84.2% line coverage

    • Generally well-covered, several ops at 100%
    • Opportunity: Utils at 68.2%, TorchRawTensor at 82.6%
  • Furnace.Data: 62.7% line coverage

    • Critical: MNIST has 0.0% coverage
    • Critical: Pyplot has 0.0% coverage
    • Opportunity: helpers at 44.1%

Build and Coverage Commands

Based on analysis of the repository:

# Build the project
dotnet build

# Run tests 
dotnet test

# Generate coverage (appears to use a coverage tool, likely dotnet-coverage or similar)
# Command structure needs to be determined from existing CI/workflow files

Test Organization Strategy

Tests are well-organized by:

  • Functionality: Separate files for different operations (derivatives, models, tensor ops)
  • Backend: Testing both Reference and Torch backends
  • Components: Each major component has dedicated test files

New tests should follow this pattern and be added to existing test files or new files in tests/Furnace.Tests/.

Priority Areas for Coverage Improvement

High Priority (0% coverage):

  1. Furnace.Backends.Reference.Utils - Critical infrastructure code
  2. Furnace.Data.MNIST - Important data loading functionality
  3. Furnace.Data.Pyplot - Visualization utilities

Medium Priority (Low coverage):

  1. Furnace.Util.helpers (44.1%) - Utility functions
  2. Reference backend tensor types with ~50% coverage (BFloat16, Bool, Float16)
  3. Branch coverage improvements across all components (currently 45.8%)

Strategies for Major Coverage Improvements:

  1. Edge case testing - Many branches likely represent error conditions and edge cases
  2. Type-specific operations - Test operations across all supported tensor types
  3. Integration testing - Test interactions between components
  4. Error condition testing - Test exception paths and error handling

Questions for Maintainers

  • Are there specific testing patterns or conventions to follow?
  • Are there any areas of code that should NOT be tested (e.g., deprecated functionality)?
  • What coverage tool/command is used to generate the current reports?
  • Are there performance-sensitive areas where test additions should be careful?

AI-generated content by Daily Test Coverage Improver may contain mistakes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions