Skip to content

Instantly share code, notes, and snippets.

@sargo
Created November 26, 2015 15:55
Show Gist options
  • Save sargo/e4c4af20703acf0ffcbb to your computer and use it in GitHub Desktop.
Save sargo/e4c4af20703acf0ffcbb to your computer and use it in GitHub Desktop.

There is this piece of code that is not yet covered by tests, and our product owner requested that we increase code coverage. Can you do it?

Three modes:

What do they check?

  • easy: knowledge about tests in general, ability to test different execution paths, ability to handle exceptions, very basic creativity, simple unit testing
  • normal: ability to write test cases for more than one object at the same time, more complex scenarios
  • hard: mocking, dependency injection, functional testing

This question can be split into two phases:

  • writing actual tests (few)
  • listing possible test scenarios (i.e. “what scenarios would you write if you had to cover this code with tests?”)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment