If you are looking to test a Spectrum (16k, 48k, Plus, or 128k), these are the standard programs used by the community.
When creating software for the ZX Spectrum today, the "test program" can range from a simple diagnostic tool to check your hardware to a sophisticated unit testing suite for new Z80 code. Recommended ZX Spectrum Diagnostic & Test Tools
If you are looking for programs to test hardware functionality (RAM, ROM, keyboard, ULA), these are the primary links: