Alex Rivera | Logout

Am I allowed to check in a failing test

Asked 2010-11-03T08:58:23.847
10

Our team is having a heated debate as to whether we allow failing unit tests to be checked-in to source control.

On one side the argument is that yes you can as long as it is temporary - to be resolved within the current sprint. Some say even that in the case of bugs that may not be corrected within the current sprint we can check-in a corresponding failing test.

The other side of the argument is that those tests, if they are checked-in must be marked with the Ignore attribute - the reasoning being that the nightly build should not serve as a TODO list for a developer.

The problem with Ignore attribute however is that we tend to forget about the tests.

Does the community have any advice for us ?

We are a team of 8 developers, with a nightly build. Personally I am trying to practice TDD but the team tends to write unit tests after the code is written

Edit
Report

1 Answer

1

It depends how you use tests. In my group, running tests is what you do before a commit in order to check that you (likely) have not broken anything.

When you are about to commit, it is painful to find failed tests that seem vaguely possibly related to your changes but still strange, investigate for a couple of hours, then realize it cannot possibly be because of your changes, do a clean checkout, compile, and find that indeed the test failures come from the trunk.

Obviously you do not use tests in the same way, otherwise you wouldn't even be asking.

answered 2010-11-03T09:06:40.313

Your Answer