Slide 1

Slide 1 text

Testing Rails Service Oriented Architecture

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

What are Monolithic Applications?

Slide 4

Slide 4 text

What are Monolithic Applications? What is SOA?

Slide 5

Slide 5 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications

Slide 6

Slide 6 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA !

Slide 7

Slide 7 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA

Slide 8

Slide 8 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA Strategies for Testing SOA

Slide 9

Slide 9 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA Strategies for Testing SOA Develop Features for SOA application

Slide 10

Slide 10 text

Monolithic Applications !

Slide 11

Slide 11 text

Client-side ! Monolithic Applications !

Slide 12

Slide 12 text

Client-side ! HTML ! Monolithic Applications !

Slide 13

Slide 13 text

Client-side ! HTML ! JavaScript ! Monolithic Applications !

Slide 14

Slide 14 text

Client-side ! HTML ! CSS ! JavaScript ! Monolithic Applications !

Slide 15

Slide 15 text

Client-side Database Server-side Monolithic Applications !

Slide 16

Slide 16 text

Client-side Database Server-side Monolithic Applications ! db !

Slide 17

Slide 17 text

Client-side Database Server-side Monolithic Applications !

Slide 18

Slide 18 text

Client-side Database Server-side Monolithic Applications ! HTTP requests !

Slide 19

Slide 19 text

Client-side Database Server-side Monolithic Applications ! HTTP requests ! db queries !

Slide 20

Slide 20 text

Client-side Database Server-side Monolithic Applications ! HTTP requests ! Domain Logic ! db queries !

Slide 21

Slide 21 text

Client-side Database Server-side Monolithic Applications ! HTTP requests ! Domain Logic ! db queries ! Populate HTML views !

Slide 22

Slide 22 text

Monolithic Applications ! Deploy Client-side Database Server-side

Slide 23

Slide 23 text

Client-side Database Server-side Monolithic Applications ! School Management App !

Slide 24

Slide 24 text

Service Oriented Architecture !

Slide 25

Slide 25 text

Server-side Database No db Server-side Client-side Server-side Database Service Oriented Architecture !

Slide 26

Slide 26 text

Service Oriented Architecture ! School API Web client Grading

Slide 27

Slide 27 text

Service Oriented Architecture ! Grading Reporting School API Web client

Slide 28

Slide 28 text

Service Oriented Architecture ! Grading Reporting School API Web client HTTP /JSON

Slide 29

Slide 29 text

Service Oriented Architecture ! Grading Reporting School API Web client HTTP /JSON

Slide 30

Slide 30 text

Service Oriented Architecture ! Grading Reporting School API Web client HTTP /JSON

Slide 31

Slide 31 text

Service Oriented Architecture ! Grading Reporting School API Web client HTTP /JSON

Slide 32

Slide 32 text

Service Oriented Architecture ! School API Web client

Slide 33

Slide 33 text

Service Oriented Architecture ! Deploy School API Web client

Slide 34

Slide 34 text

Service Oriented Architecture ! Deploy School API Web client

Slide 35

Slide 35 text

Testing Monolithic Applications Testing Service Oriented Architecture VS

Slide 36

Slide 36 text

Testing Monolithic Applications

Slide 37

Slide 37 text

Testing Monolithic Applications HTML JavaScript HTTP Domain Logic

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Test

Slide 40

Slide 40 text

Clean database

Slide 41

Slide 41 text

Description

Slide 42

Slide 42 text

Data creation

Slide 43

Slide 43 text

State manipulation

Slide 44

Slide 44 text

Assertion

Slide 45

Slide 45 text

Assertion Passing!

Slide 46

Slide 46 text

Testing Monolithic Applications rspec-rails factory_girl_rails database_cleaner Tools

Slide 47

Slide 47 text

Testing Monolithic Applications rspec-rails factory_girl_rails database_cleaner Tools

Slide 48

Slide 48 text

factory_girl_rails

Slide 49

Slide 49 text

factory_girl_rails

Slide 50

Slide 50 text

factory_girl_rails

Slide 51

Slide 51 text

factory_girl_rails

Slide 52

Slide 52 text

