Data.normalize parameter calculation and usage

When calculating mean and std of the dataset, do we calculate it on the whole dataset including the test set or without it?

Also is normalization applied on the test/validation set or do they use something different like batch normalization?

Thank you