18

Not sure if it was 2016 or late 2015, but it's a fun story anyway (and if it's not you'll at least learn something from it).

Back at the time I was quite new to unit testing (weird how it has become second nature in a years time). I was writing some software that was supposed to send out some SMS to customers. Of course this had to be tested. However, it was a bit difficult to test (or so I thought) without actually receiving an SMS to know if it was sent. So I decided to use the live API key to make sure the sending of SMS was actually working correctly. I tried it a few times but didn't receive an SMS. So I kept working on it and running tests.

The testing setup I had at the time was just a continues loop that went through all tests to make sure it all still worked (I've moved to only checking on file changes now, but that is besides the point). Keep in mind I was still running these tests, in a loop, with the _live_ API key.

So the end of the working day arrives and I go home and sit in the train. All of the sudden I receive some test SMS. I was thinking "hey nice, it did work". Then I started receiving more. It soon turned out to be an alarmingly big amount of SMS. It stopped around 100, but don't think that was the end of it. Oh no. I had changed the number to send the SMS to from my own number to a different number (+31612345678 to be exact, which I found out later isn't an actual phone number. I really hope I was right about that). I was beginning to become nervous, but there wasn't much I could do.

The next day I returned to work and checked the API for sent SMS. Turns out I had sent a couple of thousand (I think between two and three thousand) SMS in a couple of hours. Most of them to the test number I had supplied.

This probably cost the company a couple of hundred euros. Luckily my colleagues and team leader all thought it was pretty funny, but did tell me not to do it again. And I haven't of course.

Lesson learned: don't use live API keys during testing (among other things :)).

So yeah that was probably my worst dev experience.

Comments
  • 4
    This makes me think of a truely stupid thing our test team has done.

    I worked at a company making cell phone chips. So an important test would be testing our product works well with the operator around the world. Basically we need to make sure we can successfully make phone calls in different countries.

    The problem is, which number should be called? Our test team make a SMART decision: let's call to 112! It's free, there is always someone pick up the phone, 24/7, and the same number works all around the world! How amazing!

    So we have done a couple of stress tests to 112, worldwide. And yeah, officially warned by local government and probably be fined A LOT in some of the countries.
Add Comment