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.