Slide 1

Slide 1 text

Building Predictable & High-Performance Workflows @ragunathjawahar • Obvious (formerly Uncommon Bangalore)

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Workflow

Slide 4

Slide 4 text

Workflow A repeatable pattern of activities that may be considered a view or representation of real work

Slide 5

Slide 5 text

Soft Boiled Eggs 1. Get an egg at room temperature. 2. Add vinegar and salt to water. 3. Boil the water with egg for 8 minutes. 4. Dunk the egg in cold water for 3 minutes. 5. De-shell and serve.

Slide 6

Slide 6 text

1. Build a specification (a.k.a) figure out what you’re going to do

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Deliverables 1. A very clear understanding of what the product team wants. • State diagram (or) • TODO list / JIRA tickets / Trello cards / Others 2. All screens (some could be missing, but notify the design team about it). 3. JSON specification produced collaboratively with the backend team.

Slide 12

Slide 12 text

Take aways 1. Human interactions are one the longest feedback loops. 2. Don’t build something that you are not going to ship. 3. Minimise rework.

Slide 13

Slide 13 text

2. Start with ?

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Tests • Types of test • Unit tests • Isolated tests • Quick feedback • Add/update functionality • Bug fixes • Refactoring

Slide 20

Slide 20 text

Test-Driven Development • Spend more time in the problem space • Missed something? Figure out sooner than later • Design feedback • In minutes / hours / days vs. months / years • Pace

Slide 21

Slide 21 text

Roman Numerals Problem Time (minutes) 24 25.5 27 28.5 30 First Second Third No TDD TDD http://www.codemanship.co.uk/parlezuml/blog/?postid=1021

Slide 22

Slide 22 text

Deliverables 1. Domain layer with tests.

Slide 23

Slide 23 text

Take aways 1. Aim for quick feedback cycles in every stage of development. 2. Reduce the amount of interference that creeps into your work from other teams.

Slide 24

Slide 24 text

3. Build other components Sequentially or in parallel (preferably)

Slide 25

Slide 25 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th SecureStorage AuthApi

Slide 26

Slide 26 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th A. Varies across architectures B. Should be parallelizable SecureStorage AuthApi

Slide 27

Slide 27 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th A. Deadline B. Screen name SecureStorage AuthApi

Slide 28

Slide 28 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th A. Checkmark B. Deadline (Optional) C. Person SecureStorage AuthApi

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Deliverables 1. All other components + tests, ready to be glued.

Slide 31

Slide 31 text

Take aways 1. Architecture is a corner stone in building workflows and maintainable applications. 2. DI (not referring to Dagger) helps in building loosely coupled applications and facilitates parallel development. 3. Critical information should be readily available.

Slide 32

Slide 32 text

4. Write Glue Code Wire ’em together

Slide 33

Slide 33 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th SecureStorage AuthApi

Slide 34

Slide 34 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th SecureStorage AuthApi

Slide 35

Slide 35 text

Glue • DI container setup for the screen / feature. • View interface implementation for your Activity / Fragment / Custom View / View Controller. • Boiler plate for architecture infrastructure.

Slide 36

Slide 36 text

Screen Business Logic View Renderer Effect Handler Subsystems UI Glue Login 19th 6th SecureStorage AuthApi

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Deliverables 1. A feature that can be played around with on a device or an emulator.

Slide 39

Slide 39 text

5. Test with local stubs So that you’re not surprised!

Slide 40

Slide 40 text

interface AuthenticationApi { fun login(request: LoginRequest): Single }

Slide 41

Slide 41 text

interface AuthenticationApi { fun login(request: LoginRequest): Single } class StubAuthenticationApi : AuthenticationApi { override fun login(request: LoginRequest): Single { return Single.just(LoginResponse("some-random-token")) } } class StubAuthenticationApi : AuthenticationApi { override fun login(request: LoginRequest): Single { return Single.error(RuntimeException("KABOOM!!")) } }

Slide 42

Slide 42 text

Deliverables 1. The same binary that you built in the previous step (plus, fixes if any for edge cases).

Slide 43

Slide 43 text

Take Away 1. Fail fast, edge cases are sources are constant surprise during development. Don’t wait for QA to figure out the obvious ones.

Slide 44

Slide 44 text

6. Integrate and test manually Again! To avoid surprises!

Slide 45

Slide 45 text

Deliverables 1. A build that’s ready for QA to look into.

Slide 46

Slide 46 text

Workflow 1. Build a specification 2. Start with the domain 3. Build other components 4. Write glue code 5. Test with local stubs 6. Integrate and test manually

Slide 47

Slide 47 text

–Vinay Shenoy “This is A workflow, not THE workflow.”

Slide 48

Slide 48 text

Predictability The fact of always behaving or occurring in the way expected

Slide 49

Slide 49 text

High-Performance Designed to achieve high speeds and high standards

Slide 50

Slide 50 text

1. Master the IDE

Slide 51

Slide 51 text

Key Promoter

Slide 52

Slide 52 text

Explore the IDE

Slide 53

Slide 53 text

Productivity Features • Use multi-cursors • Refactoring tools • Live templates • Postfix completion

Slide 54

Slide 54 text

Staying Informed • Keep the gutter visible (icons / color) • Line numbers • Logcat colour for log levels • Rainbow Brackets (Plugin)

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

2. Practice

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Why? 1. Evaluate architectures. • Presents various constraints in Android. 2. Simple problems so that you can focus more on workflows. 3. Helps build muscle-memory.

Slide 59

Slide 59 text

3. Architecture

Slide 60

Slide 60 text

Data Flow

Slide 61

Slide 61 text

State Management

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Why? 1. Functional, hence easier to deal with asynchrony. 2. Unidirectional data flow, easier to test and isolate faults. 3. Isolation between logic and side-effects. 4. Printing the state object gives us all the information we need.

Slide 64

Slide 64 text

4. Tooling

Slide 65

Slide 65 text

Best Practices 1. Tools and libraries should provide quick feedback.
 Earlier in the development cycle, the better. 2. Pick tools that seamlessly blend into your workflow. 3. Minimise the amount of external tools. 4. Reliance of debugger / tools that help debugging efficiently means there is scope for improvement. 5. Restrict additional tooling for specific purposes. 6. Consider using a Git GUI client.

Slide 66

Slide 66 text

External Links • https://plugins.jetbrains.com/plugin/4455-key-promoter
 (Don’t get the Key Promoter X Plugin) • https://github.com/ragunathjawahar/bench-press • https://github.com/spotify/mobius • https://github.com/spotify/mobius.swift • https://www.gitkraken.com

Slide 67

Slide 67 text

end; @ragunathjawahar Twitter / Medium / GitHub