Live data from Hacker News

Is user a monkey?

developer.android.com

11–20 of 39 posts

Re: Is user a monkey?

#13
post #3

when i was doing Palm OS programming back in the stone age, i remember the simulator had a "monkey testing mode", where it would just generate GUI events randomly. it was actually quite useful for uncovering sporadic crashes. EDIT: ha, i found a reference, they're called Gremlins http://users.jyu.fi/~mweber/teaching/docs/palmos/book/ch10.h...

Calling them Gremlins is actually a reference to the British Royal Air Force in WWII. The airmen would blame 'gremlins' for mechanical issues or even problems during flight. http://en.wikipedia.org/wiki/Gremlin#Origins Famous children's author Roald Dahl popularized them after he left the RAF to become a writer. If you get a chance, read a biography of Roald Dahl. He truely was the most interesting man in the world.…

I remembered reading his books in my younger ages.

Re: Is user a monkey?

#15
post #8
post #3

when i was doing Palm OS programming back in the stone age, i remember the simulator had a "monkey testing mode", where it would just generate GUI events randomly. it was actually quite useful for uncovering sporadic crashes. EDIT: ha, i found a reference, they're called Gremlins http://users.jyu.fi/~mweber/teaching/docs/palmos/book/ch10.h...

That's exactly why this method exists on Android. They have a similar testing tool called Monkey: http://developer.android.com/guide/developing/tools/monkey.h...

Doesn't it defeat the testing purpose if you perform a check to take a different code path when the testing tool runs?

Re: Is user a monkey?

#17
post #15
post #8

Earlier quoted context omitted.

That's exactly why this method exists on Android. They have a similar testing tool called Monkey: http://developer.android.com/guide/developing/tools/monkey.h...

Doesn't it defeat the testing purpose if you perform a check to take a different code path when the testing tool runs?

I'll assume that it's best to put in the check after you've found a bug. Perhaps something that the monkey triggers that isn't very high on your human-customer buglist.

Re: Is user a monkey?

#18
post #15
post #8

Earlier quoted context omitted.

That's exactly why this method exists on Android. They have a similar testing tool called Monkey: http://developer.android.com/guide/developing/tools/monkey.h...

Doesn't it defeat the testing purpose if you perform a check to take a different code path when the testing tool runs?

I'd imagine there are occasional uses for it. You could use it to start the app with a particular state you wish to test with Monkey, while leaving it usable for human users.

Re: Is user a monkey?

#19
More euphonious in a ternary operator than an if clause:

value = isUserAMonkey() ? left : right ;

if (isUserAMonkey()) { ... }

For an if clause, I prefer userIsAMonkey:

if (userIsAMonkey) { ... }

Post reply on HN