This test is also known as the isocyanide test. Aliphatic and aromatic primary amines when warmed with chloroform and an alcoholic solution of KOH, forms isocyanide or carbylamine which have a very unpleasant or foul smell. Secondary and tertiary amines do not give this test. This reaction is a  test for primary amine. Therefore, this test can be used to distinguish between primary amines from secondary and tertiary amines.R-NH2 + CHCl3 + 3KOH (alc.) → R-NC + 3KCl + 3H2O