UIAutomation, nice to meet you

I wrote an app for a museum and it needs to run for a very long time without crashing. Unfortunately, it crashed after a week. (I had 3 days to write the app, and almost no time to test it. Yes, we developers always have an excuse!)

So I had a look to UIAutomation. What a revelation! I wrote a script to test my app and I was able to remove some leaks from my app, but I needed something more hard-core to test my app.

I searched the internets using DuckDuckGo, my favorite searching tool for the last year. I searched for « UIAutomation Monkey » because, being an old Macintosh developer, I remembered of the infamous « Monkey Lives » feature of the early Macs.

I quickly found « UI AutoMonkey » by Jonathan Penn.

Seeing this script clicking frantically is really fun, and helped me find some unexpected bugs.

I was able to let it run for around 6 hours, without crashing and memory usage stays constant. So far so good.

I will install the new app next week, we’ll see how it behaves.

Notes:

  • I couldn’t run the test for more than 6 hours, Instruments used 10G of memory and wasn’t showing me the memory usage of my app;
  • ARC is cool, but I feel I lost control of my app;
  • Writing an app that needs to run 24/24 without ever restarting is stressful.