The Weight Distribution and Randomness of Linear Codes