Upload
chuck-greb
View
82
Download
1
Embed Size (px)
Citation preview
Fragment
Activity
EditText
Button
Web Service
Storage
AsyncTask
ActivityLifecycle
SystemServices
Fragment
FragmentLifecycle
Fragment
Activity
EditText
Button
Web Service
Storage
AsyncTask
ActivityLifecycle
SystemServices
Fragment
FragmentLifecycle
UserInput
InputValidation
Fragment
Activity
Web Service
Storage
AsyncTask
ActivityLifecycle
SystemServices
Fragment
FragmentLifecycle
UserInput
setRetainInstance(true)
EditText
Button
InputValidation
Fragment
Activity
Web Service
Storage
AsyncTask
ActivityLifecycle
SystemServices
Fragment
FragmentLifecycle
UserInput
setRetainInstance(true)
Intent
ParcelableExtras
EditText
Button
InputValidation
Web Service
Storage
Activity
Fragment
Fragment
AsyncTask
setRetainInstance(true)
ActivityLifecycle
FragmentLifecycle
SystemServices
UserInput
Intent
ActivityInstrumentationTestCase2
ParcelableExtras
EditText
Button
InputValidation
- Phil Karlton
There are two hard things in computer science: cache invalidation, naming things, [and errors off by one.]
“
”
Web Service
Storage
ActivityActivityLifecycle
SystemServices
UserInput
Presenter
View Model
Controller
Button
EditText
Thread
Input Validation
Web Service
Storage
ActivityActivityLifecycle
SystemServices
UserInput
Presenter
View Model
Controller
ThreadButton
EditText
Input Validation
A test is not a unit test if:
→ It talks to the database
→ It communicates across the network
→ It touches the file system
→ It can't run at the same time as any of
your other unit tests
→ You have to do special things to your
environment (such as editing config files)
to run it.
Michael Feathers, 2005
A Set of Unit Test Rules
ActivityRobolectricTestRunner
RobolectricRuntime
Environment
SimulatedInput
StubPresenter
View
Button
EditText
Input Validation