Question: what is the difference between error and failure in junit?
Answer: A failure means your test ran correctly, and identified a defect in your code. An error could mean a bug in your code, but one that you weren't even testing for. It could also mean that the bug is in the test itself. In short, a failure means you need to rewrite the code that is being tested.