Here are the reasons

 

1st cost: developing program erroneously

2nd cost: system has to be tested to detect the error

3rd cost: wrong specs/code removed, correct specs/code added

4th cost: system must be retested!