The Opportunity rover landed on Mars eleven Earth calendar years ago today, and it still works fine after driving ~42 km! This is the farthest any off-planet vehicle has gone so far. Oppy's mate Spirit was mobile on the Red Planet for over five years and then functioned as a stationary science platform for another year before getting killed off by a Martian winter it couldn’t avoid. Amazing engineering that keeps working year after year without a technician so much as touching it.
At the moment Oppy is still exploring the rim of Endeavour crater, where it's spent several years. The rover recently broke its altitude record when scaling the high part of the rim known as Cape Tribulation. It is now headed towards a promising geological site known as "Marathon Valley" -- because Oppy has almost run a marathon by now. Check out the project's web site for news!
From the point of view of electronics design, you make your instruments with radiation-hard electronics. Infant mortality is still an issue, but with reasonably hard electronics you can keep going for quite a few years, even without a magnetic field to protect you from solar energetic particles and cosmic rays. Low Earth orbit can be harder to pull off; too many trips through the South Atlantic Anomaly (especially the part connected to the Van Allen belts) will eventually fry your electronics, no matter how hard you made them.
They also test the hell out of instruments before launch. Vibration, thermal cycling (in vacuum there's only radiation to get rid of excess heat, so hot spots on the spacecraft stay hot and cold spots stay cold), and other extreme environmental tests are routine.
Also, the software successfully dealt with problems that would have messed up earlier generations of computers (I do not know the details).
Add a pattern-recognition chip like "TrueNorth" and a rover can move independently without waiting ten minutes for commands to go back and forth between Mars and Earth.
One challennge is how to keep moving parts moving without a technician to take things apart and clean out the dust. Current robots are nowhere near this ability.
It's a shame she seems to have lost her login details.
Tiny helicopter could be 'scout' for Mars rovers http://phys.org/news/2015-01-helicopter-scout-mars-rovers.html