Would showing up only for tests be frowned upon by most professors?
Depending on class size, most professors won't notice if students are missing or not. When I miss someone, then this person has been active before and then I would miss him/her, but if this happens, I usually ask them if there are problems.

The other view on it is: If attending the lecture gives no benefit, then the professor should ask himself/herself why they are teaching like this. For example, I have some of my lectures on video and students can freely decide to show up or watch the old videos. Still, most are showing up and they usually are having better grades then the ones which don't show up. But this is not because I dongrade the others, it's because they understand the topics more deeply thanks to the disussions in the lectures.