That's not quite true.
If it's on a ring (two "red" and two "black" wires, or brown and blue if recent, and two Green&Yellow) then one of each could have fallen out and it would still work.
If you are doing a rewire, you test for continuity with a simple meter and that will tell you if the ring is unbroken. If you have a low ohms meter you can test the resistance (which should be the same for the red and the black, and about 50% higher for the G&Y) which can indicate if there is anything else untoward. Rings do sometimes get broken, e.g. from a loose connection, or a damaged cable or accessory.
If you are just replacing a single socket, you can do a continuity test (the two reds will have continuity; the two blacks, and the two G&Y) which will tell you if you have an unbroken ring apart from the socket you have just removed.
I don't know a way to test that you have connected the new socket properly, other than by inspecting it carefully (unless you disconnect somewhere else). But I think that even for an amateur repair, it is a good idea and easy to test for continuity every time you take a socket off the ring, e.g. for replacement or when decorating. You can do this with a simple multimeter that should cost less than £10.
Continuity tests like this only work on rings, not on lighting or radials, or on spurs.
To get an idea if the earth is connected, you can use a plug-in socket tester which costs in the region of £8 and will be in your DIY store or hardware shop. These testers are not very precise though, and will only detect certain gross errors.