A solution of #"I"_2# is added to a small amount of your unknown, followed by just enough #"NaOH"# to remove the colour.
The formation of a pale yellow precipitate of iodoform (with a characteristic "antiseptic" smell) is a positive result.
#color(red)"MECHANISM:"#
1. OH⁻ removes an acidic α-hydrogen.
#"RCOCH"_3 + color(aqua)("OH"^"⁻") ⇌ color(green)("RCOCH"_2)^"-" + "H"_2"O"#
2. The enolate ion displaces an #"I"^"-"# from #"I"_2#.
#color(green)"RCOCH"_2^"-" + "I-I" ⇌ color(orange)"RCOCH"_2"I" + "I"^-"#
The process repeats twice more.
3. #color(orange)("RCOCH"_2"I") + color(aqua)("OH"^"-") ⇌ color(blue)"RCOCHI"^"-" +"H"_2"O"#
4. #color(blue)"RCOCHI"^"⁻" + "I-I" → color(maroon)"RCOCHI"_2 + "I"^"⁻"#
5. #color(maroon)"RCOCHI"_2 + color(aqua)("OH"^"⁻") ⇌ color(purple)"RCOCI₂"^"⁻" + "H"_2"O"#
6. #color(purple)"RCOCI"_2^"⁻" + "I-I" → color(fuchsia)"RCOCI"_3 + "I⁻"#
7. A hydroxide ion adds to the base of the carbonyl.
#color(fuchsia)("RCOCI"_3) + color(aqua)("OH"^"⁻") ⇌ color(lime)("RC"stackrel("-")"O""(OH)CI"_3)#
8. The carbonyl group re-forms and eliminates a #"CI"_3⁻# ion.
#color(lime)("RC"stackrel("-")("O")"(OH)CI"_3) ⇌ "RCOOH" + color(olive)("CI"_3^"-")#
9. The acidic #"RCOOH"# and the strongly basic #"CI"_3^"-"# ion are neutralized.
#"RCOOH(aq)" + color(olive)("CI"_3^"-")("aq") → "RCOO"^"-""(aq)" + color(red)("HCI"_3)"(s)"#
The overall equation is
#color(red)("RCOCH"_3 + "3I"_2 + "4OH"^"-" → "RCOO"^"-" + "3I"^"-" + "3H"_2"O" + "HCI"_3)#
The reaction also gives a positive test with secondary alcohols of the type #"RCH(OH)CH"_3#, because they are oxidized under the reaction conditions to methyl ketones.
#"RCH(OH)CH"_3 + "I"_2 + "2OH"^"-" → "RCOCH"_3 + "2I"^"-" + "2H"_2"O"#
If #"R = H"#, the reactants are #"HCOCH"_3# (acetaldehyde) and #"HOCH"_2"CH"_3# (ethanol). They also give the iodoform test.