Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's unclear what result the functions should return #415

Closed
iredmail opened this issue Oct 5, 2019 · 2 comments
Closed

It's unclear what result the functions should return #415

iredmail opened this issue Oct 5, 2019 · 2 comments

Comments

@iredmail
Copy link

iredmail commented Oct 5, 2019

Dear all,

I'm trying to do some tests, but the Instruction (or Introduction) part of some exercises are not clear what the result it expects the function returns.

For example, exercise Leap:

Given a year, report if it is a leap year.

It just says "report", but doesn't clearly specify what data the function should return. For example, an ideal introduction should be:

Given a year, return atom `true` if it's a leap year, otherwise return atom `false`.

If this is easy to guess what it should return, let's take another exercise for example, sublist:

Introduction

Given two lists determine if the first list is contained within the
second list, if the second list is contained within the first list, if
both lists are contained within each other or if none of these are
true.

Specifically, a list A is a sublist of list B if by dropping 0 or more
elements from the front of B and 0 or more elements from the
back of B you get a list that's completely equal to A.

I don't think students can understand what the functions should return.
After checked file test/sublist_tests.erl, i realize it expects function sublist:relation() returns atoms like equal, unequal, sublist, superlist. Can you understand this by just reading the Introduction part of the exercise? Asking an unclear question won't get you precise answer.

@iredmail iredmail changed the title It's unclear what result the unittest expects It's unclear what result the functions should return Oct 5, 2019
@NobbZ
Copy link
Member

NobbZ commented Oct 5, 2019

Yeah, I can understand what you mean. Though I also think its obvious in the case of leap:leap_year/1 that it should return boolean().

Providing typespecs for the required functions across all exercises is definitely a goal for the track, though I have to put it somewhere mid- to long-term for the moment.

I appreciate some PRs for the manually implemented exercises though (same rules as for the version PRs apply, see #414)

@NobbZ
Copy link
Member

NobbZ commented Oct 5, 2019

I also have to add, that its hard to be more explicit in the README, as the same text is used across all tracks (currently ~50), so we try to write them in a way that suites all of the languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants