What happens when the code is compiled and executed?

How can the code be compiled and executed for testing?