-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Description
Repository Analysis Summary
Purpose and Technology Stack
FSharp.Data is a library providing F# type providers and data access tools for structured file formats (CSV, HTML, JSON, XML) and WorldBank data. The project:
- Uses .NET 8.0 and F#
- Built with Fake build system
- Uses NUnit for testing with FsUnit and FsCheck
- Has multiple sub-projects (Core, DesignTime, Http, etc.)
- Main build command:
dotnet run --project build/build.fsproj -- -t All - Test-only command:
dotnet run --project build/build.fsproj -- -t RunTests
Current Testing Strategy
The repository has comprehensive test coverage across multiple projects:
- FSharp.Data.Core.Tests: Core functionality tests (JSON, HTML, CSV, HTTP)
- FSharp.Data.DesignTime.Tests: Type provider design-time tests
- FSharp.Data.Tests: Integration tests for providers
- FSharp.Data.Reference.Tests: Reference/example tests
Tests are organized by functionality and use NUnit with FsUnit for readable F# test syntax.
Current Test Coverage State
No existing coverage infrastructure found:
- No coverage tools in paket.dependencies
- No coverage reports in CI/CD workflows
- No existing coverage analysis in build scripts
- This represents a significant opportunity for improvement
Test Coverage Improvement Plan
Phase 1: Infrastructure Setup
-
Add coverage tools to paket.dependencies:
- Add
coverlet.collectorandcoverlet.msbuildfor .NET coverage - Add
ReportGeneratorfor coverage report generation
- Add
-
Create coverage collection commands:
- Modify test runs to collect coverage data
- Generate XML and HTML coverage reports
- Upload coverage artifacts for analysis
Phase 2: Coverage Analysis & Improvement
-
Baseline coverage assessment - Generate initial coverage reports
-
Identify low-coverage areas focusing on:
- Core parsing logic (JSON, CSV, HTML, XML)
- Type provider inference algorithms
- HTTP client functionality
- Error handling paths
- Edge cases in data conversion
-
Target areas for new tests:
- JSON parsing: Complex nested structures, malformed JSON
- CSV parsing: Various delimiters, encoding issues, missing data
- HTML parsing: Complex selectors, malformed HTML
- XML parsing: Namespaces, schema validation, encoding
- Type inference: Edge cases, performance with large data
- HTTP client: Error conditions, timeouts, authentication
Commands Needed for Build/Test/Coverage
# Restore packages
dotnet tool restore
dotnet paket restore
# Build all
dotnet run --project build/build.fsproj -- -t Build
# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults/
# Generate coverage report (after adding ReportGenerator)
dotnet reportgenerator -reports:"TestResults/**/coverage.cobertura.xml" -targetdir:"TestResults/CoverageReport" -reporttypes:"Html;Cobertura"New Test Organization Strategy
- Follow existing patterns in test projects
- Add tests to appropriate existing test files
- Create new test files for uncovered modules
- Use FsUnit for readable assertions
- Include property-based testing with FsCheck for complex scenarios
Opportunities for Significantly Increasing Coverage
- Property-based testing for parsers and type inference
- Error path testing - malformed inputs, network failures
- Performance edge cases - large files, memory constraints
- Cross-platform compatibility testing
- Schema validation testing for XML and JSON providers
- HTTP authentication and security testing
Questions for Maintainers
- Are there specific code coverage percentage targets we should aim for?
- Are there any areas of the codebase that should be excluded from coverage analysis?
- Should coverage reports be integrated into the CI/CD pipeline permanently?
- Are there specific edge cases or scenarios you'd like prioritized for testing?
Next Steps
- Set up coverage infrastructure (.github/actions/daily-test-improver/coverage-steps/action.yml)
- Generate baseline coverage report
- Begin systematic test additions focusing on lowest coverage areas
- Create pull requests with meaningful test improvements
AI-generated content by Daily Test Coverage Improver may contain mistakes.
Metadata
Metadata
Assignees
Labels
No labels