In order to maximize ROI out of any quality framework the organizations must track the cost of quality continuously and maintain their cost of quality at an optimum level. What is this optimum level and how to find it out? Before delving into this, let’s understand what is cost of quality?
Cost of quality of a software product comprises of four components: prevention costs, appraisal costs, internal failure costs, and external failure costs. Each of these is discussed in details below.
Prevention costs are investments made ahead of time in an effort to ensure conformance to requirements. Examples include activities such as orientation of team members, training, quality planning, and the development of project standards and procedures.
Appraisal costs include the money spent on the actual testing activity (Unit,Integration and system testing). Any and all activities associated with searching for errors in the software and associated product materials falls into this category. This includes all testing: by the developers themselves, by an internal test team, and by outsourced software test organization. This also includes all associated hardware, software, labor, and other costs. Once a product is in the coding phases, the goal is to do the most effective appraisal job, so that internal failure work is streamlined and well-managed and prevents skyrocketing external failure costs.
Internal failure costs are the costs of coping with errors discovered during development and testing. These are bugs found before the product is released. As we mentioned previously, the further in the development process the errors are discovered, the more costly they are to fix. So the later the errors are discovered, the higher their associated internal failure costs will be.
External failure costs are the costs of coping with errors discovered after the product is released. These are typically errors found by your customers. Example: processing customer complaints, customer returns, warranty claims, product recalls. These costs can be much higher than internal failure costs, because the stakes are much higher. Errors at this stage can also be costly in terms of your company’s reputation and may lead to lost customers.
Organizations generally are reluctant to invest in Prevention costs because they rarely have a quantifiable way to evaluate what their "failure" costs really are. Studies have shown that the further along in the process that quality is worked into the product or service, the higher the cost of quality. For example, if a system were to be delivered untested to a customer, the cost of quality to that point would be minimal. However, once the system went live and the inevitable bugs appeared, the operational costs to the customer, rework and damage control costs, and the resulting cost to the professional reputation of the delivery organization, would far outweigh any prevention or appraisal costs that might be incurred upfront.

The diagram above illustrates the relationship between the cost of product and the quality of performance.
It highlights three important points.
1. Insufficient investment in quality management results in excessively high costs related to defect correction.
2. There is a point above which additional investment in quality management proves uneconomical.
3. There is a level of service quality at which the total cost of quality is minimized.Finding this optimum level and then operating at, or above, this level should be our goal.In order to operate at this optimum value the organization’s accounting system needs to track all the components of cost of quality.
The conclusion is that we should try to reduce the overall cost of each product or service, by establishing the optimum level of preventive and appraisal cost that minimizes resultant error costs. The net result of quality improvement should be a re-allocation of costs across the cost of quality categories resulting in a reduction in the overall cost of quality.