Skip to content

Acceptance tests for top-level functions #589

Open
@jmfayard

Description

@jmfayard

This is my current understanding of the problem. Please provide feedback whether I'm missing something.

We have lots of top-level functions and it's often unclear

  • issue1: whether they belong to the functional core (not the imperative shell) and therefore needs to be tested
  • issue2: whether they are currently being tested
  • issue3: if not, what kind of simple tests we can add as a starting point

For example with the function getArtifactNameToConstantMapping()

  • issue1: definitely part of the functional core and we relay on it for multiple features
  • issue2: it's not being tested currently. It's used in other tests which is not the same thing.
  • issue3: the function works so we should not modify it but simply write what Martin Fowler calls acceptance tests for it. Meaning: if we give her this kind of objects as input, this is the output we currently get.

Regarding issue 2, an issue is that if you have a class FindKitten, there is a strong convention that you test it in the class FikkndKittenTest. And you can jump there with the action Go To Test.

But there is no such convention for top-level functions AFAIK.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions