Compile-time and Run-time Analysis of Active Behaviors