Provide in-depth introduction to writing more robust unit tests for your Android applications using property based testing
Property-based tests make statements about the output of your code based on the input, and these statements are verified for many different possible inputs.
A property-based testing framework runs the same test over and over with generated input.
This contrasts with example-based testing, which is most of the tests we write these days. Each unit test sets up one input scenario, runs the code under test, and then checks the output (and any other effects the code is supposed to have).
Instead, one property-based test runs hundreds of times with different inputs. The testing framework will try to get the test to fail by passing empty lists, negative values, all the possible edges cases. It’ll pass in long lists and high numbers and strings with special characters.
Outline of the Talk
- Current state of the art for Android unit testing
** JUnit
** Android test cases
** Mocks and stubs
*** Powermock
*** Mockito
** What ?
** How ?
** Why ?
** Example code walkthrough.
- Property based testing for stateful functions.
** Example code walkthrough.
- Alternative projects you can use
** fj.test
** JCheck
** ScalaCheck
** QuickCheck
Prior knowledge of writing unit-tests for Java/Android applications
Programming language enthusiast, polyglot, learner, mobile developer @Helpshift, coffee addict
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}