Shaw explicitly presents Mrs. Warren and her daughter, Vivie, as foils for Reverend Gardner and his son. In his Author's Apology, Shaw directly addresses the fact that these characters are foils:
The dramatic reason for making the clergyman what Mrs Warren calls "an old stick-in-the-mud," whose son, in spite of much capacity and charm, is a cynically worthless member of society, is to set up a mordant contrast between him and the woman of infamous profession, with her well brought-up, straightforward, hardworking daughter.
The Reverend and his son, on the surface, fit into a socially-acceptable mold. They do not act out these values, however—Frank is not a good person, being lazy and indolent. Vivie, on the other hand, had a socially condemnable upbringing, yet thrives according to what society considers the measure of success. This narrative opposes social Darwinism—the problematic (and unfounded) idea that certain people have higher social or moral "fitness" than others and that "morality" can pass from parent to child like genetic inheritance. Social Darwinism, a precursor to the eugenics movement, held that an immoral parent would naturally pass their immoral traits to their children. Shaw would have no doubt been aware of social Darwinism, given its prominence in his era. He counters the philosophy in this passage, demonstrating that Mrs. Warren's "immoral" traits do not pass to Vivie.