You would need to do a spirometry test, which measures how much air your lungs can hold, as well as a peak flow which measures how quickly you can get air out of your lungs. A doctor may also listen to your chest to see the extent of the wheezing and obstruction on your lungs.
If the asthma is linked to allergies then an allergy test may be used, like skin pricks where they put substances on your skin to see if they give you a reaction, or give you some blood tests.
I’ve never had an asthma test myself, but a friend at school once came in with a lot of red marks on her arm. She had been to the doctors and they had put lots of different allergy causing things in different squares drawn on her arm – things like dust mites and pollen – the ones that came up red and swollen were the ones that she was allergic to. Unfortunately she was allergic to quite a lot of things and they all made her asthma worse.