Module can mean a couple of things, depending on the context. Usually, terminology like this is very fuzzy. In Java/Kotlin, it can be either class or package. In terms of Android, it can be one conceptually (or funcionally) independent component of your application. Moreover, those component typically will reside in separate files (classes) and packages, so there is semantic overlap.
Let's take your example:
- Sign in.
- Send a message.
- Sign out.
On Android, you could model it like so:
app
˪ ui
˪ SplashActivity
˪ SignInFragment
˪ SignUpFragment
˪ data
˪ db
˪ DatabaseManager
˪ models
[model classes]
˪ api
[classes responsible for network communication]
Here you have:
ui
- module/component (and at the same time package) responsible for UI logic.
SplashActivity
- responsible for managing logic concerning login/signup. Conceptually, we could refer to it as a module too. Physically a class/file.
data
- big module/component responsible for data manipulation only. Again, at the same time, physically, a package.
db
- submodule exclusively responsible for Database logic.
And so on. The point I'm trying to drive is: module will serve as an abstraction more often than not.
Regarding unit-tests. Modular design will always make application more testable. In the example above all UI logic is separated from data logic so all data can be very easily mocked. Activity
does not care from where data is pulled as long all details are hidden behind suitable interface.
This is a bit broad question, so I recommend you Android's guide to application architecture, which is exactly about modular design: https://developer.android.com/topic/libraries/architecture/guide.html
Update
What about MVC?
Android uses derivation of MVC, called Model-View-Presenter. In MVP the presenter assumes the functionality of the "middle-man" (details here). Let's use an example: https://github.com/googlesamples/android-architecture/tree/todo-mvp. This Google's simple to-do app is illustrating MVP design. It's organized as follows:
todoapp
˪ data
˪ source
˪ Task.java (model)
[...]
˪ tasks
˪ TasksActivity.java
˪ TasksFragment.java
˪ TasksPresenter.java
[...]
As you can see, this layout is very similar to what I presented earlier. Data (Model) logic is kept in separate package and UI logic together (View, Presenter). You could, of course, separate Presenter from View futher, however, this is a very simple application and class separation is enough.
If you have clean separation between components, like in MVP, it's easy to instrument tests for each of them independently - just mock the other components. Again, I recommend reading:
https://developer.android.com/topic/libraries/architecture/guide.html, there is a whole section on how to test each component.
must have these modules in you app
the termmodul
just meansmenu item
oruser story
orfeature
but not modul as implementation- and code organisation- detail in which lib/jar/dll/android-studi-modul the code has to be compiled into. – k3b