The guinea pig (Cavia porcellus) was a small pet animal native to Earth. It was frequently used as a test subject in scientific research, and the term was frequently used to refer to persons similarly subjected to an experiment.
In 2267, after the colonists on Gamma Hydra IV had been afflicted by rapid aging, Captain Kirk speculated the Romulans had used the colonists as guinea pigs for testing a new weapon. (TOS: "The Deadly Years")
In 2372, when Starfleet tested new phaser sweeps to detect changelings on Earth, Odo was used as test subject; after a day of being shot at, he commented if they wanted to do more tests they'd have to search for another guinea pig. (DS9: "Homefront")
In 2374, after Harry Kim and Tom Paris had been copied by the Silver Blood, the mimetic Kim remarked he'd go down to the surface of their planet and let mimetic Paris play guinea pig for The Doctor. (VOY: "Demon")