Apple computers ship with a pre-installed suite of hardware diagnostic tools, known as Apple Hardware Test (AHT). In principle you can start them by holding the d key while booting. Newer models support holding option d to load AHT over the internet. Refer to the official Apple documentation for details: Using AHT on Intel-based Macs, Mountain Lion, Mavericks and Yosemite. Apple redesigned the AHT, now called Apple Diagnostics, for Macs introduced after June 2013. Consult the reference codes to interpret the results. If however, you reinstalled an older computer from scratch, the diagnostic tools might no longer be available. Unless you have the original disks that came with your computer, there seems to be no way to restore the AHT.