Fixed the BFS-stepwise algorithm in code style, and applied it into the new test framework style