factory_girl_rails

Slide 53

Slide 53 text

factory_girl_rails

Slide 54

Slide 54 text

factory_girl_rails

Slide 55

Slide 55 text

factory_girl makes creating test data easier

Slide 56

Slide 56 text

Testing Monolithic Applications rspec-rails factory_girl_rails database_cleaner Tools

Slide 57

Slide 57 text

database_cleaner

Slide 58

Slide 58 text

Schools 0 Principals s 0 Students 0 Clean database database_cleaner

Slide 59

Slide 59 text

Schools 1 Principals s 1 Students 1 database_cleaner

Slide 60

Slide 60 text

Clean database Schools 0 Principals s 0 Students 0 database_cleaner

Slide 61

Slide 61 text

database_cleaner makes destroying test data easier

Slide 62

Slide 62 text

HTTP /JSON Testing Service Oriented Architecture School API Web client

Slide 63

Slide 63 text

School API Web client HTTP /JSON Testing Service Oriented Architecture

Slide 64

Slide 64 text

School API Web client HTTP /JSON No factory_girl No database_cleaner Testing Service Oriented Architecture

Slide 65

Slide 65 text

This is why writing tests for SOA is hard especially for applications like Web Client

Slide 66

Slide 66 text

Testing Rails SOA in the real world

Slide 67

Slide 67 text

! ! ! Other ? Strategies

Slide 68

Slide 68 text

No tests ! ! ! Other ? Strategies

Slide 69

Slide 69 text

No tests ! ! ! Other ? Strategies

Slide 70

Slide 70 text

No tests Stub HTTP requests from Web Client to School API ! ! ! ! Other ? Strategies

Slide 71

Slide 71 text

No tests Stub HTTP requests from Web Client to School API Make HTTP requests from Web Client to School API and seed School API test database ! ! Other ? Strategies

Slide 72

Slide 72 text

No tests Stub HTTP requests from Web Client to School API Make HTTP requests from Web Client to School API and seed School API test database Create/destroy data using School API’s API ! Other ? Strategies

Slide 73

Slide 73 text

My experience with SOA

Slide 74

Slide 74 text

