This article talks about cell mediated immunity whereby compromised cells are detected via peptides produced, but there's actually another mechanism that's still in the early stages of being understood called merocytophagy where an immune cell can partially "eat" another cell to see if it "tastes" sick.