Haloform Reaction:
When a methyl ketone \(CH_3-\overset{\overset{O}{||}}{C}-R\) (even acetaldehyde) is reacted with halogen in aqueous sodium hydroxide, the ketone gets oxidised to the sodium salt of acid with one carbon less than ketone and at the same time haloform (CHX3) also gets formed.

When the reaction is carried with iodine, a yellow precipitate of iodoform is obtained.

The iodoform test is quite useful to make a distinction between certain pairs of compounds one of which respond to the test while the other does not. For example:
(i) Methanal and ethanal (Test is given by ethanol)
(ii) Ethanal and propanal (Test is given by ethanol)
(iii) Pentan-2-one and pentane-3-one (Test is given by pentane – 2 – one)