In most cases, the LEGO EV3 program does exactly what you have programmed it to do. If you are having trouble, follow these troubleshooting steps:
1. Look over your program block by block and review your process map to make sure they match.
2. If there isn’t anything obviously wrong with your program, it is often helpful to start with a simple version of your program. Test the simple version, and then add complexity step by step, testing the program with each addition.

A technique that we use to test programs is to add a Sound block (make different sounds for true and false cases of a switch) or a Display block (to show sensor readings). These blocks can help you troubleshoot by adding feedback that will help you see how the program is functioning.

LEGO® MINDSTORMS® Education EV3 Core Set with Charger (LEGO-EV3-CORE)
NXT Sensor Adapter (BTA-NXT)
Vernier Engineering Projects with LEGO® MINDSTORMS® Education EV3 (EP-EV3-E)
LEGO® Mindstorms® EV3 Troubleshooting and FAQs