"If funny is a benign violation of expectations, cool is a measured violation of malign expectations," writes Derek Thompson in The Atlantic (5/23/14). Derek is summarizing his take on a "new paper in the Journal of Consumer Research" that analyzes "how brands and companies become cool in the eyes of consumers." Where humor is concerned, "benign violation" is simply the idea that "your expectations are subverted … in a way that poses no threat or sadness to the audience."
So, for example, if your friend falls down the stairs, it has humor potential only if she isn’t hurt. Similarly, puns are "benign violations of linguistic rules" and tickling is "a perceived physical threat with no real danger." Coolness, like humor, is tough to define. However, in their paper (link), Caleb Warren and Margaret C. Campbell offer this definition: "Coolness is a subjective, positive trait perceived in people, brands, products, and trends that are autonomous in an appropriate way."
Basically this "means departing from norms that we consider unnecessary, illegitimate or repressive — but also doing so in ways that are bounded." Back in 1984, Apple achieved this by saying, in effect, "you have a choice; don’t buy IBM!" (link) This also worked because enough people saw IBM as "something worth rebelling against," but not to the point of, say, violence. Such iconoclasm can be applied in reverse, as did an anti-smoking ad campaign associating tobacco use with "idiot conformity," which proved highly effective among teens.