Skip to content

Unit Test Infrastructure #1297

@ngenovese11

Description

@ngenovese11

Feature Request: Framework-Agnostic Plugin Architecture & Testing Infrastructure

Problem Statement

Our current architecture presents challenges for comprehensive testing and maintainability due to tight coupling with the Crestron SDK throughout the codebase. This creates difficulties for:

  • Unit Testing: SDK dependencies are difficult to mock and isolate during testing
  • Plugin Development: Plugin authors must work with untestable SDK dependencies, limiting code quality
  • Maintainability: Direct SDK coupling makes debugging and refactoring more complex
  • Developer Experience: Difficult to test logic independently of the embedded framework
  • Modern Standards: Running on .NET Framework 4.7.2 limits access to modern tooling and performance improvements

Proposed Solution

Modernize our architecture by creating an abstraction layer between logic and the Crestron SDK while preserving existing plugin interfaces. This will:

  • Upgrade to .NET 8: Access modern performance improvements, tooling, and long-term support
  • Abstract SDK dependencies: Create testable interfaces that wrap embedded SDK functionality
  • Maintain plugin interfaces: Existing plugin contracts remain unchanged, only internal implementation evolves
  • Enable comprehensive testing: Logic becomes fully testable

Implementation Approach

  1. Phase 1: Feasibility Research & .NET 8 Upgrade

    • Upgrade from .NET Framework 4.7.2 to .NET 8
    • Catalog and analyze all direct Crestron SDK dependencies throughout the codebase
    • Evaluate whether we need one or two abstraction projects:
      • Core abstraction layer for plugin contracts
      • Potential SDK wrapper project for careful embedded framework isolation
  2. Phase 2: SDK Abstraction Layer

    • Create interfaces that abstract embedded SDK functionality
    • Implement wrapper services that encapsulate SDK interactions
    • Maintain existing plugin interfaces - plugins see no changes to their contracts
    • Ensure business logic operates through abstracted SDK interfaces
  3. Phase 3: Testing Infrastructure & Documentation

    • Build comprehensive testing framework with mockable abstractions
    • Create testing utilities and guidelines for both core services and plugin development
    • Integrate with CI/CD pipeline for automated testing

Benefits

  • Risk Reduction: Earlier detection of bugs and regressions
  • Development Velocity: Faster feedback loops during development
  • Team Confidence: Safer refactoring and feature additions
  • Code Quality: Improved modularity and separation of concerns
  • Leverage Existing Infrastructure: Build upon our current DI patterns
  • Documentation: Tests serve as living documentation of expected behavior
  • Future-Proofing: Easier framework updates or migrations

Success Metrics

  • Successful .NET 8 upgrade with improved performance and modern tooling
  • Achieve 80%+ unit test coverage

This enhancement modernizes our internal architecture by abstracting embedded SDK dependencies while preserving plugin ecosystem stability, enabling comprehensive testing and improved maintainability.

Metadata

Metadata

Assignees

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