During the sprint review the product owner may say that a particular story is incomplete or the team itself may not have completed some committed tasks.In what situations do you leave the code in the build?  If the code is left in the build, is this a conscious decision made during the review?  In other words, do you discuss this issue during the review?Are there specific instances where code should be removed?
Should code from an incomplete story be removed from the build?
agile;stories
An incomplete feature should come out. But if this can be done without removing the code (feature flags, just removing the wiring, etc.) then that's fine -- preferable, in fact. Why? Because it limits the changes to a product which is already mostly-tested.I would recommend that, if a story is medium-to-high risk, developers should always code with its possible removal in mind and make sure that task is as risk-free as possible.