How to choose the right input(s) to test my algorithm?

Suppose i want to trace an algorithm (think of it as a flowchart) to understand how it works, i need an input(s) for this algorithm, the question is: how can i determine the right input(s) that goes through all the cases ? Is there any "scientific" method to determine this input?

• This seems way too broad to me. Community votes, please! – Raphael Jan 12 '17 at 18:38
• That said, the exact problem is probably not solvable, or at least we don't know how. We don't even know how to solve it for finite automata! – Raphael Jan 12 '17 at 18:39
• Also, remember that there may be many cases. A simple sequence of $n$ ifconditionals can have up to $2^n$ paths -- and that's a harmless case! See also here. – Raphael Jan 12 '17 at 18:41