Is my above scenario contrived, yes. Is it demonstrative of the kind of ethical questions that are going to have to be answered by developers, rather than individuals. It absolutely is. If you note I'm not even dismissive of "self driving cars", I only point out that its going to be INTERESTING if we ever see them.
The reality is that at some point, some where, some piece of software is going to have to make a very hard choice. The road will always have exposure to irrational actors (kids, drunks, a random person crashing their bike).
Are we at a point where we WANT software making that decision? If I have terminal cancer I might make a different choice than if I just had a baby and I was a human behind the wheel. Will we be able to inform the system that were willing to commit self sacrifice? Is there going to be weighing on the system based on ages of those involved? What happens when someone decides to kill themselves by jumping in front of a self driving car?
Lets forget about the legal battle that ensues the first time this happens. We will pretend that no lawyers will be allowed to be involved. The guy who wrote the code that said 4 kids > granny do you tell him? Maybe you have to go back and tell him his code killed 4 kids, and NOT granny and he has to fix it, cause that was wrong? I saved 32,999 people in THEORY but I know my code killed 4, they told me, it was a bug, I have to fix it now.
Lets look for a real world example where we see some of this today. Train drivers kill people on a fairly regular basis. Some times its because people choose to kill themselves, sometimes it really is an accident where there was no intent on the part of the person killed. Do you know what happens to those folks? Do you realize the impact these actions have on their lives? They certainly do, its part of the job, they get training before they go out and drive, the get counseling after. For some of them IT DOESNT HELP. Stats aren't people, they don't react the way we want or expect.
Like I said it is going to be INTERESTING.