views:

192

answers:

12

As a build engineer, I'm constantly looking for new and interesting ways to improve our build process - and that includes looking for new and interesting ways to fail our builds!

I have yet to find a canonical list of reasons to fail a build ... so I figure it's time to get one created. With that in mind:

What build-time checks - both obvious and creative - have you seen fail builds?

+2  A: 

Unit test failure(s).

Brian Laframboise
A: 

Something as simple as a check on compilation failure should be considered mandatory, nuff said.

Check-ins that lead to broken builds should be unacceptable, although the sad truth is that many organizations do accept such.

If the compilation fails:

  • …you won't have a binary to use or run.
  • …you can't run tests and analysis to make sure it works.
  • …you can't do any other checks needed to build the project.
  • …you can't please your client because you have nothing to show.

Why? BECAUSE THE BUILD IS BROKEN.

Spoike
Far from enough. Compiling != working
Pascal Thivent
@Pascal Thivent: I'm pretty sure I was clear about this; I mentioned ONE check and if it isn't compiling then it is **clearly not** working. I.e. `(!Compiling == !Working)` Not claiming anything else at this point because the op asked for a check. I'm pretty sure that's the obvious basics.
Spoike
Edited... at least now I hope I explained it better. If you at least don't check for a compilation failure then nothing will work. Duh! :P
Spoike
+2  A: 

Code failing automated quality inspections (FxCop, etc.).

GWLlosa
+1  A: 

fail on compilation warning

zr
+2  A: 

In his article introducing Continuous Integration, Martin Fowler presented failure to run the application's suite of unit tests as a compelling reason to fail a build.

shadit
+6  A: 
  • Compilation failure
  • Unit tests
  • Integration tests
  • System tests
  • Naming conventions
  • Code quality
  • Regression tests
flybywire
+5  A: 

Unapproved Checkins in Build. Things like code checked in that is not associated to a work item or a bug fix.

GWLlosa
+1: Often overlooked, but very useful in a team environment where support is a daily concern.
Mike Burton
+1  A: 

Introducing a cyclical dependency between modules (eg java packages).

Brian Laframboise
+1  A: 

My company doesn't actually do this, but with a large legacy codebase like ours, it would be good to fail on undocumented changes. Without a bug ticket of some kind, our QA department wouldn't know to test the changes, and that is scary!

David V McKay
+1  A: 

Check for duplicate classes (same package and class name) in different jar files (Java).

Alexey Kalmykov
A: 

Code coverage decreases or falls below an acceptable threshold.

Brian Laframboise
+2  A: 
  • Compilation failure
    • Production code
    • Tests classes
  • Any kind of tests failure:
    • Unit tests
    • Integration tests
    • Functional tests
    • Performance tests
  • Non conformance to quality checks:
    • Coding convention (Checkstyle)
    • Test coverage (Clover, Cobertura, etc)
    • Bug patterns detection (FindBugs, PMD, Hammurapi)
    • Copy Paste detection (CPD, Symian)
    • Binary compatibility (Clirr)
Pascal Thivent
+1 for mentioning coverage
Chris O