What to do when things go wrong in development and how to avoid the pitfalls