You post regarding autonomous cars, or partially autonomous cars brings up some interesting ethical points. First, the traffic rules are intended to keep everyone safe. Safe speeds, signaling before changing lanes, stopping at signs and yielding appropriately at intersections, etc. Here is the rub though; a violation (moving violation) is usually given when a driver breaks those rules, but is more likely to be enforced when the driver is creating a danger for others.
A clear cut case of this is the violation a person can receive if they drive with snow on their car that might fly off at speed. This behavior creates a danger for others. Speed violations (too fast or too slow) creates a hazard and a danger to oneself, but more importantly for others. Failing to yield at a stop sign is a violation, even when there is no other traffic, because it can cause a danger to others.
Now, on to autonomous cars; in the scenario you describe, if ALL cars were autonomous, they would all drive the speed limit and there would be no danger. In a case where a few cars are following the "proper rules" but others are violating them, while legally all of the manual drivers are creating the hazard, it is actually the slower vehicle that is creating the danger, even if it is not inline with the legal definition of a moving violation.
Enter your actual question though, imagine a scenario where the car's software malfunctions, and the car rolls through a stop light or a sign, or fails to yield. Even though the car's sensors will likely prevent an accident, it is still a violation. Who should receive the ticket? The driver wasn't in control, and likely would not have been able to gain control by the time they realized that the car was in violation. How about the manufacturer? The manufacturer of the software? Will the car tell on itself and report the incident?
The ethics around human safety and autonomous machines that interact with us is a difficult topic, that unfortunately, the law is not quite ready for. All said, it will be interesting as some of these items come to light in the courts, and eventually in front of law makers.
Just my $.02.