Reputation: 651
Is it good practice to keep fixing the existing Junits to make them pass after writing a new code ?
Example.
Is it right to refactor existing Junits to make them pass for the added code or Refactor the code in such a way that existing JUnits should pass without any modification?
Upvotes: 3
Views: 85
Reputation: 610
The sole purpose of unit tests is to check the functionality of a unit of code. When the code is changed,
Upvotes: 1
Reputation: 312404
The fact that the tests now fail means you have changed the behavior of your code. Generally speaking, this can mean one of two things:
Upvotes: 3