Skip to content

BasicStatementExpressionsTestSuite: Rework to be more in-line with newer tests #345

Description

@YYDan

Description

BasicStatementExpressionsTestSuite was added in October 2024, after the summer refactor campaign had finished. It is in better shape than the other post-campaign additions — 170 asserts in 87 facts, 2.0 per fact — but 25 facts still carry three or more asserts.

The offenders cluster in a few families:

  • Nested if-else (3 facts at 3 asserts)
  • Repeat / while / for "outer valid, inner invalid" variants (9 facts at 3–4 asserts)
  • Switch statements (10 facts at 3–4 asserts)
  • Try / catch / finally (4 facts at 3 asserts)

This is a moderate, mechanical job — the fact names already describe single scenarios, so in most cases the asserts within a fact are checking several distinct outcomes of that one scenario (e.g. loop counter, accumulator, and exit condition) and need one fact each.

Target: roughly 150–170 facts.

Script Name

BasicStatementExpressionsTestSuite

Steps To The Task

  • Audit the 25 facts with three or more asserts and confirm which asserts are independent outcomes vs sequentially dependent
  • Split each independent outcome into its own addFact(), named <original_name> #N
  • Leave the existing single-assert facts unnumbered, per the convention for facts that were already single-scenario
  • Add section comment headers per statement family (if-else, repeat, while, for, switch, try/catch)
  • Update assert descriptions so they identify the specific outcome
  • Confirm the total assert count is unchanged (170) and that no fact name is duplicated
  • Run the suite on VM and YYC and confirm the same set of checks pass as before

Metadata

Metadata

Assignees

Labels

refactorAn improvement to existing test/module code

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions