What is the logic behind the division into groups of anions and cations in qualitative inorganic analysis?
What is the logic behind the division into groups of anions and cations in qualitative inorganic analysis?


There is a somewhat established classic procedure of qualitative and quantitative chemical analysis (also known as "systematic analysis") based on treatment of the solution by specific set of reagents in specific order. Cations are divided into groups based on the stage they are detected in the procedure. There is NO other logic behind this division, nor it has any meaningful chemical significance.


  Also, how does one get at the various tests, like, did people use to test every possible reagent or combination of reagents and see if something happens or is it deducible? 


Somewhat deducible. Solubility product constant can be used to check if the solution is prone to precipitation of particular salt barring cases of redox reaction. For redox reactions standard electrode potentials and Nernst equation might be used for a quick check. Still, knowledge of these particular constants is mostly (if not completely) empirical.