They work in more or less the same way. Chlorine and Bromine attach themselves to harmful microbes, and kill them. The trick is to have enough of either chemical in the tub. And that's where a test kit comes in. First you take a sample from the tub, and you do a colour comparison using chemicals that react with the water.
Most kits measure a couple of aspects of water quality, so they have two chambers.
One's for PH, or acidity. The one we are talking about is the test for disinfectant levels. You compare the colour of the water with the shades on the colour chart attached to the kit to see if there's enough disinfectant in the tub. The right amounts of disinfectant are supposed to keep bathers safe. That can depend on the kits you are using and the levels you are following.