datacamp / testwhat

Write Submission Correctness Tests for R exercises
https://datacamp.github.io/testwhat
GNU Affero General Public License v3.0
33 stars 24 forks source link

Minor documentation feedback #192

Closed Hadrien-lcrx closed 5 years ago

Hadrien-lcrx commented 5 years ago

DataFrame or omitted double quotes?

Source

Vague definition

The functions in testwhat related to testing functions allow you to test whether students correctly called particular functions, with the correct arguments and whether these arguments are correct.

Source

Typo

Here, check_function() looks for the call of round() in both student and solution code, and then check_result() runs both (in their respective environments).

Whenever there are is a multitude of ways to call a function

Source

Remind / remember

Remind that functions like check_object() and check_function() often depend on both the student and solution environment.

Source

check_or or check_or

check_or and check_or allow you to add logic to your SCT. Instead of running all tests and failing as soon as one of the tests fail, you can conditionally execute tests, and interpret the results separately.

Source

res or result

As an example, suppose you want the student to calculate the mean of a vector vec and store it in res. A possible solution could be:


# vec is predefined for you
vec <- c(1, 2, 3, 4, 5, 6)

Calculate result

result <- mean(vec)


* As an example, suppose you want the student to calculate the mean of a vector `vec` and store it in `result`. A possible solution could be:
```r
# vec is predefined for you
vec <- c(1, 2, 3, 4, 5, 6)

# Calculate result
result <- mean(vec)

Source

Remove “something”

If something result is not correct, you want to dig a little deeper and see if the student used the mean() function correctly.

Source

test_object() or check_object()

Because there is clearly something wrong - result is not correct - the ‘check’ sub-SCT, ex() %>% test_object("result") is executed again, but loudly this time.

Source

test_object or check_object?

For testwhat and DataCamp’s R Backend it communicates with, this can cause problems: there’s a solution enviroment and a student environment (so that testwhat can easily compare objects that student created with the object that they should’ve created, for example with test_object())

Source

Cc @filipsch

filipsch commented 5 years ago

@Hadrien-lcrx Thanks for this, very helpful!