Skip to content

data and constructors required by tests: Should we provide them in stubs? #466

@petertseng

Description

@petertseng

See in #464 (comment) how I argued:

  • The test is expecting the four constructors
  • If we don't provide it, the stub solution doesn't compile with the tests.
  • If we don't provide it, the student has to read the test file, find all the possible constructors, and make the data type exactly as we want it anyway.

So, I argued to provide it to the student.

We can see that this is distinct from the case where the test demands an abstract type (such as a Robot) and wishes to perform some operations on it. In this case:

  • the test doesn't care about the implementation of the type
  • the student can choose the representation
  • therefore we make a data Robot = Dummy in the stub file

In this issue I'll discuss a few exercises of the first type:

  • allergies: Allergen
  • meetup: Weekday and Schedule
  • space-age: Planet

So, should we give these three exercises the same treatment, and fully define the above-mentioned data types, with constructors?

(If doing so, we can remove the .meta/DONT-TEST-STUB file for each of these exercises)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions