Warp strafing
Warp strafing is a theoretical battle tactic invented by Star Trek fans. The tactic has not appeared in canon.
Theory
In theory, a starship light years away would orient its bow with an enemy vessel. It would then go to warp speed. When the enemy starship was in weapons range, the starship would fire at the enemy vessel and immediately change course to avoid collision.
Usage
Warp strafing has never been observed in any Star Trek episode. If it were a useful battle tactic, it would likely have been observed in the many thousands of hours of footage of Star Trek.
Often Elaan of Troyius is cited as an example of a canonical warp strafe. This argument rests on the assumption that because the Klingon vessel is at warp, and the Enterprise at impulse, the Enterprise must be many times slower. This argument is wrong. Sulu counts down the distance between Enterprise and the Klingon vessel in tens of thousands of kilometers over several seconds, indicating the relative velocity between the starships is less than c. In other words, this incident is just like any other warp battle in Star Trek, with one starship pursing another in warp.
The word impulse in Star Trek does not necessarily mean slower-than-light, as evidenced in several examples including Best of Both Worlds Pt. II where the Enterprise-D drops out of warp at the edge of the solar system and shortly enters Earth orbit, necessitating faster-than-light impulse. Elaan of Troyius is not an example of a true warp strafe, which would involve one starship at rest or near rest relative to another approaching faster than light.
The Picard Maneuver is sometimes cited as an example of warp strafing. It is not a warp strafe, as the Picard Maneuver specifically involves dropping out of warp before firing weapons.
Physics
The critical problem with warp strafing is relative speed, a topic covered in Junior High School physics courses. Suppose car A approaches car B while at 50 km/h. Further suppose car B is traveling at 49 km/h in the same direction. The relative speed between car A and car B is 1 km/h.
However, a car traveling at 100 km/h compared to a car traveling at 20 km/h in the same direction is truly approaching at a relative speed of 80 km/h.
This is important because Star Trek starships of every faction have difficulty locking onto much slower and predictable targets. Attacking a vessel traveling many orders of magnitude faster than what your weapons directors are designed for and capable of will not result in firing solutions.
In short, all evidence Star Trek ships could not hit their targets if they attempted a warp strafe as a relative velocity above lightspeed is well beyond their weapons' targeting capability. Starfleet Captains themselves seem to know this, as they never attempt to warp strafe.
Stationary Targets
Warp strafing would be ineffectual against stationary targets. If a target were stationary, the attacking starship could simply sit and fire torpedoes without the strafe. Secondly, stationary and heavily defended targets such as battle stations, weapons platforms and fortified planets could track the attacker with faster than light sensors. Any vessel attempting this tactic would move in a predictable straight line, a so-called "attack run." Unless the attacking vessel further complicates the attack run with change of course and acceleration, the defender could track the attacking vessel just as easily as the attacking vessel could track it, with the added advantage of being stationary and diverting power to shields.
Conclusion
In summary, warp strafing requires the attacker have far more advanced propulsion, sensor and weapons technology than the defender. If this was the case, it is likely a more conventional approach would succeed just as well. The attacker could simply stay at stand-off range and pelt the defender with missiles, without the need for a dangerous approach.