This paper introduces the technique to select the test cases from the unified modeling language (UML) behavioral diagram. The UML behavioral diagram describes the boundary, structure, and behavior of the system that is fed as input for generating the graph. The graph is constructed by assigning the weights, nodes, and edges. Then, test case sequences are created from the graph with minimal fitness value. Then, the optimal sequences are selected from the proposed fractional-spider monkey optimization (fractional-SMO). The developed fractional-SMO is designed by integrating fractional calculus and SMO. Thus, the efficient test cases are selected based on the optimization algorithm that uses fitness parameters, like coverage and fault. Simulations are performed via five synthetic UML diagrams taken from the dataset. The performance of the proposed technique is computed using coverage and the number of test cases. The maximal coverage of 49 and the minimal number of test cases as 2,562 indicate the superiority of the proposed technique.