The Kolmogorov-Smirnov test is a statistical test designed to test whether a sample has been drawn form a given underlying population distribution, or whether two samples have been drawn from the same underlying population distribution.
Unlike tests like the t-test, the Kolmogorov-Smirnov test makes non assumptions regarding the specific underlying population distribution and does not single out specific moments for comparison. Instead, it compares the cumulative distribution functions (CDFs) of the sample and the distribution, or of the two samples. The Kolmogorov-Smirnov test statistic D is the maximum difference in the two CDFs.
The distribution of D can be calculated for any sample size and for large sample sizes it tends toward a simply expressible function.