Skip to content

Tech debt: Test suite quality — fake tests, getter/setter bloat, duplicated helpers #326

@Brad-Edwards

Description

@Brad-Edwards

Description

Several test quality issues identified across the test suite:

1. GitHubCliClientTest tests reimplemented logic, not the actual class

The test reimplements JSON parsing locally and tests that copy instead of the real GitHubCliClient. If the production code changes, these tests will not catch regressions.

2. Getter/setter test bloat (~30 tests)

TraceabilityLinkTest, GitHubIssueSyncTest, and RequirementImportTest are 60-70% pure setX(); assertThat(getX()).isEqualTo(...) accessor tests. These provide false confidence and inflate test counts without testing behavior.

3. Reflection-based setId() duplicated across 8+ files

The same 6-line setField(obj, "id", UUID.randomUUID()) helper is copy-pasted across multiple test files. Should be extracted to a shared TestFixtures utility.

4. GroundControlApplicationTest tests nothing

assertThat(GroundControlApplication.class).isNotNull() tests that a class exists at compile time. Zero value.

5. Raw assert in SyncIntegrationTest

Lines 88-92 and 121-123 use Java's assert keyword instead of AssertJ. Can be disabled with JVM flags and provides no failure detail.

6. Brittle migration version assertion

containsExactly("001", ..., "011") breaks with every new migration. Should use hasSizeGreaterThanOrEqualTo.

Recommendation: Delete getter/setter tests, extract shared helpers, fix GitHubCliClientTest to test the real class, replace raw assert with AssertJ.

Traced Requirements

  • GC-P002: Append-Only Audit Trail (testing infrastructure supports audit verification)

Impact

Test reliability — false confidence from tests that don't test real behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    qualitytech-debtTechnical debt and code quality improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions