Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:56:24+00:00 2026-06-10T14:56:24+00:00

I need some advices and guidance related to TDD of android applications I’m developing

  • 0

I need some advices and guidance related to TDD of android applications

I’m developing a complex android application (an automated robo player for a web game). Now i have a pilot for it, and before start continue with it’s development, i want to make full TDD for it.

The main purpose of this application is run as a background service that communicates with a http server – it will send http requests with json content

It has to 2 modes of running:

- service mode - it will run in background- read some data configuration from database and communicate with the server 
- GUI mode - communication with server on demand + configuration for running in service mode.

GUI layer is designed as MVP, so all business done in a module (a MVP unit) is separated from view, therefore, all app logic is “NON android dependent”.

I have several big layers that i need to make unit tests for:

- domain data access : 
      database storage (ormlite)
      android specific storage - shared prefs.., 
      files
- server communication - http client (spring android rest template)
                         http content conversion (gson)

- background services - android services
- GUI - activities
- app business - android independent - algorithms, computations, ...

In conclusion will need TDD – for every of these layers individually, but also integration tests for a complete flow.

tests included :

  - database DAO tests
  - http client requests 
  - GSON conversion TDDs
  - business logic - simple tests for methods
  - unit testsfor running and scheduled background services
  - activity unit testing
  - test suites (service + DAO + json conversion + http requests)

My first question is what TDD frameworks would be best for my needs? Should i use mocking or not ?

Please give me some directions to go for. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:56:26+00:00Added an answer on June 10, 2026 at 2:56 pm

    At first, for automatic testing : junit.


    For fluent assertions, you could look at fest-assertions. They provides a lot of examples, here. But enjoy this one on the String :

     assertThat("Frodo").startsWith("Fro").endsWith("do").hasSize(5);
    

    It isn’t just harmonious, it increase also your productivity.


    Since you want to write unit tests, you will have to write mock objects. Of course, you can do it without any framework, but it is very tedious.

    Personnaly, i am big fan of Mockito. It’s api is great and very fluent. Besides, you could the use the BDDMockito static methods to write test in a BDD manner. Look :

    //given  
    given(seller.askForBread()).willReturn(new Bread());
    //when
    Goods goods = shop.buyBread();
    //then
    assertThat(goods, containBread());
    

    Sometimes you will depend on class that you can’t mock, for example a final class like BluetoothAdapter. In these cases (and only in these), you could use PowerMock.

    Look also at this stuff :

    • https://stackoverflow.com/questions/2336488/resources-for-tdd-on-android
    • [Why Android isn’t ready for TDD, and how I tried anyway](
      http://daverog.wordpress.com/2009/12/14/why-android-isnt-ready-for-tdd-and-how-i-tried-anyway/)
    • Introduction to Android Testin

    There is also a book : Android Application Testing Guide

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Android, and I need some advices for start up. I
I need some guidance/advices from someone who has any ideea about custom jquery event.
I have this thing that i need to do and some advices will be
I need some advice for a design which I have to implement in application.
I need some advice how to implement this situation in my application. I have
I need to execute some common code for several 'around' advices. So, I have
I have some experience developing websites, but none with proper web applications. But this
I need some advices. I've a WSDL and I need to call some services.
I am looking for some advices for sound-related libraries for C++. My requirements are
I have followed some advices I got here today and would need a bit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.