Designing a Diode and resistor tester

For ≈ $20 you can buy a commercial unit based on Arduino.

Google Arduino component tester.