Anyone interested in the relationship between Elia Kazan, Arthur Miller, the writing of The Crucible and the now-orthodox reading of On the Waterfront as a response to testifying at HUAC should absolutely read Stacy Schiff's piece in the New York Review of Books:
Miller made clear that he thought Kazan naive. He was about to humiliate himself and sacrifice others to a band of cynical fanatics who comported themselves like mobsters but lacked the moral code even of that trade. The panic would subside, Miller insisted. He had not held his friend’s earlier, private HUAC testimony against him. It was consistent with his integrity. But Kazan acted now from fear rather than conviction. He was morally in the wrong. Miller felt, as he put it decades later, “a quiet calamity opening before me in the woods.” […]