The document discusses various topics related to Android testing including:
- Best practice is to create a separate test project rather than including tests in the main project. This keeps tests stripped out of the main code and easier/faster to run.
- Tests can be run from Eclipse or from the command line with options to run all tests, a single test class/method, or filter by category.
- The Android SDK tools, emulator/AVD, and tools like uiautomatorviewer and uiautomator are needed to perform UI tests.
- Different types of tests include unit tests, integration tests to check components work together, acceptance tests for QA, and performance tests to check system behavior.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
As your app code gets larger and more complex, it makes sense to break your project out into smaller reusable components. But what’s the best way to do this? How can you clearly version your internal libraries? What kind of setup and maintenance can you expect? How much could it slow down development time?
In this talk we’ll dive into the various ways you can manage internal library dependencies. We’ll chat about the current state of Android dependency management, Gradle multi-project builds, Git submodules, and creating a private maven repository in Artifactory. The speaker will share real-world examples, and the pros and cons of each approach.
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
As your app code gets larger and more complex, it makes sense to break your project out into smaller reusable components. But what’s the best way to do this? How can you clearly version your internal libraries? What kind of setup and maintenance can you expect? How much could it slow down development time?
In this talk we’ll dive into the various ways you can manage internal library dependencies. We’ll chat about the current state of Android dependency management, Gradle multi-project builds, Git submodules, and creating a private maven repository in Artifactory. The speaker will share real-world examples, and the pros and cons of each approach.
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
Robolectric is an open source Android unit testing framework that makes it possible to run unit tests against your Android application code outside of the emulator - in the IDE. Robolectric gives you the scaffolding to run your tests quickly so you can make fast iterations and refactor your code with confidence.
** Check out the video for this presentation at marakana.com: http://mrkn.co/f/192 **
This presentation was given at the San Francisco Android User Group on Oct. 26, 2010.
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
Main idea of this talk is to show what technologies can be used for cross-platform mobile app development and how to deal with UI tests automation for them. I will outline set of challenges every tester and developer needs to conquer and give some tips how to solve them. During this talk I will present how to apply UI tests in React Native project using Detox framework.
A Gentle Introduction to Angular Schematics - Angular SF 2019Matt Raible
You might’ve heard of Angular Schematics, but do you know what they do? Learn how you can use this powerful tool to develop workflows and simplify configurations for your Angular projects.
Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
Source code: https://github.com/oktadeveloper/okta-angular-schematics-example
Screencast: https://youtu.be/ANwZIt3Ni2s
The Tellurium Automated Testing Framework (Tellurium) is a UI module-based web automated testing framework built on top of Selenium. Here is a step by step guide to teach you how to create a New Tellurium Test project.
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019Matt Raible
You might’ve heard of Angular Schematics, but do you know what they do? Learn how you can use this powerful tool to develop workflows and simplify configurations for your Angular projects.
In this session, you'll learn how to create a schematic, how to test it, and how you can use them with non-Angular projects.
* YouTube video: https://youtu.be/bLLJqagO_dg
* Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
* GitHub repo: https://github.com/oktadeveloper/schematics
Basic Tutorial of React for ProgrammersDavid Rodenas
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
Bootiful Development with Spring Boot and React - UberConf 2018Matt Raible
To simplify development and deployment, you want everything in the same artifact, so you put your React app “inside” your Spring Boot app, right? But what if you could create your React app as a standalone app and make cross-origin requests to your API? A client app that can point to any server makes it easy to test your current client code against other servers (e.g. test, staging, production). This session shows how to develop with Java 8, Spring Boot, React, and TypeScript. You’ll learn how to create REST endpoints with Spring MVC, configure Spring Boot to allow CORS, and create a React app to display its data. If time allows we’ll cover authentication with OpenID Connect and deployment to Cloud Foundry.
Blog: https://developer.okta.com/blog/2017/12/06/bootiful-development-with-spring-boot-and-react
GitHub: https://github.com/oktadeveloper/spring-boot-react-example
Lecture on Android unit testing and instrumentation testing, mDevCamp 2015.
Overview of available libraries and frameworks, and their capabilities and drawbacks.
Guide to the jungle of testing frameworksTomáš Kypta
There are many tools, libraries and frameworks available for Android developers to test their applications. The jungle is huge and it's not easy to find the right ones. Some frameworks are good for unit testing, some are good for instrumentation testing, and some can be used for both. Some have great capabilities but annoying weaknesses. Some are good for testing UI, other allow you to make good mocks. We will look at many frameworks, the popular ones like Mockito, Robolectric, Espresso, and some other.
Presented at GDG DevFest Minsk 2016.
Selenide is simple and powerful in use wrapper-library over Selenium. But what the point just of shorter lines of code? In this talk we will see how to tame your webui mustang with Selenide and put it into fence of simple BDD stories with Easyb. We also consider pros and cons of the approach and compare to available alternatives.
Alexey Buzdin "Maslow's Pyramid of Android Testing"IT Event
You all know what tests are. You all know you need to write them. But also you know it’s hard to start writing tests for mobile app thus you usually neglect it. Let’s look into Android automation testing, what technologies and approaches we can use to have a complete Maslow's Pyramid for testing. Unit Testing, Integration Testing, UI Automation, Mocking etc.
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
Robolectric is an open source Android unit testing framework that makes it possible to run unit tests against your Android application code outside of the emulator - in the IDE. Robolectric gives you the scaffolding to run your tests quickly so you can make fast iterations and refactor your code with confidence.
** Check out the video for this presentation at marakana.com: http://mrkn.co/f/192 **
This presentation was given at the San Francisco Android User Group on Oct. 26, 2010.
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
Main idea of this talk is to show what technologies can be used for cross-platform mobile app development and how to deal with UI tests automation for them. I will outline set of challenges every tester and developer needs to conquer and give some tips how to solve them. During this talk I will present how to apply UI tests in React Native project using Detox framework.
A Gentle Introduction to Angular Schematics - Angular SF 2019Matt Raible
You might’ve heard of Angular Schematics, but do you know what they do? Learn how you can use this powerful tool to develop workflows and simplify configurations for your Angular projects.
Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
Source code: https://github.com/oktadeveloper/okta-angular-schematics-example
Screencast: https://youtu.be/ANwZIt3Ni2s
The Tellurium Automated Testing Framework (Tellurium) is a UI module-based web automated testing framework built on top of Selenium. Here is a step by step guide to teach you how to create a New Tellurium Test project.
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019Matt Raible
You might’ve heard of Angular Schematics, but do you know what they do? Learn how you can use this powerful tool to develop workflows and simplify configurations for your Angular projects.
In this session, you'll learn how to create a schematic, how to test it, and how you can use them with non-Angular projects.
* YouTube video: https://youtu.be/bLLJqagO_dg
* Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
* GitHub repo: https://github.com/oktadeveloper/schematics
Basic Tutorial of React for ProgrammersDavid Rodenas
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
Bootiful Development with Spring Boot and React - UberConf 2018Matt Raible
To simplify development and deployment, you want everything in the same artifact, so you put your React app “inside” your Spring Boot app, right? But what if you could create your React app as a standalone app and make cross-origin requests to your API? A client app that can point to any server makes it easy to test your current client code against other servers (e.g. test, staging, production). This session shows how to develop with Java 8, Spring Boot, React, and TypeScript. You’ll learn how to create REST endpoints with Spring MVC, configure Spring Boot to allow CORS, and create a React app to display its data. If time allows we’ll cover authentication with OpenID Connect and deployment to Cloud Foundry.
Blog: https://developer.okta.com/blog/2017/12/06/bootiful-development-with-spring-boot-and-react
GitHub: https://github.com/oktadeveloper/spring-boot-react-example
Lecture on Android unit testing and instrumentation testing, mDevCamp 2015.
Overview of available libraries and frameworks, and their capabilities and drawbacks.
Guide to the jungle of testing frameworksTomáš Kypta
There are many tools, libraries and frameworks available for Android developers to test their applications. The jungle is huge and it's not easy to find the right ones. Some frameworks are good for unit testing, some are good for instrumentation testing, and some can be used for both. Some have great capabilities but annoying weaknesses. Some are good for testing UI, other allow you to make good mocks. We will look at many frameworks, the popular ones like Mockito, Robolectric, Espresso, and some other.
Presented at GDG DevFest Minsk 2016.
Selenide is simple and powerful in use wrapper-library over Selenium. But what the point just of shorter lines of code? In this talk we will see how to tame your webui mustang with Selenide and put it into fence of simple BDD stories with Easyb. We also consider pros and cons of the approach and compare to available alternatives.
Alexey Buzdin "Maslow's Pyramid of Android Testing"IT Event
You all know what tests are. You all know you need to write them. But also you know it’s hard to start writing tests for mobile app thus you usually neglect it. Let’s look into Android automation testing, what technologies and approaches we can use to have a complete Maslow's Pyramid for testing. Unit Testing, Integration Testing, UI Automation, Mocking etc.
This is a presentation about mobile apps testing using Appium. The presentation conrtains tips on comprehensive testing of apps written for various devices and platforms.
Presentation by Yaroslav Pernerovskyy (Lead Test Engineer, GlobalLogic, Kyiv), delivered at UA Mobile, November 22, 2014.
More details - http://uamobile.org
As the number of smartphone users is expected to hit the 5 billion mark next year, we can confidently assume that the popularity and demand of mobile apps will continue to grow. Naturally, mobile apps do require testing, but a lot of it is done manually. The most difficult part of automated testing on mobile, is only the tip of the testing pyramid - E2E tests. The core of the problem with E2E is flakiness, which results in unreliable tests.
At Wix, we believe the only way to tackle this flakiness head on is by moving from black box testing to gray box testing. And for that, React Native mobile apps automation library - Detox - is being created.
Unit tests give developers and testers a quick way to look for logic errors in the methods of classes in Visual C#, Visual Basic, and Visual C++ projects. A unit test can be created one time and run every time that source code is changed to make sure that no bugs are introduced.
2. Agenda: -Intro
-Android Testing
-Creating a project
-JUnit Testing
-Mock Objects + UI Testing
-Integration and acceptance test
-Performance and system testing
-Advance assertions
-TDD
-Real App Dev
!
25. Android Testing
Best practice: test should live in a separate
correlated project
• Stripped (not included in main)
• Easier to run in Emulator
• Takes less time
• Encourages code reusability
44. Benchmarking • Traditional logging statement methods
• Creating Android performance tests
• Using profiling tools
• Microbenchmarks using Caliper
45. Benchmarking
/* (non-Javadoc)
* @see android.text.TextWatcher#onTextChanged(
* java.lang.CharSequence, int, int, int)
*/
public void onTextChanged(CharSequence s, int start,
int before, int count) {
if (!mDest.hasWindowFocus() || mDest.hasFocus() ||
s == null ) {
return; }
final String str = s.toString();
if ( "".equals(str) ) {
mDest.setText("");
return;
}
final long t0;
if ( BENCHMARK_TEMPERATURE_CONVERSION ) {
t0 = System.currentTimeMillis();
}
!
46. Benchmarking
try {
final double temp = Double.parseDouble(str);
final double result = (mOp == OP.C2F) ?
TemperatureConverter.celsiusToFarenheit(temp);
TemperatureConverter.fahrenheitToCelsius(temp);
final String resultString = String.format("%.2f", result);
mDest.setNumber(result);
mDest.setSelection(resultString.length());
} catch (NumberFormatException e) {
// WARNING
// this is generated while a number is entered,
// for example just a '-'
// so we don't want to show the error
} catch (Exception e) {
mSource.setError("ERROR: " + e.getLocalizedMessage());
}
if ( BENCHMARK_TEMPERATURE_CONVERSION ) {
long t = System.currentTimeMillis() - t0;
Log.i(TAG, "TemperatureConversion took " + t +
" ms to complete.");
}
}
49. Assertions in depth public void testNotImplementedYet() {
fail("Not implemented yet");
}
50. Assertions in depth public void testShouldThrowException() {
try {
MyFirstProjectActivity.methodThatShouldThrowException();
fail("Exception was not thrown");
} catch ( Exception ex ) {
// do nothing
}
}
51. Custom messages public void testMax() {
final int a = 1;
final int b = 2;
final int expected = b;
final int actual = Math.max(a, b);
assertEquals("Expection " + expected + " but was " + actual,
expected, actual);
}
52. Static imports public void testAlignment() {
final int margin = 0;
...
android.test.ViewAsserts.assertRightAligned(
mMessage, mCapitalize, margin);
!
}
53. Static imports
import static android.test.ViewAsserts.assertRightAligned;
public void testAlignment() {
final int margin = 0;
assertRightAligned(mMessage, mCapitalize, margin);
}
91. Requirements:
• Application convert from Celsius to F.
• … and viceversa
• Two fields to input data
• When temperature is entered, other field updates
• Error displayed
• Some space reserved keyboard
• Entry fields start empty
• Digits right aligned
• Last entered values retained after onPause()