Goodness-of-fit and two sample comparison tests using sample