Overview
A good cost function accurately represents which solutions are preferable.
Clarifying the cost function may be a truly difficult step in developing your application if the cost function provided to you is not really representative of a good solution for the client.
The client may be mainly interested in a good solution, but as a programmer, you need a good cost function accurately representing what a good solution is. Even if your client supplies a cost function as part of the specification, you may need to look more closely at it or modify it in some respect.