In act IV of Macbeth what does Malcolm do to test Macduff's loyalty?
Malcolm has only a tiny part in the play until Act 4, Scene 3, when he has a strange interview with Macduff. Before that, Malcolm only appeared with Donalbain very briefly in Act 2, Scene 3, in which they both express their fears and both decide to flee in separate directions. Shakespeare is finally forced to make something more of Malcolm as a character, since he will be raising an army to overthrow Macbeth and claim the throne which is rightly his. Oddly enough, Malcolm gives Macduff a horrible picture of himself, beginning with:
But, for all this,
When I shall tread upon the tyrant's head
Or wear it on my sword, yet my poor country
Shall have more vices than it had before,
More suffer, and more sundry ways than ever,
By him that shall succeed.
It is myself I mean, in whom I know
All the particulars of vice so grafted
That, when they shall be opened, black Macbeth
Will seem as pure as snow, and the poor state
Esteem him as a lamb, being compared
With my confineless harms.
Significantly, he tells Macduff:
Than such an one to reign.
Some critics have explained that Malcolm is "testing Macduff's loyalty," which may seem feasible since he subsequently disclaims all the evils of which he has accused himself. However, the main purpose of Malcolm's really incredible self-incriminations--especially since he is in England to seek help to regain the throne--is not to test Macduff's loyalty but to explain to the audience why Malcolm failed to claim the throne right after his father was killed.
Duncan had specifically stated that Malcolm was next in line for the kingship.
We will establish our estate upon
Our eldest, Malcolm, whom we name hereafter
The Prince of Cumberland (Act 1, sc. 4)
When Malcolm and Donalbain both flee from Dunsinane, they give Macbeth a golden opportunity to blame Duncan's murder on them and to claim the throne. Shakespeare must have realized that his audience would wonder why Malcolm didn't immediately assert his rights and ask the assembled thanes to support him--as they undoubtedly would have done out of loyalty and sympathy. Shakespeare is attempting to establish that Malcolm didn't do this because he didn't consider himself worthy to be King of Scotland. So in this interview with Macduff, Malcolm improbably accuses himself of every conceivable kind of wickedness and then, equally improbably, disclaims his entire litany of self accusations.
Malcolm, one of Duncan's sons and therefore one with a rightful claim to the throne, talks with Macduff as he realizes that something must be done about Macbeth. He explains to Macduff that "our country sinks beneath the yoke; it weeps, it bleeds.."
He is not fully confident of Macduff's allegiance as Macduff " lov'd him well" and is perhaps scheming with Macbeth "To offer up a weak, poor, innocent lamb / T'appease an angry god" and must find a way to ensure that Macduff is not on Macbeth's side.
Malcolm also questions Macduff's motives in abandoning his family - "those precious motives, those strong knots of love, without leave-taking?"
Malcolm goes on to paint a bleak picture of himself, a worse scoundrel than even Macbeth who will "seem as pure as snow" compared to him who will "pour the sweet milk of concord into hell."
Macduff is shocked and worried for his country but
Malcolm is the rightful heir to the throne and Macbeth must be unseated at all cost.
Even after Malcolm's portrayal of himself and his apparent need to "blaspheme his breed", Macduff will not entertain the idea of leading Scotland himself and would rather be "banish'd." Macduff speaks highly of Malcolm's parents and despite Malcolm not being fit to be king ("by his own interdiction stands accurs'd") he cannot reconcile himself with any of his own grand ideas.
Malcolm is now convinced that Macduff is a "Child of integrity." He reassures Macduff that he is not all the terrible things he claimed and that he was just testing Macduff's loyalty. It is a lot for Macduff to absorb. Now however they can fight Macbeth to restore Scotland.