Software testing is considered as an essential and critical part of the software development process. To improve the efficiency of software testing, the test case prioritization (TCP) technique is usually used to preprocess the test case set, which is formulated as a single-objective or multiple-objective optimization problem and solved by swarm intelligence algorithms. In this paper, we adopted one of the state-of-art swarm intelligence algorithms — Artificial Fish School Algorithm to solve the TCP problem. Specifically, the coding method of artificial fish school was designed in combination with the test case set; the Average Percentage of Test-point Coverage and Effective Execution Time were selected to optimize the design of clustering behavior, foraging behavior and tail-chasing behavior of artificial fish school; the optimal solution was found by population iteration. Empirical evaluation was conducted to analyze the performance of the proposed method. Comparison experiments were also carried out, and the experimental results showed that in terms of both single-objective and multiple-objective, the Artificial Fish School Algorithm could better solve the TCP problems and improve the efficiency of software testing.