I’ve seen the “Testing iPhone app with limited network access” (link) question, and while it’s a great tip, it’s not very helpful in terms of testing the actual performance of a piece of code when used over EDGE. In my experience the network will randomly come in an out of connectedness. I’d like some way to simulate this. I’m thinking of something like how sqlite does automated testing of malloc.
These instrumented mallocs can be set
to fail only once and then start
working again, or to continue failing
after the first failure. OOM tests are
done in a loop. On the first iteration
of the loop, the instrumented malloc
is rigged to fail on the first
allocation. Then some SQLite operation
is carried out and checks are done to
make sure SQLite handled the OOM error
correctly. Then the time-to-failure
counter on the instrumented malloc is
increased by one and the test is
repeated. The loop continues until the
entire operation runs to completion
without ever encountering a simulated
OOM failure. Tests like this are run
twice, once with the instrumented
malloc set to fail only once, and
again with the instrumented malloc set
to fail continuously after the first
failure”
I’ve done a bit of Googling but I wondered if there was a good tool for doing this. I’d like to simulate with my dev machine as the server and the iPhone connecting via WiFi.
Craig Hockenberry posted a script here that will let you test varying levels of network performance using the simulator. It also mentions some tricks for testing on the device itself.