When a smoke alarm (also called smoke detectors) looks as yellow as this one, it is very likely over 10 years old. According to the NFPA, all smoke alarms that are more than 10 year old should be replaced.
An easy indication that a smoke alarm is rather old is the discoloration of the plastic. But every smoke alarm has a date of manufacture printed on the back side of the device. According to the NFPA, almost 1 in 5 smoke alarms throughout the USA are more than 10 years old.
If you know that the smoke alarms in your home are less than five years old, leave them in place, but make a note of their age so that everyone understands how old they are. When I inspect homes, I will be checking the age of the smoke alarms.