Sweetness is subjective, in order to determine whether a substance is "sweet" you'll need to test it subjectively and statistically. There are no laboratory instruments to perform the task, no absolute or even arbitrary units of sweetness. Instead we have to rely on the human tongue and the hope that if we average the findings of large numbers of tongues we can obtain useful data. The data scientists obtain will still not be in absolute units but will be expressed relative to some arbitrary standard, usually sucrose. If you're measuring a solution known to have sugar in it. You can measure the sugar using a Brix refractometry. It is commonly used to measure the amount of sugar in fruit juice and wine.
The fruit's age when picked and the length of time it is stored help determine how sweet an apple is. Choosing the sweetest variety of apple is a matter of individual taste, but sweeter is definitely a draw. There are 100 varieties of apples commercially grown in the US but according to surveys and apple growers consider the sweetest varieties of apple are the following: Macoun, Fiji and Honeycrisp. The sweetness of an apple is also determined by the ratio of sugars to malic acid.