Office Hours — Today, January 5

Saturday, January 2

Jan 5
8:50 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:35 AM
Jonatan R.
has entered the room
Mark M.
hello, Jonatan!
how can I help you today?
Jonatan R.
Hey Mark
I'm re-writing our app and doing my best to add tests as I go a long, I'm trying to grok how to best write tests for a class that handles connections and queries to Parse.. I tried doing JUnit tests with robolectric but when I do the calls it complains that SSL library is missing which I can understand. Now I'm wondering if there's a smooth way to JUnit test just this class but running it on a real device. Maybe you have some thoughts or tips?
Mark M.
um, well, I have never used Parse
Jonatan R.
Or should I just do some kind of integration testing to confirm that it's working.
Mark M.
if I had to do this, I would focus on mocking out the parts that talk to Parse
9:40 AM
Jonatan R.
yes, I have others tests where I am mocking the ParseService class, but I was thinking how to best test the actual Parse call implementations
Mark M.
unless Parse is designed to run on a regular JVM, you're not going to be able test it on the JVM
so, I'd use more traditional instrumentation tests, running on an Android device or emulator
Jonatan R.
I understand. Is there a way to just use the android framework and run the test in isolation without running the whole app, like a unit test but with a running device?
A simple way... I mean I could always make a separate app I guess.
Mark M.
um, I guess I don't know what "without running the whole app" means
instrumentation testing, using JUnit, tests whatever you want to test
it only starts an activity if you ask the test to start an activity, for example
Jonatan R.
ah
9:45 AM
Jonatan R.
ok I think I can figure it out from here, thanks :)
9:50 AM
Jonatan R.
Do you prefer to run instrumentation tests on emulator or a real device?
while developing
Mark M.
well, I have a lot of hardware, so I usually test on hardware
Jonatan R.
ok, I was thinking maybe it's faster to run it on an emulator
9:55 AM
Mark M.
that probably depends a lot on the development machine and the Android device you are comparing against
Jonatan R.
yeah, I just tried and genymotion was faster.. I think mostly because the app transfers faster to the emulator than the samsung s5 I'm testing on
Mark M.
for me, ties go to hardware, as users do not use emulators
so, unless the speed difference was going to make a material difference in my workday, I'd still use hardware
but, that's me
10:00 AM
Mark M.
and that's a wrap for today's chat
Jonatan R.
ok, thanks
bye
Mark M.
the next chat is tomorrow at 4pm US Eastern
this chat's transcript will be posted to https://commonsware.com/office-hours/ shortly
have a pleasant day!
Jonatan R.
has left the room
Mark M.
turned off guest access

Saturday, January 2

 

Office Hours

People in this transcript

  • Jonatan Ro
  • Mark Murphy