Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
Kotlin Coroutines is a powerful threading library for Kotlin, released by JetBrains in 2018. At The New York Times, we recently migrated our core libraries and parts of our News app from RxJava to Kotlin Coroutines. In this talk we’ll share lessons learned and best practices to understand, migrate to, and use Kotlin Coroutines & Flows.
In this presentation, you will learn:
What Coroutines are and how they function
How to use Kotlin Coroutines & Flows (with real world examples and demos)
Where and why you should use Coroutines & Flows in your app
How to avoid the pitfalls of Coroutines
Kotlin Coroutines vs. RxJava
Lessons learned from migrating to Kotlin Coroutines from RxJava in large legacy projects & libraries
By the end of this talk, you will be able to apply Kotlin Coroutines to your own app, run the provided sample code yourself, and convince your team to give Kotlin Coroutines a try!
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part IV will cover:
- Dynamic Item Creation
- Keyboard Input Handling
Hamcrest is a library for creating matchers for usage in unit tests, mocks and UI validation. This talk gives a brief introduction to using and writing Hamcrest matchers.
The topics covered:
* Basic introduction to Hamcrest
* Using Matchers in assertions
* Using Matchers with Mockito
* Writing custom matchers
* Ad-hoc matchers
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
Kotlin Coroutines is a powerful threading library for Kotlin, released by JetBrains in 2018. At The New York Times, we recently migrated our core libraries and parts of our News app from RxJava to Kotlin Coroutines. In this talk we’ll share lessons learned and best practices to understand, migrate to, and use Kotlin Coroutines & Flows.
In this presentation, you will learn:
What Coroutines are and how they function
How to use Kotlin Coroutines & Flows (with real world examples and demos)
Where and why you should use Coroutines & Flows in your app
How to avoid the pitfalls of Coroutines
Kotlin Coroutines vs. RxJava
Lessons learned from migrating to Kotlin Coroutines from RxJava in large legacy projects & libraries
By the end of this talk, you will be able to apply Kotlin Coroutines to your own app, run the provided sample code yourself, and convince your team to give Kotlin Coroutines a try!
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part IV will cover:
- Dynamic Item Creation
- Keyboard Input Handling
Hamcrest is a library for creating matchers for usage in unit tests, mocks and UI validation. This talk gives a brief introduction to using and writing Hamcrest matchers.
The topics covered:
* Basic introduction to Hamcrest
* Using Matchers in assertions
* Using Matchers with Mockito
* Writing custom matchers
* Ad-hoc matchers
Jenkins is a Continuous Integration (CI) server or tool which is written in Java. It provides Continuous Integration services for software development, which can be started via command line or web application server. Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.
Java 8 Stream API. A different way to process collections.David Gómez García
A look on one of the features of Java 8 hidden behind the lambdas. A different way to iterate Collections. You'll never see the Collecions the same way.
These are the slides I used on my talk at the "Tech Thursday" by Oracle in June in Madrid.
28th July 2016 iOS Dev Scout Meetup @ Propertyguru
Presentation on
- XCUITest: how to easily setup and run XCUITests
- Gherkin: how to setup Gherkin for your XCUITests
With the announcement on officially supporting Kotlin for Android, this presentation tries to compare Java and Kotlin to encourage people to switch to Kotlin
Asynchronous API in Java8, how to use CompletableFutureJosé Paumard
Slides of my talk as Devoxx 2015. How to set up asynchronous data processing pipelines using the CompletionStage / CompletableFuture API, including how to control threads and how to handle exceptions.
As Atlassian Connect is the way forward for building add-ons on Atlassian Cloud, Spring Boot is the way forward for building Spring web applications. Now you can combine the best of both worlds with the new open source library: Atlassian Connect Starter for Spring Boot. This will get you bootstrapped with an Atlassian Connect add-on in just a few minutes. In this talk you will learn:
What is Spring Boot
What is a Spring Boot Starter and how they benefit you
How to use the Atlassian Connect Starter to easily build Atlassian Connect add-ons
The Atlassian Connect architecture and how it interacts with your add-ons
We will write a simple macro for Confluence and show how much time Spring Boot can save you.
Introduction to go language programming , benchmark with another language programming nodejs , php , ruby & python . how install go . use what IDE . and rapid learnin golang
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
Watch a live presentation at http://offer.bitbar.com/getting-started-with-xctest-and-xcuitest-for-ios-app-testing
XCTest has been part of Xcode for few years already, but it is finally catching up and more developers are getting on the bandwagon. XCTest and XCUITest provide feature-rich capabilities for iOS developers and test automation folks to implement different levels of tests using Xcode features and supported programming languages, Objective-C and Swift.
Stay tuned and join our upcoming webinars at http://bitbar.com/testing/webinars/
Jenkins is a Continuous Integration (CI) server or tool which is written in Java. It provides Continuous Integration services for software development, which can be started via command line or web application server. Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.
Java 8 Stream API. A different way to process collections.David Gómez García
A look on one of the features of Java 8 hidden behind the lambdas. A different way to iterate Collections. You'll never see the Collecions the same way.
These are the slides I used on my talk at the "Tech Thursday" by Oracle in June in Madrid.
28th July 2016 iOS Dev Scout Meetup @ Propertyguru
Presentation on
- XCUITest: how to easily setup and run XCUITests
- Gherkin: how to setup Gherkin for your XCUITests
With the announcement on officially supporting Kotlin for Android, this presentation tries to compare Java and Kotlin to encourage people to switch to Kotlin
Asynchronous API in Java8, how to use CompletableFutureJosé Paumard
Slides of my talk as Devoxx 2015. How to set up asynchronous data processing pipelines using the CompletionStage / CompletableFuture API, including how to control threads and how to handle exceptions.
As Atlassian Connect is the way forward for building add-ons on Atlassian Cloud, Spring Boot is the way forward for building Spring web applications. Now you can combine the best of both worlds with the new open source library: Atlassian Connect Starter for Spring Boot. This will get you bootstrapped with an Atlassian Connect add-on in just a few minutes. In this talk you will learn:
What is Spring Boot
What is a Spring Boot Starter and how they benefit you
How to use the Atlassian Connect Starter to easily build Atlassian Connect add-ons
The Atlassian Connect architecture and how it interacts with your add-ons
We will write a simple macro for Confluence and show how much time Spring Boot can save you.
Introduction to go language programming , benchmark with another language programming nodejs , php , ruby & python . how install go . use what IDE . and rapid learnin golang
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
Watch a live presentation at http://offer.bitbar.com/getting-started-with-xctest-and-xcuitest-for-ios-app-testing
XCTest has been part of Xcode for few years already, but it is finally catching up and more developers are getting on the bandwagon. XCTest and XCUITest provide feature-rich capabilities for iOS developers and test automation folks to implement different levels of tests using Xcode features and supported programming languages, Objective-C and Swift.
Stay tuned and join our upcoming webinars at http://bitbar.com/testing/webinars/
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)Kenneth Poon
PropertyGuru is Hiring. Join the band of mobile engineering rockstars at South East Asia's Leading Property Portal, PropertyGuru. We are looking for iOS / Android Engineers to join us and be part of the awesome team responsible for serving 16 million users every month.
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
There's a shift to open-source mobile test automation tools happening today among developers and QA. Many mature technology sectors are adopting lightweight, vendor-transparent tools to fulfill the need for speed and integration.
But as with many free and open-source software markets however, a plethora of tools complicates the selection process. How do you know which tool is worth spending the time to learn and integrate in your own environment?
These slides aim to help you choose which open-source test automation framework to use based on a number of critical considerations.
The SlideShare 101 is a quick start guide if you want to walk through the main features that the platform offers. This will keep getting updated as new features are launched.
The SlideShare 101 replaces the earlier "SlideShare Quick Tour".
2. About Us
• Nadia Lin
• Software Engineer in Test in the KKBOX Inc
• Computer vision (openCV)
• Mark Chang
• Software Engineer in Test in the KKBOX Inc
• 🐴 的學習筆記 Blog
• Github markchangjz
8. Cases in automation test
class UITests: XCTestCase {
let app = XCUIApplication()
func testChatWithPeople() {
app.buttons["Home"].tap()
app.cells["Nadia"].tap()
app.textFields["Your message"].typeText("Hello")
XCTAssertTrue(……)
}
}
Case 1:
Home → Chat with people → Say “Hello”
9. Cases in automation test
class UITests: XCTestCase {
let app = XCUIApplication()
func testDeleteMessage() {
app.buttons["Home"].tap()
app.cells["Nadia"].swipeLeft()
app.buttons["Delete"].tap()
XCTAssertTrue(……)
}
}
Case 2:
Home → Swipe to delete message
11. Modify your cases
class UITests: XCTestCase {
let app = XCUIApplication()
func testChatWithPeople() {
app.buttons[“My Messages"].tap()
app.cells["Nadia"].tap()
app.textFields["Your message"].typeText("Hello")
XCTAssertTrue(……)
}
}
Case 1:
My Messages → Chat with people → Say “Hello”
12. Modify your cases
class UITests: XCTestCase {
let app = XCUIApplication()
func testChatWithPeople() {
app.buttons[“My Messages"].tap()
app.cells["Nadia"].tap()
app.textFields["Your message"].typeText("Hello")
XCTAssertTrue(……)
}
}
Case 2:
My Messages → Swipe to delete message
13. class UITests: XCTestCase {
let app = XCUIApplication()
func testChatWithPeople() {
app.buttons["My Messages"].tap()
app.cells["Nadia"].tap()
app.textFields["Your message"].typeText("Hello")
XCTAssertTrue(……)
}
func testDeleteMessage() {
app.buttons["My Messages"].tap()
app.cells["Nadia"].swipeLeft()
app.buttons["Delete"].tap()
XCTAssertTrue(……)
}
}
Something wrong?
Hard to maintain
14. class UITests: XCTestCase {
let app = XCUIApplication()
func testChatWithPeople() {
app.buttons["My Messages"].tap()
app.cells["Nadia"].tap()
app.textFields["Your message"].typeText("Hello")
XCTAssertTrue(……)
}
func testDeleteMessage() {
app.buttons["My Messages"].tap()
app.cells["Nadia"].swipeLeft()
app.buttons["Delete"].tap()
XCTAssertTrue(……)
}
}
Hard to read
Something wrong?
34. Page Object Pattern
Chat Room
Page
send message
Home
Page
chat
back
People
Page
chat
go to people page
Search
Page
go to search page
search
go to search page
35. Strategies & Tricks
• Protocol Extensions
• Tab Bar
• Search Bar
• Generics
• Go Back
• Go To Different Page
44. Protocol Extensions
Chat Room
Page
send message
Home
Page
chat
back
People
Page
chat
go to people page
Search
Page
go to search page
search
go to search page
45. Protocol Extensions
final class HomePage: Page, MessengerTabBar, MessengerSearchBar {
// ...
}
final class GroupsPage: Page, MessengerTabBar, MessengerSearchBar {
// ...
}
final class MePage: Page, MessengerTabBar, MessengerSearchBar {
// ...
}
final class PeoplePage: Page, MessengerTabBar, MessengerSearchBar {
// ...
}
54. Generics
func playPlaylistAndExpectTransitionToPage<T: Page>(type: T.Type) -> T {
//…
playButton.tap()
return type.init()
}
Possible 1. Go to Nowplaying page
chartPage.playPlaylistAndExpectTransitionToPage(NowplayingPage)
Possible 2. Go to Chart page
chartPage.playPlaylistAndExpectTransitionToPage(ChartPage)
56. Sets Element Accessibility
• Accessibility data makes UI testing possible
Reference: UI Testing in Xcode - WWDC 2015 - Videos - Apple Developer
Testability
Quality of Accessibility Data
57. Speed Up Testing
• Set launch arguments to speed up testing
Tutorial View
58. Speed Up Testing
override func setUp() {
//…
let app = XCUIApplication()
app.launchArguments.append("-forceDoNotShowTutorial")
app.launchArguments.append("1")
app.launch()
//…
}
NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults];
if ([standardDefaults boolForKey:@"forceDoNotShowTutorial"]) {
[UserConfig sharedInstance].everShowTutorial = YES;
}
• In Test Code (Swift 2.3) - Set launch arguments
• In App Code (Objective-C) - Read launch arguments
60. Reduce Motion
• Settings > General > Accessibility > Reduce Motion
• UIAccessibilityIsReduceMotionEnabled()
• Returns a Boolean value indicating whether
reduce motion is enabled (API Reference)
• true if the user has enabled Reduce Motion in
Settings; otherwise, false
64. Recap
• Make your page object at the user level,
rather than expose implement details
• Protocol Extensions: Extract common actions
• Generics: Go to indicated page
• iOS-Messenger-Page-Object
69. Q & A
• Q: (Hanyu) 因為我也有寫 UI testing,我⼀直很好奇⼀點就是,因為 UI testing 不能
在 Jenkins 上跑,它要在 Mac server 上跑,請問你們怎麼解決這個問題?
• A: (Zonble) 我們在 Mac server 上跑。
• Q: (Hanyu) 可是這樣⼦你們就,我不知道怎麼串接、那個架構是怎麼樣,我滿好奇的,
因為我知道你們好像是⼀台 Jenkins 然後掛 4、5 台 Mac server 吧。
• A: (Zonble) iOS team 的 Jenkins 跟 QA team 其實分開,有分開來的機器,然後兩個
部⾨間再互相 sync。你在我們部落格看到的我那篇⽂章講我們⾃⼰的 build system,然
後我們會 build ... 那台機器在 iOS team 這邊主要在 build 出 daily build,幾乎我們
RD 每個 branch 都有編出⾃⼰的,幾乎每個 revision 都編出⼀個版本,然後同時在執
⾏,像我們整個 app 有 4、5 個⾯向,app 裡頭的播放器、跟 server 的溝通,那邊寫
了⼀⼤堆的單元測試,在 Jenkins 上我們主要跑這些,那今年轉到 XCUITest 那
Jeremy 他們就 study 這些,看起來那個 Jenkins 跑這個東西就是跑得不順,就另外再
去架了那個 Xcode Server。然後 Xcode Server 就定時去拉新的 code 然後在上⾯執
⾏。
70. Reference
• Page Object
• DSL, Page Object and Selenium – a way to reliable functional tests
• Best Practices - SELENIUM DOCUMENTATION
• PageObjects · SeleniumHQ_selenium Wiki · GitHub
• XCUITest
• UI Testing Cheat Sheet and Examples · masilotti.com
• XCTest and the Page Object Model
• Swift
• Getting Started with Swift