Humility is an important ingredient of faith. This woman was a stranger to the covenants of promise and had no right to demand anything. Jesus' silence and then comparing her to a dog would certainly have offended an arrogant person. It is possible that Jesus wanted to try her faith.
A great part of faith is seeking God alone with our whole heart. If we are concerned about what people think and gaining their approval, we will never take a stand in faith for anything. After all we might be criticized for it. This one thing has probably stopped as many people from receiving from God as anything else. We can't be a "man-pleaser" and please God at the same time. Satan uses persecutions to steal away God's Word and stop our faith. To see faith work, we must say with Paul, "let God be true, but every man a liar" (Romans 3:4).