There is no advice like bad advice. And, I'm sorry to say I've seen plenty of that in some of the replies.
Since I am the only one who can say he or she actually sits as a traffic court judge, here is my 2 cents. I will not, however, give specific advice.
In my courtroom in California, if the cop does not show up, then the People cannot possibly prove their case (absent a statute which might make an exception). In that event I dismiss the case.
If the cop shows up, the cop testifies first. I listen carefully. If the cop does not testify as to every element of the offense, I don't need to hear what the defendant has to say and I dismiss the case. For example, in certain instances, the cop must testify to being in uniform and to being in a marked patrol car. In such an instance, if the cop misses one of the points, the case is over. It is rare that a cop misses an essential element. It most often happens if a new prosecutor questions the cop and fails to ask about a uniform or marked car.
The next step is for the defendant to cross--examine the cop, i.e. to ask questions that have a bearing on the case. The point of cross-examination is to challenge the cop's perceptions, could the cop actually see what happened; does the cop actually recall everything (or is the cop reading from the ticket), etc. Sometimes, this can help show the cop did not see what happened immediately beforehand.
Occasionally, cross-examination will persuade me that I should disregard what the cop said on an essential element. In that case, I dismiss the case.
In 95% of the cases, the cop has said enough to get the point where the defendant tells his or her side. To prevail, the defendant needs to do one of two things: (1) provide evidence which gives me reasonable doubt as to at least one essential element, or (2) establish some overriding defense.
In 90% of the cases that get that far, I find the defendant guilty simply because the defendant's own testimony supports what the cop said. For example: "Everyone drives that fast;" "It was safe to read the newspaper because traffic was so slow;" "I came almost to a complete stop at the stop sign;" "I'm such a good driver that it was not unsafe for me to be that close to the car in front of me."
As far as overriding defenses, there are things like "entrapment." That is where the government has created a situation that forces someone to violate the law. Putting up a small "No Left Turn" sign where there has been none before, may fall into this category. A left turn pocket that is too short to accomodate everyone who wants to turn left, combined with a short left turn arrow, may fall into this category. Another defense would be avoiding an acciident. For example running a red light because you see the car behind you skidding trying to stop and realizing it won't may be a defense. Speeding to avoid someone who is shooting at you (not uncommon in California) may be a defense. Speeding to take a gunshot victim to the hospital may be a defense.
The problem with the defense of "necessity" is proof. Often, the cop will testify to facts other than those which support the defense. For example, with the red light mentioned above, the cop may say he or she did not see any other vehicles. Or if there is no gunshot victim in the car, saying you are taking a gunshot victim to the hospital does not work.
At the bottom line, there are three things to remember: (1) You are probably your own worst enemy. (2) If you deny doing something, it is hard to persuade a judge that you did it out of necessity / if you claim necessity and are disbelieved on the necessity, you will be found guilty. (3) If traffic school is an option that avoids loss of your license and/or an increase in your insurance premium, take it, you will probably benefit from it. (Note: Many judges will not let you ask for traffic school if you wait for the day of trial and so you can see whether the cop shows up or not.)
Best luck and let us know how this turns out.
Edited to add: Offroadiver's advice is good advice.