Good day!!!!

i want to write a program that will be able to see if a led sensor is faulty or can i go about finding out how to get some out put from a led sensor like how mush power it gives out or something..i am really still a noob in programming and dont know how to go about making a program read error on such stuff....please help..thank you