Software testing is a part of the process in software development life cycle (SDLC). Nowadays, the size of software developed grow larger and bigger. The cost of testing with manual method which is not efficient become significant. A good algorithm or method which is less time consuming and lower in cost is important to solve this problem. However, although there are different kinds of algorithm available for us to apply, which algorithm is better for generating test cases is still not confirmed. This research is carried out in order to find out and compare two algorithms which are Depth First Search and Backtracking. The time taken for both algorithms to generate test cases or test pathways are recorded and compared. Three applications were used as three cases to gather more results in different size of application. The results show that the Backtracking algorithm can achieve better and faster runtime results due to the algorithm require lesser loops than the Depth-First-Search algorithm while the number of loops and test pathways are fixed.