====== Move from Inbox ====== ===== A Beginners Guide to an Effective Android Testing Strategy ===== Why testing? * deliver to the QA team only good tested code, which should normally not have any bugs * testing improves the design and modularity of our code base * testing helps us to implement "Continuous Integration" Types of test * Unit tests (JUnit) * Integration tests (Instrumentation tests -> Espresso, Automation tests -> UI Automator) Architecting the app for testing Using Model-View-Presenter pattern is good choice to "modularize" the app. This will make the testing much easier (we can test each layer separately). Test pyramid The "test pyramid" : Acceptance - 10% Integration - 20% Unit - 70% This pyramid makes sense because: * integration tests are complexer * integration tests takes more time * if an integration test fails, we have much more things which can go wrong Implementing Unit tests Use Mockito to mock dependencies. Project structure: * Unit tests live in the folder "test" * UI test are located in "androidTest" Anatomy of a Unit Test * @RunWith(MockitoJUnitRunner.class) Here is specified the runner which should be used to run the test * @SmallTest, @MediumTest, @LargeTest @SmallTest is normally a Unit test, @MediumTest test more than one module, @LargeTest is usually an UI automation test * @Before Marks method which should be runned every time before a test is launched * @After Marks method which should be runned every time after a test to release resources, close files etc. * @Test This define a test method. It usually should follow the “Arrange-Act-Assert” pattern: – Arrange all necessary preconditions and inputs. – Act on the object or method under test. – Assert that the expected results have occurred. Running the tests Use "Unit Test" on Build variant menu. After this right click on the Test package folder and then on "Run tests..." (or Debug or Run with Coverage) Implementing Integration Tests In this article using Espresso. ... https://davidguerrerodiaz.wordpress.com/2016/03/04/a-beginners-guide-to-an-effective-android-testing-strategy/ ===== ECMA JavaScript Promises ===== http://www.peterkroener.de/ecmascript-6-promises/ http://www.heise.de/developer/artikel/Asynchrone-Programmierung-mit-Promises-2084517.html?artikelseite=2 https://davidwalsh.name/promises https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise http://www.javascriptkit.com/javatutors/javascriptpromises.shtml ===== Misc links ===== http://blog.egorand.me/reliable-functional-tests-with-espresso-and-dagger/ https://www.linkedin.com/learning/android-development-building-battery-conscious-apps/considerations-of-static-implicit-broadcast-receivers Udi Cohen "Speed up your app" http://blog.udinic.com/2015/09/15/speed-up-your-app http://androidweekly.us2.list-manage.com/track/click?u=887caf4f48db76fd91e20a06d&id=ff2858e202&e=076b1173cd Artikel ist wirklich interessant -> richtig durcharbeiten : Approaching Android with MVVM https://medium.com/ribot-labs/approaching-android-with-mvvm-8ceec02d5442 https://medium.com/freenet-engineering/memory-leaks-in-android-identify-treat-and-avoid-d0b1233acc8#.xeyi70yqi Principles of mobile app design Make a check of Avril, T4T or Wiatrack Pro (see the last page of this guide) http://think.storage.googleapis.com/docs/principles-of-mobile-app-design-engage-users-and-drive-conversions.pdf Droidcon SF Advanced Techniques for concurrency and memory management https://speakerdeck.com/nhachicha/droidcon-sf-advanced-techniques-for-concurrency-and-memory-management https://www.youtube.com/watch?v=m8i9omiw9aM http://peirr.com/writing-android-tests-with-espresso-test-recorder/ https://blog.stylingandroid.com/permissions-part-2/\\ https://blog.stylingandroid.com/permissions-part-3/\\ https://blog.stylingandroid.com/permissions-part-4/\\ https://medium.com/google-developers/building-interfaces-with-constraintlayout-3958fa38a9f7#.70vrhijvv http://saulmm.github.io/from-design-to-android-part1 Nice article about performance, which should be reread AND IMPLEMENTED http://blog.nimbledroid.com/2016/04/20/pushing-limits-of-app-startup-time.html https://medium.com/@p.tournaris/recyclerview-how-we-achieved-60-fps-tips-in-workables-android-app-recyclerviews-c646c796473c#.hngzf91qp https://www.raywenderlich.com/6729-android-jetpack-architecture-components-getting-started https://labs.ribot.co.uk/fast-and-reliable-ui-tests-on-android-17c261b8220c#.uhhke5et6