How UVM knows "my_test" class? why/where do we need to import "my_pkg::*" that holds the class "my_test"?

In reply to uriyam:

Of course you can include this file. In your simple environment it does not make any difference.
Packaging files belonging together like agent data in a package allows you to import these data in any place you need it like a different project.