This is a specific problem you might run into if you purchased a home with an alarm system and hard-wired smoke alarms, and if you went and disconnected the alarm system. Or if you're thinking of disabling the alarm because it's just annoying, but you're worried about what might happen to your smoke detectors.
We never got the code for our alarm, and it's something I've been meaning to ask the realtor for. Eventually, we'll have a working alarm, but in the meantime, I had to disconnect the silly thing because when the power cut out, it went into fully-armed mode, welcoming us home with a deafening horn. If you want to disarm your alarm system, find the box and unplug one of the AC wires. You might have to break into the alarm system box, which is probably in your closet, especially if the previous owners of your home did not provide a key. But, honestly, if burglars broke in, they could just shut off your main power line, too. I think some alarms have a battery backup, but if ours did, it was missing, so unplugging it worked.
The problem with unplugging your alarm is that then your fire alarms are no longer tied into the system the same way. I wanted to test mine to see if they still worked, and they did, but then there was this constant chirp. I tried replacing the battery, unplugging the smoke alarm, testing another smoke detector (which resulted in two chirping units), pressing both and either button for 15 seconds, and all the other fixes I found online.
The problem was that these were hard-wired to be part of the alarm system, and my house alarm was turned off. Therefore, what I needed to do was break back into the alarm control panel, touch the power wire to the AC slot (alarm will sound), and then cap the wire again. No more chirping. Obviously, with this kind of hassle, you're not going to test your smoke alarms weekly. However, this method might work for you if you've unhooked your home alarm and have decided to test the smoke detectors (or replace the batteries). And it's a lot cheaper than calling an electrician.