create validate() function and create array data input for run unit test