Skip to content

refactor(core): production testability & tech-debt follow-ups (SimpleExecutor stub, Shell seams, static logger seams) #353

Description

@Vasar007

Summary: Three low-severity production-code observations surfaced while improving unit-test coverage. Each is a deferred production change (the accompanying test fixes have already shipped) that needs a decision before it can be closed out.

1. Unfinished ExecuteAsync() stub in SimpleExecutor

  • Where: Sources/Libraries/ProjectV.Executors/SimpleExecutor.cs
  • Problem: The parameterless ExecuteAsync() overload is an unfinished stub that throws NotImplementedException ("Current service version cannot have job with data in DB."). The unit tests currently pin that throw as the method's contract, so the "contract" is really just a placeholder.
  • Decide: Implement the overload (take config from DB, build and run a Shell), or remove it if it is unused.

2. No interface seams on the Shell constructor

  • Where: Sources/Libraries/ProjectV.Core/Shell.cs
  • Problem: The constructor takes concrete sealed manager types (input, crawlers, appraisers, output) with no interface seams, forcing test-builder workarounds to construct a Shell. This is already documented in-code as a known architectural anti-pattern.
  • Decide: Introduce interface seams for the managers, or formally accept and document the coupling as intentional.

3. Static NLog logger fields block log-and-rethrow verification

  • Where:
    • Sources/Libraries/ProjectV.Crawlers/CrawlersManager.cs
    • Sources/Libraries/ProjectV.IO.Input/InputManager.cs
    • Sources/Libraries/ProjectV.IO.Output/OutputManager.cs
  • Problem: Each uses a private static readonly NLog logger field. That makes the logging half of the log-and-rethrow contract unverifiable in unit tests — the rethrow can be asserted, but the log call cannot.
  • Decide: Inject an ILogger / ILoggerFactory seam, or accept the coverage gap.

Related previously-reported item: the EF Core model-validation migration blocker is tracked in #346.

Metadata

Metadata

Assignees

Labels

area: Core LibraryRelated tot the core librarytype: Code MaintenanceNew feature/requirement which is targeting on improve architecture, realization and code style

Projects

Status
To do

Relationships

None yet

Development

No branches or pull requests

Issue actions