Although the ancient Greek were the first to discover magnetism in a mineral they named magnetite, the use of it for testing parts didn't happen until much later. Magnetite comes from the word Magnetos, which is the name of a Greek mountain that is rich in this mineral. As time goes by, slowly people start to understand magnetism, the properties of magnets and their many uses. The first scholarly text written on magnetism was written by a french man named Pierre de Maricourt in 1269!
later in 1868 S.H. SAXBY describes in the journal Engineering how he uses a magnetized needle to detect longitudinal cracks in tubes. Flaws were found on magnetized gun barrels by moving a compass along the length of the barrel. This is the earliest known use of magnetism to check parts and S.H. SAXBY called this process "damage-free inspection".