add test tools and make global class and function

add test tools and make global class and function