All smoke alarm manuals I have seen say that the smoke alarm can be tested simply by pressing the test button on the unit. However some people have said this only tests the battery and sounder and that to test the smoke sensor you need canned smoke.
That is technically correct, it’s always a good idea to do an actual test of the sensor, which is what the test button doesn’t do. There are lots of smoke detector testers out there, but I’d personally recommend Smoke Sabre: according to the website for it it lacks a lot of the downsides most other testers have, such as using it too close to the detector which can damage it. Using the test button might be convenient, but it doesn’t actually test the unit like an actual fire would.
When it comes to CO detectors the only tester I know of is Solo’s C6, which I think is fairly expensive. (I’m sure there are probably others that aren’t though)