If sometimes a fasting person is required to taste the food then there is nothing wrong with that as long as it does not affect his fast and the food doest enter the throat of the fasting person.
If a person tastes the food without any need to do so then this is makhroo but it does not invalidate the fast.
Ibn ‘Abbaas said: There is nothing wrong with tasting what is being cooked or whatever. Narrated by al-Bukhaari in a mu’allaq report.
Imam Ahmad said: I prefer that he should avoid tasting the food, but if he does that it will not affect him and there is nothing wrong with that. Al-Mughni, 4/359.
Shaykh al-Islam [Ibn Taymiyah] said in al-Fataawa al-Kubra (4/474):
Tasting food is makrooh if there is no need to do that, but it does not break the fast.
The fast of the fasting person is not invalidated so as long as he does not swallow it. But a person should avoid tasting the food without any reason or need to do so.
If while fasting one has to taste the food and it reaches the stomach by accident then it does not invalidate the fast.
It says in Fataawa al-Lajnah al-Daa’imah(10/332):
There is nothing wrong with a person tasting food during the day when fasting, when there is a need to so that, and his fast is valid if he does not deliberately swallow any of it.
If the taste or smell remains, that does not affect the fast, so long as you do not deliberately swallow anything.
The reason for that is that some of this food may go down into the stomach without a person realizing, so tasting this food exposes him to spoiling the fast. Also, he may be desiring the food a great deal, so he tastes it in order to enjoy it, and he may swallow it, then some of it goes down into his stomach.
Examples of necessity are when a cook needs to see how salty or sweet the food is, and so on.
Based on this we conclude that a person is allowed to taste the food in circumstances where it is needed. Bht care must be taken in doing so. The food must not be swallowed deliberately and neither done without a reason. Also, the person must be very cautious and make sure that nothing reaches his stomach.
And Allaah knows best.