Docs Index

Doc

Test Cases

With our take-home projects, you have the ability to run test cases. Test cases allow you to test a candidate’s code against certain requirements. You will also be able to view the test cases’ pass/fail once the candidate has finished their take-home project.

Here is an example. Let’s say I want the candidate to write a function that reverses a string. I can have a test case that would have an input of “hello world”. The output of the candidate’s function must return “dlrow olleh”.

You set them up during the second step of creating or editing a take-home-only question. Refer to that doc page in order to learn more about the general wizard page

Function Signature

In order to run tests on the solution function, we must know how many parameters are enabled, what types they are, and what the expected return type of the function is.

Parameters should be named and assigned a type using the dropdowns.

You can add multiple parameters to a function by selecting the “Add Parameter” button, and repeating the steps to name the parameter and assign the type.

If you want to remove a parameter, click the trash can icon on the left-hand side of the parameter.

Finally, you can set the type of the function’s return value

Supported types include:

  • Integer
  • String
  • Integer Array
  • String Array

These types are consistent across all supported take-home project languages. These same types are enabled for both parameter types and return types.

Test Cases

Test cases are the expected inputs and outputs you expect to see from a candidate’s solution. They contain expected input values and output values.

There is one test case supported by default, but you can add more by pressing the “Add Test Case” button.

You’re able to remove test cases by selecting the delete button to the left-hand side of the test case you’d like to remove.

Each test case also includes a toggle of whether to make it visible to the candidate or not. Non-visible test cases are not shown to candidates but are still tested against the candidate code and reported to the interviewer in playback mode.

Candidate View

When a candidate accesses a pad with take-home test cases, they’ll be able to see the visible tests within the “Test Cases” tab

They’re able to run specific test-cases by checking the checkbox and pressing “Run selected test casts”. Once ran, the checkbox on the right will update to indicate whether the test was successful or not.

You’re also able to see test output from the “Program output” tab, along with the expected and received values for each failed test.