The COD test involves the oxidation of organic compounds in a water sample using a strong oxidizing agent, typically potassium dichromate in an acidic medium. The sample is heated to promote oxidation, and the amount of oxidant consumed is measured. The difference in the amount of oxidant before and after the reaction is used to calculate the COD value, usually expressed in milligrams per liter (mg/L).