@FastJack: Yes, they're part of the same complex action, along with everything else in the spellcasting procedure (SR4A, pps. 182-184).
1. Choose a Spell.
2. Choose the Force.
3. Choose the Targets. This is where you establish the magical link. In general, you can use sight, astral sight, touch, or (at GM's discretion) other senses. Unless you're visually targeting something obvious, you need to win an appropriate Perception test or an Unarmed Combat touch attack. If it's a touch spell, the touch attack is your only option. If you fail, then you have no magical link, no target, no spell at all.
4. Make Spellcasting Test.
5. Determine Effect. This is where you apply resistance, Counterspelling, and everything else that opposes the Spellcasting test.
"Same action" is different from "same test."
@voydangel: I agree, if I'm understanding you correctly. Unarmed vs defense in Step 3 to establish link, Spellcasting vs defense in Step 4-5 to determine effect? Dakka & I think it's a bit odd to roll the defense twice, though, with exactly the same modifiers, against essentially the same attack. Therefore, we were thinking of reusing the Step 3 defense in Step 5.