How do you test real time system

In multitasking real time system How do you verify that each task is being executed at the right time and order?

It depends on your application requirements - you can write a test which fails if something is not done within a timeline. You can take a look at some of our tests - FreeRTOS/FreeRTOS/Demo/Common/Minimal at main · FreeRTOS/FreeRTOS · GitHub

In addition, there are third party tools like Tracelyzer which provide you great visibility into the timing and everything else.

Thanks.