The concept of test statistic is found in the theory of hypothesis testing. In a test of hypothesis, the test statistic is a function of the sample data and its value is used to decide whether or not to reject the null hypothesis. If the test statistic falls within a critical region, fixed ex-ante, then the null hypothesis is rejected.
Go to the lecture entitled Hypothesis testing for a rigorous definition of the concept of test statistic.
Previous entry: Support of a random variable
Next entry: Transformation theorem