Wikisimpsons - The Simpsons Wiki
Bart needed a project for the science fair when he saw Martin hanging from a tree. Martin agreed to help Bart and started to put ideas together. Bart came up with the Homer Humiliator, a device which is designed to humiliate Homer, however, Martin doesn't see the practical use of it. Bart then came up with an idea for a robotic pet (after seeing Santa's Little Helper with a Darth Vader mask on). Together, they made the robot, in the design of a baby seal as everyone goes "awwwww" when they see them. After turning it on for the first time, it tried to attack Bart, and Martin changes a wire around inside it and it becomes nice.
After taking it to the science fair, they win first prize, beating Lisa's scientific discovery that a meteor would strike Springfield years in the future, wiping them out, much to Lisa's annoyance. Principal Skinner loved it, and both he, and Gary Chalmers, thought it was a lot better than Lisa's gloomy project.
Bart then takes the Robopet to the Springfield Retirement Castle when it is an instant hit with Jasper Beardley, making him a lot happier as he had been very depressed lately. Bart then mass produces them and all the residents have them. By this point, Bart had gotten enough money to make his original idea for a project, the Homer Humiliator. However, funeral directors dislike that less old people are dying because they are happier and reprogram them to make them kill the old people, one of them killing Alice Glick. More deaths mean more business for them.
Bart and Martin go to Professor Frink to ask him to reprogram them again from their prison cell. He enlists the help of Benjamin, Doug and Gary. Together, they reprogram them and make them escape from prison, move through Springfield, and back to the Retirement Castle. The old people were happy to be reunited with their pets and started to dance.
 Behind the Laughter