Malcolm pretends to be an evil man to assess Macduff's loyalty and trustworthiness while demonstrating that he would not be a suitable king. This test helps ensure that Macduff is genuinely committed to Scotland's welfare. Ultimately, it serves as a strategy to reveal the true character of those who oppose Macbeth. ;