1. fix calculation bugs;
2. automatically generate test script