0

I've made an application for Android and i want to proove to my teacher the solutions i've chooseen are the best based not only on the litterature but also in practice (by providing series statistiks). SO i'm wondering if someone can suggest me how to procceed to compare web services solutions like REST, KSOAP and XML-RPC in one hand and in another hand i want also to compare these parse solutions SAX, DOM and XML Pull Parser in the other hand. For now i'm proceeding that way: i'm making the same simpliest request (of course the responding servers should be the same) and mesure (RAM Consume, Time taken and..?): the amount of memory consume by the activity with that

Runtime runtime = Runtime.getRuntime();
             System.out.print( "used : " + ( runtime.totalMemory()-runtime.freeMemory() ) );
             System.out.print( "  committed : " + runtime.totalMemory() );
             System.out.println( "  max : " + runtime.maxMemory() );

The time taken to excute the request:

long start = System.nanoTime(); 
//instructions to do
long duration = System.nanoTime() - start;

but for the duration, i think it will be biased by the bandwith of the network (for web services) which will fluctuate

Also i want to know how to measure the network traffic generates by the activity but i have no idea to do that, can someone help me and tell me if i'm going in the right direction? Any other criteria i can use to compare?

And finally, is there any way to test an Android GRAPHICAL uSER iNTERFACE (performance, fonctionnality, Unitary Test like Junit) Thanks for reading

youssoua
  • 802
  • 1
  • 11
  • 20
  • How is benchmarking a Web service related to Android? – mxk Mar 16 '12 at 09:20
  • You can perform a number of experiment of both your application in the same network (for instance 100 or even more) and take the average of each for each application. Then, I think, you can present the average results. – Yury Mar 16 '12 at 09:21
  • I don't think network should be part of the equation at all. As I see it, the mutual (and controllable) parts that will affect performance are serialization/protocol format and parser architecture (e.g. streaming vs. non-streaming, push vs. pull etc.) – mxk Mar 16 '12 at 09:27
  • you are right on what you are saying, i want just to see the amount of traffic each one generates as they are basically do the same job with diffrent solutions (as if they both go pull the same data etc..). The thing is that they are not native api classes (ksopa and XML-RPC) so i want to see which use the lighter traffic – youssoua Mar 16 '12 at 09:36

3 Answers3

1

You may want to have a look at Caliper. It's a library that allows you to create benchmarks tailored specifically to your application, so they tend to be less biased than the generic X is faster than Y because of Z kind "benchmarks" you find in the blogosphere.

mxk
  • 43,056
  • 28
  • 105
  • 132
1

As for the last part of your question (UI testing), this should really go into a separate post, but anyway, this question has been asked on SO numerous times before. See for instance my answer here.

Community
  • 1
  • 1
mxk
  • 43,056
  • 28
  • 105
  • 132
0

systrace could help you as well

eeadev
  • 3,662
  • 8
  • 47
  • 100