abtestgen


Source link: https://github.com/imperial-crystalline-recursion/abtestgen

An A/B Testing Library for Android...

...that makes writing simple tests simpler by using annotations.

How it works

Currently you can use two different annotations: @TextTest and @ResourceTest. @TextTest is for plugging Strings into a generated test; @ResourceTest is for plugging resource IDs. Example usage may be as follows:

@TextTest(testName="firstTest", method="setText", values={
"hello", "howdy"
}
) TextView helloTextView;

which will automatically generate a class which you can run by calling ABTester.with(activity).run("firstTest"); . Or, if you're running the test from outside of an Activity, ABTester.with() can also take a second Object parameter where you've put in the annotations.

You can also cover multiple fields in the same test, as follows:

@TextTest(testName="firstTest", method="setText", values={
"hello", "howdy"
}
) TextView helloTextView;  @ResourceTest(testName="firstTest", method="setText", values={
R.string.yo, R.string.sup
}
) TextView otherTextView;  @TextTest(testName="firstTest", method="setText", values={
"world", "globe"
}
) TextView thirdTextView;

And that will generate a class which will create two tests that will cover those three TextViews.

There's also a CustomTest class which allows you to define more complex tests that may not be possible to generate with the annotation processor.

By default, tests will be weighted to have an equal chance to be selected. However, by extending the TestPicker class you can weight the tests however you like.

To obtain...

You'll want to include

maven {
 url "https://jitpack.io" 
}

in either your allprojects.repositories or your module's repositories section. Whatever you like!

You will also need the APT plugin, so you will want to put this into your root build.gradle's buildscript.dependencies:

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

and apply this plugin to the modules you're doing your tests in:

apply plugin: 'com.neenbedankt.android-apt'

Then, you'll want to bang these bad boys into your build.gradles' dependencies:

apt 'com.github.imperial-crystalline-recursion.abtestgen:ab-compiler:0.4.1' compile 'com.github.imperial-crystalline-recursion.abtestgen:ab-annotations:0.4.1' compile 'com.github.imperial-crystalline-recursion.abtestgen:ab-lib:0.4.1'

Resources

Android DebugPort allows you to write and execute code within your app's context, at runtime, and from the comfort of your desktop computer's terminal. Think of it as a window into your application through which you can both inspect and modify its state.

LeanTesting Java SDK for Android.

An Android EditText for phone numbers.

A simple and attractive custom text GridView design based on material concepts.

  • Auto adjustable column based on device width and height.
  • Portrait and landscape orientations.
  • Extends ScrollView.

Library simplifying usage of Snackbar with Android Data Binding.

Add a circular progress bar to any existing fab.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes