Test cases are desired outputs for any problem statement if the code you have written matches all the expected outputs then all the test cases are passed if not then test cases are failed and there are some hidden test cases as well which are not shown to the candidates.