You need the strength only if you want to break the subroutines (not all ICE can end the run, so you might not want to break all subroutines). So, while matching types is in theory irrelevant to increasing strength, in practice, you'll only increase strength when types match (otherwise you're wasting your precious credits).
For example, take Hunter: it is a stength 4 sentry with a subroutine that make a trace3. Since the routine doesn't end the run, you have 2 choices (with both letting you continue the run). Either breaking the subroutine or letting the corp attempt the trace. Assuming your killer (the icebreaker type that matches sentry) program is Ninja (this would be the cheapest), you're going to have to pay 3 credits to increase Ninja's strength and 1 credit to break the subroutine. If let the trace go off, you will need to pay 3 credits minus your link value plus whatever the corp pays to make the trace fail. You can also let the trace succeed and remove the tag later for 2 credits and an action (risky if the run is your last action). But if you want to let the trace go off (or if you can't break the subroutine), you don't need an icebreaker of any type with strength 4 (before of after increasing).