Skip to content

Convention: Avoid Weasel Words #3

Description

@stijn-dejongh

Outline

Tests are often phrased using non-commital words such as "Should", "Could", ... .
The idea of a good test suite is to help reduce issues during development, and be used afterwards as 'executable documentation'. As such, the names of tests should be phrased in a way that reads like a list of capabilities, rather than a list of vague intentions.

No one would buy a car that is advertised to have the following function:

"When the user steps on the brakes, the car SHOULD slow down."

Implementation Notes

  • Use a configurable list of weasel words.
  • Scan the test code to ensure these words do not occur in the codebase.
  • Throw an error/warning if they are used with a clear description of the convention.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions