Classic ingredients of Shakespeare comedies include cross dressing, mistaken identity causing massive confusion, slapstick comedy and characters who reverse strongly held positions with hilarious consequences. Any audience that has sat through a version of this play will easily note the four characteristics. Viola is a typical Shakespeare heroine in a comedy in that she presents herself in male attire as Cesario. The theme of mistaken identity is prevalent due to Sebastian looking exactly the same as Cesario and causing all sorts of developments in the plot. Slapstick comedy is present in various parts of the play, but mostly in the subplot with the characters of Sir Toby Belch, Maria and their gulling of Malvolio. Of course, in this play, it is Malvolio who is presented as a "Puritan" who is so obsessed with his own self-importance. Thanks to Maria's stratagem, he reverses his position, becoming a ludicrous character. Note what he says after he receives the letter telling him that his mistress loves him:
Daylight and champaign discovers not more. This is open. I will be proud, I will read politic authors, I will baffle Sir Toby, I will wash off gross acquaintance, I will be point-device the very man. I do not now fool myself, to let imagination jade me; for every reason excites to this, that my lady loves me. She did commend my yellow stockings of late, she did praise my leg, being cross-gartered, and in this she manifests herself to my love, and with a kind of injunction drives to these habits of her liking. I thank my stars, I am happy. I will be strange, stout, in yellow stockings, and cross-gartered, even with the swiftness of putting on. Jove and my stars be praised.
This is such an essential ingredient of a Shakespeare comedy precisely because it exposes the folly that is at the heart of all humans. Just as Malvolio's serious, straight-laced nature is exposed as a thin veneer that covers up ambitions of marrying his mistress and becoming a lord, so often Shakespearean comedy mocks the audience through its subtle suggestion that what the audience protests is important to it might actually turn out to be a similar veneer that masks other emotions or ambitions.