Slide 1

Slide 1 text

TERRIBLE TESTING case studies in

Slide 2

Slide 2 text

are you testing the right things?

Slide 3

Slide 3 text

I have no idea

Slide 4

Slide 4 text

PROJECTS SOFTWARE TESTING and what they taught me about 5

Slide 5

Slide 5 text

toddhgardner Todd H Gardner !

Slide 6

Slide 6 text

1 Big Todd’s Awesome CRM

Slide 7

Slide 7 text

1 Deliver a Customer Relationship Management system to replace ad-hoc processes for internal sales teams

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

I have no idea what I’m doing

Slide 10

Slide 10 text

Consulting!

Slide 11

Slide 11 text

They have no idea what they’re doing

Slide 12

Slide 12 text

70% Code Coverage REQUIRED

Slide 13

Slide 13 text

Assertion-Free Testing public void Test_MyObj_For_Coverage() { MyObj obj = new MyObj(); try { obj.method1(); } catch (Exception e) {} try { obj.method2(); } catch (Exception e) {} try { obj.method3(); } catch (Exception e) {} // 100% Coverage, W00t! }

Slide 14

Slide 14 text

Cool Tests Bro

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

1 Big Todd’s Awesome CRM The Aftermath

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

They all had their rules… 1. Thou shall test everything 2. Thou shalt not ship code 3. Thou shall have more sys 4. Thou shall abstract test f 5. Thou shalt not duplicate

Slide 20

Slide 20 text

goodness testiness coverage test code ratio

Slide 21

Slide 21 text

It’s unprofessional to ship untested code “

Slide 22

Slide 22 text

2 Big Corp’s Video Academy

Slide 23

Slide 23 text

2 Create a online Video Training Platform for crypto-zoologists

Slide 24

Slide 24 text

unit code coverage 100% 100 0

Slide 25

Slide 25 text

MOCKS

Slide 26

Slide 26 text

code analysis metrics

Slide 27

Slide 27 text

BUGS!

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

2 Big Corp’s Video Academy The Aftermath

Slide 30

Slide 30 text

code coverage % 100 0 what do we learn?

Slide 31

Slide 31 text

code coverage % 100 0 what do we learn? not testing

Slide 32

Slide 32 text

code coverage % 100 0 what do we learn? metrics-driven incentives

Slide 33

Slide 33 text

code coverage % 100 0 what do we learn? nothing at all

Slide 34

Slide 34 text

Testing the Mocks public void Test_MyObj_With_Mocks() { Mock mockObj1 = new Mock(); Mock mockObj2 = new Mock(); MyObj obj = new MyObj(mockObj1, mockObj2); mockObj2.expect().toBeCalledWith(mockObj1).andReturn(mockObj1); obj.method(); mockObj1.assertExpectations(); mockObj2.assertExpectations(); // What are we testing again? }

Slide 35

Slide 35 text

Unit Tests

Slide 36

Slide 36 text

Test-Induced http://david.heinemeierhansson.com/2014/test-induced-design-damage.html Design Damage

Slide 37

Slide 37 text

3 Acme’s Collaboration Computing Platform

Slide 38

Slide 38 text

3 Develop a platform for Spies to Upload Confidential Data and Collaborate on missions.

Slide 39

Slide 39 text

Market and Technology FRONTIERS

Slide 40

Slide 40 text

$2M / Mo Over 200 of the Cleverest Designers, Developers, and Testers Burning

Slide 41

Slide 41 text

Advanced TECHNOLOGY

Slide 42

Slide 42 text

System Tests Integration Tests Unit Tests Selenium UI and Services Inter-Module Contract Tests TDD, Conversation-based tests Testing Pyramid

Slide 43

Slide 43 text

WE BUILT IT

Slide 44

Slide 44 text

NO ONE CAME

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

3 Acme’s Collaboration Computing Platform The Aftermath

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

System Tests Integration Tests Unit Tests Testing Pyramid

Slide 49

Slide 49 text

System Tests Integration Tests Unit Tests Testing Pyramid Interface Risk Orchestration Risk Functional Risk

Slide 50

Slide 50 text

System Tests Integration Tests Unit Tests Testing Pyramid Interface Risk Orchestration Risk Functional Risk User Tests Market Risk

Slide 51

Slide 51 text

Interface Risk Orchestration Risk Functional Risk Market Risk Testing Scales

Slide 52

Slide 52 text

Interface Risk Orchestration Risk Functional Risk Market Risk Testing Scales System Tests Integration Tests User Tests Unit Tests

Slide 53

Slide 53 text

4 Widget eCommerce Monolith’s Sell-a-majig

Slide 54

Slide 54 text

4 Expand the Widget Ecommerce platform with more products

Slide 55

Slide 55 text

yet another ECOMMERCE project

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

lots of captive USERS

Slide 58

Slide 58 text

Interface Risk Orchestration Risk Functional Risk Market Risk Testing Scales

Slide 59

Slide 59 text

Interface Orchestration Functional Market Testing Scales System Tests Integration Tests User Tests Unit Tests

Slide 60

Slide 60 text

it shipped UGLY

Slide 61

Slide 61 text

customers kept BUYING

Slide 62

Slide 62 text

Prints Money the dirty old duct-taped machine that tm

Slide 63

Slide 63 text

4 Widget eCommerce Monolith’s Sell-a-majig The Aftermath

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Monolith ECommerce Acme Collaboration Information Technology Uninteresting Fragile Technology Poorly Tested Success! Engineering Advancing Latest Technology Well Tested Failure!

Slide 66

Slide 66 text

Monolith ECommerce Acme Collaboration Success! Failure! High Risk Low Risk

Slide 67

Slide 67 text

SYSTEM Purpose Criticality Lifespan Frequency CONFIDENCE

Slide 68

Slide 68 text

5 My Startup

Slide 69

Slide 69 text

5 find and fix JavaScript bugs in modern web applications …and build a better web

Slide 70

Slide 70 text

{Track:js} http://trackjs.com JavaScript Error Monitoring

Slide 71

Slide 71 text

User Activity AJAX Requests Console Logging Browser Context Inline Source

Slide 72

Slide 72 text

Interface Risk Orchestration Risk Functional Risk Market Risk Testing Scales

Slide 73

Slide 73 text

My Money! This time it’s

Slide 74

Slide 74 text

Launch Fast and measure

Slide 75

Slide 75 text

Simple Decoupled Obvious Abstract & &

Slide 76

Slide 76 text

Plumbing Services

Slide 77

Slide 77 text

Interface Risk Orchestration Risk Functional Risk Market Risk Testing Scales System Tests Integration Tests User Tests Unit Tests

Slide 78

Slide 78 text

Service Model Test Fixture Other Services Wrapper Data Unit Test Integration Test Testing Structure

Slide 79

Slide 79 text

“beta” Service Dragons be here! Testing Structure Canary Users Analytics Monitoring

Slide 80

Slide 80 text

FAST TO FIX is almost as good as NEVER BROKEN (and sometimes better)

Slide 81

Slide 81 text

PROJECTS SOFTWARE TESTING and what they taught me about 5

Slide 82

Slide 82 text

1 Big Todd’s Awesome CRM METRICS don’t test to hit

Slide 83

Slide 83 text

2 Big Corp’s Video Academy BREAKING test what is

Slide 84

Slide 84 text

3 Acme’s Collaboration Computing Platform SCARIEST test the thing first

Slide 85

Slide 85 text

4 Widget eCommerce Monolith’s Sell-a-majig CUSTOMER USE tests can’t substitute for

Slide 86

Slide 86 text

5 JavaScript Error Tracking TrackJS’s MONITORING can substitute for tests

Slide 87

Slide 87 text

{Track:js} http://trackjs.com JavaScript Error Monitoring

Slide 88

Slide 88 text

TERRIBLE TESTING case studies in toddhgardner ! " [email protected]