It seems obvious to me, that real time tests that can gauge the approximate time of consumption are the only logical solution.
Don't rely on this. I do not think I believe this science. Someone who smokes a lot might have much more in their system(higher tolerance). Even if it has been days, that doesn't mean the test will show this. That is only one example of how it can end bad for you. I can think of others off the top of my head right off the bat which would show a distrust in relying on a prosecutor's or arresting officer's so-called test.