/ \ /~- y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ /\ ~\ / \ Y V | \,-^-. | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () / / \ /~-~\ / y Y V ,-^-./ | \,-^- / { | } \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ \/ \/ \ \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \ { \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y ,-^ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V -^-./ | \,-^-. { | } \ \ | / A /\ \/ \ \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^ / { | } \ | /\ A / \ / /\ ~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ \ / .\-/. /\ () () /\ / \ /~-~\ / \ y Y V ,-^-./ | \,-^-. / { | } \ \ | / /\ A /\ / \/ \/ \ / \ My experience with SOA

Slide 75

Slide 75 text

Developing Features for Web Client

Slide 76

Slide 76 text

School API Web client HTTP /JSON Testing Service Oriented Architecture

Slide 77

Slide 77 text

School API Web client HTTP /JSON No factory_girl No database_cleaner Testing Service Oriented Architecture

Slide 78

Slide 78 text

features Unregister student from school

Slide 79

Slide 79 text

features Unregister student from school Display count of registered students

Slide 80

Slide 80 text

features Unregister student from school Display count of registered students View student profile

Slide 81

Slide 81 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 82

Slide 82 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 83

Slide 83 text

Stub HTTP Requests from Web Client to School API Strategy #1

Slide 84

Slide 84 text

Strategy #1 Stub HTTP Requests from Web Client to School API

Slide 85

Slide 85 text

Web Client Dev:

Slide 86

Slide 86 text

Web Client Dev: Finished the feature. Tests are green.

Slide 87

Slide 87 text

Web Client Dev: Finished the feature. Tests are green. School API Dev:

Slide 88

Slide 88 text

Web Client Dev: Finished the feature. Tests are green. School API Dev: Great!

Slide 89

Slide 89 text

Web Client Dev: Finished the feature. Tests are green. School API Dev: Great! Web Client Dev:

Slide 90

Slide 90 text

Web Client Dev: Finished the feature. Tests are green. School API Dev: Great! Web Client Dev: I deployed. I also told the customer.

Slide 91

Slide 91 text

Web Client Dev: Finished the feature. Tests are green. School API Dev: Great! Web Client Dev: I deployed. I also told the customer. Customer:

Slide 92

Slide 92 text

Web Client Dev: Finished the feature. Tests are green. School API Dev: Great! Web Client Dev: I deployed. I also told the customer. Customer: The site is down :/

Slide 93

Slide 93 text

Web Client Dev:

Slide 94

Slide 94 text

Web Client Dev: What!? My tests were green.

Slide 95

Slide 95 text

School API Dev: Web Client Dev: What!? My tests were green.

Slide 96

Slide 96 text

School API Dev: I renamed /pupils to /students Web Client Dev: What!? My tests were green.

Slide 97

Slide 97 text

School API Dev: I renamed /pupils to /students School API Dev: Web Client Dev: What!? My tests were green.

Slide 98

Slide 98 text

School API Dev: I renamed /pupils to /students School API Dev: Ooops. I forgot to tell you :( Web Client Dev: What!? My tests were green.

Slide 99

Slide 99 text

School API Dev: I renamed /pupils to /students Web Client Dev: School API Dev: Ooops. I forgot to tell you :( Web Client Dev: What!? My tests were green.

Slide 100

Slide 100 text

School API Dev: I renamed /pupils to /students Web Client Dev: ¯\_(π)_/¯ School API Dev: Ooops. I forgot to tell you :( Web Client Dev: What!? My tests were green.

Slide 101

Slide 101 text

Web Client Dev:

Slide 102

Slide 102 text

Web Client Dev: Tell me when you make changes, please :)

Slide 103

Slide 103 text

School API Dev: Web Client Dev: Tell me when you make changes, please :)

Slide 104

Slide 104 text

School API Dev: It won’t happen again. Promise <3 Web Client Dev: Tell me when you make changes, please :)

Slide 105

Slide 105 text

but, it does.

Slide 106

Slide 106 text

This is WHY you need integration tests in Service Oriented Architecture

Slide 107

Slide 107 text

X Strategy #1 Stub HTTP Requests from Web client to School API

Slide 108

Slide 108 text

Fast X Strategy #1 Stub HTTP Requests from Web client to School API

Slide 109

Slide 109 text

False confidence Fast X Strategy #1 Stub HTTP Requests from Web client to School API

Slide 110

Slide 110 text

False confidence Fast X Strategy #1 Stub HTTP Requests from Web client to School API

Slide 111

Slide 111 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 112

Slide 112 text

Web Client dev no longer trusts the Web Client’s test suite. Problem with previous strategy:

Slide 113

Slide 113 text

Solution: Make HTTP requests to School API when runnig Web Client’s test suite Web Client dev no longer trusts the Web Client’s test suite. Problem with previous strategy:

Slide 114

Slide 114 text

Strategy #2 Make HTTP requests and seed School API database

Slide 115

Slide 115 text

Strategy #2 Make HTTP requests and seed School API database Seed School API test database

Slide 116

Slide 116 text

Strategy #2 Make HTTP requests and seed School API database Start School API server in test env Seed School API test database

Slide 117

Slide 117 text

Start School API server in test env Web Client issues HTTP requests to School API Seed School API test database Strategy #2 Make HTTP requests and seed School API database

Slide 118

Slide 118 text

1 test Schools 1 Principals s 1 Students 1 School API Web Client Before

Slide 119

Slide 119 text

Schools 1 Principals s 1 Students 1 #1 School API test db

Slide 120

Slide 120 text

Schools 1 Principals s 1 Students 1 #1 School API test db

Slide 121

Slide 121 text

Schools 1 Principals s 1 Students 0 #1 School API test db

Slide 122

Slide 122 text

Schools 1 Principals s 1 Students 0 #1 School API test db Passing!

Slide 123

Slide 123 text

1 test Schools 1 Principals s 1 Students 0 School API Web Client 1 passing After

Slide 124

Slide 124 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 125

Slide 125 text

2 tests Schools 1 Principals s 1 Students 1 School API Web Client Before

Slide 126

Slide 126 text

Schools 1 Principals s 1 Students 0 #1 School API test db Passing!

Slide 127

Slide 127 text

#2 Schools 1 Principals s 1 Students 0 School API test db

Slide 128

Slide 128 text

#2 Schools 1 Principals s 1 Students 0 School API test db

Slide 129

Slide 129 text

#2 Schools 1 Principals s 1 Students 0 School API test db FAILS!

Slide 130

Slide 130 text

There has to be a better way

Slide 131

Slide 131 text

X Seed School API db AND issue HTTP requests Strategy #2

Slide 132

Slide 132 text

Confidence X Seed School API db AND issue HTTP requests Strategy #2

Slide 133

Slide 133 text

Manage School API server Confidence X Seed School API db AND issue HTTP requests Strategy #2

Slide 134

Slide 134 text

Manage School API server Bleed state between tests Confidence X Seed School API db AND issue HTTP requests Strategy #2

Slide 135

Slide 135 text

Problem with previous strategy Frequently updating seed data for School API test database

Slide 136

Slide 136 text

Problem with previous strategy Solution Create the test data needed for each test Frequently updating seed data for School API test database when each test is run

Slide 137

Slide 137 text

Create test data using School API’s API Strategy #3

Slide 138

Slide 138 text

Create test data using School API’s API Strategy #3 Start School API server in test env

Slide 139

Slide 139 text

Create test data using School API’s API Strategy #3 Start School API server in test env Web Client issues HTTP requests to School API

Slide 140

Slide 140 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 141

Slide 141 text

Customer:

Slide 142

Slide 142 text

Customer: You there?

Slide 143

Slide 143 text

Customer: Web Client Dev: You there?

Slide 144

Slide 144 text

Customer: Web Client Dev: You there? Yep, need something?

Slide 145

Slide 145 text

Customer: Web Client Dev: You there? Yep, need something? Customer:

Slide 146

Slide 146 text

Customer: Web Client Dev: You there? Yep, need something? Customer: I forgot to mention, you can NOT create a school through School API public API.

Slide 147

Slide 147 text

Can NOT use Strategy #3

Slide 148

Slide 148 text

Can NOT use

Slide 149

Slide 149 text

X Strategy #3 Create test data using School API’s API

Slide 150

Slide 150 text

Confidence X Strategy #3 Create test data using School API’s API

Slide 151

Slide 151 text

Manage School API server Confidence X Strategy #3 Create test data using School API’s API

Slide 152

Slide 152 text

Manage School API server Not possible ! Confidence X Strategy #3 Create test data using School API’s API

Slide 153

Slide 153 text

Manage School API server Not possible Creating complex data associations ! Confidence X Strategy #3 Create test data using School API’s API

Slide 154

Slide 154 text

Manage School API server Not possible Creating complex data associations Bleed state between tests Confidence X Strategy #3 Create test data using School API’s API

Slide 155

Slide 155 text

Problem with previous strategy Can not create school with School API’s API

Slide 156

Slide 156 text

Problem with previous strategy Solution Create a school, but with School API’s API Can not create school with School API’s API

Slide 157

Slide 157 text

We need a Strategy #4

Slide 158

Slide 158 text

I want to create test data in School API test database with factory_girl from the Web Client

Slide 159

Slide 159 text

No content

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

remote_factory_girl Strategy #4

Slide 162

Slide 162 text

remote_factory_girl Strategy #4 Install remote_factory_girl_home_rails in School API

Slide 163

Slide 163 text

Gemfile School API

Slide 164

Slide 164 text

config/environments/test.rb School API

Slide 165

Slide 165 text

config/routes.rb School API

Slide 166

Slide 166 text

remote_factory_girl Strategy #4 Install remote_factory_girl_home_rails in School API Install remote_factory_girl in Web Client

Slide 167

Slide 167 text

Gemfile Web Client

Slide 168

Slide 168 text

spec/spec_helper.rb Web Client

Slide 169

Slide 169 text

spec/spec_helper.rb client

Slide 170

Slide 170 text

spec/spec_helper.rb client

Slide 171

Slide 171 text

remote_factory_girl Strategy #4 Start School API server in test env Install remote_factory_girl_home_rails in School API Install remote_factory_girl in Web Client

Slide 172

Slide 172 text

remote_factory_girl Strategy #4 Start School API server in test env Web Client issues HTTP requests to School API Install remote_factory_girl_home_rails in School API Install remote_factory_girl in Web Client

Slide 173

Slide 173 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 174

Slide 174 text

2 tests Schools 0 Principals s 0 Students 0 School API Web Client Before

Slide 175

Slide 175 text

#1 Schools 0 Principals s 0 Students 0 School API test db

Slide 176

Slide 176 text

#1 Schools 1 Principals s 1 Students 1 School API test db

Slide 177

Slide 177 text

#1 Schools 1 Principals s 1 Students 0 School API test db

Slide 178

Slide 178 text

#1 Schools 1 Principals s 1 Students 0 School API test db

Slide 179

Slide 179 text

Passing! #1 Schools 1 Principals s 1 Students 0 School API test db

Slide 180

Slide 180 text

#2 Schools 1 Principals s 1 Students 0 School API test db

Slide 181

Slide 181 text

#2 Passing! Schools 2 Principals s 2 Students 0 School API test db

Slide 182

Slide 182 text

2 tests Schools 2 Principals s 2 Students 0 School API Web Client 2 passing After

Slide 183

Slide 183 text

Features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 184

Slide 184 text

3 tests School API Web Client Before Schools 0 Principals s 0 Students 0

Slide 185

Slide 185 text

#1 Schools 1 Principals s 1 Students 0 School API test db Passing!

Slide 186

Slide 186 text

#2 Schools 2 Principals s 2 Students 0 School API test db Passing!

Slide 187

Slide 187 text

#3 Passing! Schools 3 Principals s 3 Students 1 School API test db

Slide 188

Slide 188 text

3 tests Schools 3 Principals s 3 Students 1 School API Web Client 3 passing After

Slide 189

Slide 189 text

Customer:

Slide 190

Slide 190 text

Customer: You there?

Slide 191

Slide 191 text

Customer: School API Dev: You there?

Slide 192

Slide 192 text

Customer: School API Dev: You there? Yep, need something?

Slide 193

Slide 193 text

Customer: You there? Yep, need something? Customer: School API Dev:

Slide 194

Slide 194 text

Customer: You there? Yep, need something? Customer: Student emails have to be UNIQUE. School API Dev:

Slide 195

Slide 195 text

Customer: You there? Yep, need something? Customer: Student emails have to be UNIQUE. School API Dev: School API Dev:

Slide 196

Slide 196 text

Customer: You there? Yep, need something? Customer: Student emails have to be UNIQUE. School API Dev: Ok. Not a problem. School API Dev:

Slide 197

Slide 197 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 198

Slide 198 text

4 tests Schools 0 Principals s 0 Students 0 School API Web Client Before

Slide 199

Slide 199 text

#1 Schools 1 Principals s 1 Students 0 School API test db Passing!

Slide 200

Slide 200 text

#2 Schools 2 Principals s 2 Students 0 School API test db Passing!

Slide 201

Slide 201 text

#3 Passing! Schools 3 Principals s 3 Students 1 School API test db

Slide 202

Slide 202 text

#4 FAILS! Schools 3 Principals s 3 Students 1 School API test db student email has to be unique

Slide 203

Slide 203 text

There has to be a better way

Slide 204

Slide 204 text

X remote_factory_girl Strategy #4

Slide 205

Slide 205 text

Confidence ! X remote_factory_girl Strategy #4

Slide 206

Slide 206 text

Confidence Create complex test data ! X remote_factory_girl Strategy #4

Slide 207

Slide 207 text

Confidence Create complex test data Create data not available through API X remote_factory_girl Strategy #4

Slide 208

Slide 208 text

Manage School API server ! Confidence Create complex test data Create data not available through API X remote_factory_girl Strategy #4

Slide 209

Slide 209 text

Manage School API server Bleed state between tests Confidence Create complex test data Create data not available through API X remote_factory_girl Strategy #4

Slide 210

Slide 210 text

Problem with previous strategy State in School API test database persists between tests in Web Client

Slide 211

Slide 211 text

Problem with previous strategy Solution Destroy test data after each test with remote_database_cleaner State in School API test database persists between tests in Web Client

Slide 212

Slide 212 text

remote_database_cleanear Strategy #5

Slide 213

Slide 213 text

remote_database_cleanear Strategy #5 Install remote_database_cleaner_home_rails in School API

Slide 214

Slide 214 text

Gemfile School API

Slide 215

Slide 215 text

config/environments/test.rb School API

Slide 216

Slide 216 text

config/routes.rb School API

Slide 217

Slide 217 text

remote_database_cleanear Strategy #5 Install remote_database_cleaner_home_rails in School API Install remote_database_cleaner in Web Client

Slide 218

Slide 218 text

Gemfile Web Client

Slide 219

Slide 219 text

spec/spec_helper.rb Web Client

Slide 220

Slide 220 text

spec/spec_helper.rb Web Client

Slide 221

Slide 221 text

spec/spec_helper.rb Web Client

Slide 222

Slide 222 text

spec/spec_helper.rb Web Client

Slide 223

Slide 223 text

spec/spec_helper.rb Web Client

Slide 224

Slide 224 text

spec/spec_helper.rb Web Client

Slide 225

Slide 225 text

remote_database_cleanear Strategy #5 Start School API server in test env Install remote_database_cleaner_home_rails in School API Install remote_database_cleaner in Web Client

Slide 226

Slide 226 text

remote_database_cleanear Strategy #5 Start School API server in test env Install remote_database_cleaner_home_rails in School API Install remote_database_cleaner in Web Client Web Client issues HTTP requests to School API

Slide 227

Slide 227 text

features Unregister student from school Display count of registered students View student profile Edit student profile

Slide 228

Slide 228 text

4 tests Schools 0 Principals s 0 Students 0 School API Web Client Before

Slide 229

Slide 229 text

#1 Schools 0 Principals s 0 Students 0 School API test db Passing!

Slide 230

Slide 230 text

#2 Passing! Schools 0 Principals s 0 Students 0 School API test db

Slide 231

Slide 231 text

#3 Passing! Schools 0 Principals s 0 Students 0 School API test db

Slide 232

Slide 232 text

#4 Schools 0 Principals s 0 Students 0 School API test db Passing!

Slide 233

Slide 233 text

4 tests Schools 0 Principals s 0 Students 0 School API Web Client 4 passing After

Slide 234

Slide 234 text

X remote_database_cleaner Strategy #4

Slide 235

Slide 235 text

Does not bleed state between tests ! X remote_database_cleaner Strategy #4

Slide 236

Slide 236 text

Manage School API server ! Does not bleed state between tests ! X remote_database_cleaner Strategy #4

Slide 237

Slide 237 text

Now the applications are also setup for Continuous Integration - Jenkins

Slide 238

Slide 238 text

The Takeaway Integration tests give us more confidence in SOA

Slide 239

Slide 239 text

The Takeaway Integration tests give us more confidence in SOA Requires more setup initially

Slide 240

Slide 240 text

The Takeaway Integration tests give us more confidence in SOA Requires more setup initially

Slide 241

Slide 241 text

The Takeaway Integration tests give us more confidence in SOA Requires more setup initially But, pays dividends in the long run

Slide 242

Slide 242 text

blog: http://www.bignerdranch.com/blog/testing-rails-service-oriented-architecture/ example: https://github.com/tdouce/soa_integration_testing

Slide 243

Slide 243 text

What are Monolithic Applications?

Slide 244

Slide 244 text

What are Monolithic Applications? What is SOA?

Slide 245

Slide 245 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications

Slide 246

Slide 246 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA !

Slide 247

Slide 247 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA

Slide 248

Slide 248 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA Strategies for Testing SOA

Slide 249

Slide 249 text

What are Monolithic Applications? What is SOA? Testing Monolithic Applications Testing SOA Challenges with Testing SOA Strategies for Testing SOA Develop Features for SOA application

Slide 250

Slide 250 text

Questions?