Well let's see. Defense primaries have an average damage of 10, while defense turbolasers have an average damage of 4.
When you add rapid fire though, defense turbolasers still do only 8 damage, so in terms of raw damage output the defense primaries are better.
Fightercraft typically have 20 or 30 health, so raw damage is probably more important than the number of attacks. Same for torpedoes which have 20 health. But 10 vs 8 isn't a huge difference.
Missiles only have 6 health though, so one hit from a defense primary or two hits from a defense turbolaser are the same.
All in all they're pretty much equivalent against trackers, the differences are very slight.
As a secondary weapon against larger ships, I'd say turbolasers are better. The AP mod you get from X-ray lasers is very good. Unlike shield piercing, armor piercing is 100% without any counters, and while the AI likes to use shields, you still have to get through the armor once shields are down, and all ships have armor.