In the U.S., I understand that refiners are required by law to provide a certain level of detergents and/or detergent performance (standardized testing) for all grades. But a refiner can choose to INCREASE detergents over that amount for a given grade, primarily for marketing reasons, I suspect. At least a few firms claim their premium fuels have higher detergents.
"Is there any way to determine weather an engine needs premium simply by a compresson test?" Other factors also come into play, such as prior deposit build-up, sharp edges in the cylinders (which preheat and ignite the mix), presence of knock detection, etc.