Slide 1

Slide 1 text

Quite Simple Way to Test for Integration Testing Rijun Suzuki

Slide 2

Slide 2 text

Agenda Bad practice of Automation Testing How to start an automatic test (learn from failure) Anti pattern of automation test a good way to introduce automated tests with limited resources Introduce simple way to test for integration testing

Slide 3

Slide 3 text

Bad practice of Automation Testing

Slide 4

Slide 4 text

• Scope • E2E Test (GUI), Regression Test • Constitution • Selenium WebDriver, JUnit, Jenkins The goal is high from the beginning

Slide 5

Slide 5 text

Some Problems • LOW effect, HIGH cost to maintenance • Maintenance cost, nobody can maintenance • Who will maintain? (if person who in charge is quited the project) • No Full time person (Time & Skill) • Tried to automate everything • Aimed to be able to find bugs

Slide 6

Slide 6 text

I thought that this method would not scalable

Slide 7

Slide 7 text

Why?

Slide 8

Slide 8 text

There were no resources and aim configurations

Slide 9

Slide 9 text

(Lesson) Anti pattern of automation test

Slide 10

Slide 10 text

Eight principles of test automation
 from Test Automation Research Group JP • https://sites.google.com/site/testautomationresearch/test_automation_principle 1.Manual test does not go away 2.It is useless to do it manually and automate tests with no effect 3.Automatic test only tests what I wrote 4.The utility of test automation is not limited to cost reduction 5.The development of automatic test system is to be continued 6.Automation study from the beginning of the project 7.Automatic testing rarely finds new bugs 8.A new task of analyzing test results is born

Slide 11

Slide 11 text

Automation High high (noun) : a state of altered consciousness induced by alcohol or narcotics • Test Automation Pattern Language
 (from Kansai Test Collection)
 http://kencolle.github.io/AutomationPatternLanguage/ AutomationFavor.html I am obsessed with the fun of automation introduced in the exam and I am trying to promote automation more and more without designing the whole. As a result, it seems that similar systems will be muddy, and management will be difficult after that.

Slide 12

Slide 12 text

It is important to first decide the purpose and scope

Slide 13

Slide 13 text

a good way to introduce automated tests with limited resources

Slide 14

Slide 14 text

Where to start from

Slide 15

Slide 15 text

The pyramid climbs from below

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

https://watirmelon.blog/2012/01/31/introducing-the-software-testing-ice-cream-cone/ Test automation pyramid and Anti-pattern UI Integration Unit ̏Layer

Slide 18

Slide 18 text

https://watirmelon.blog/2012/01/31/introducing-the-software-testing-ice-cream-cone/ Test automation pyramid and Anti-pattern UI Developer Developer & QA QA general classification Integration Unit ̏Layer

Slide 19

Slide 19 text

https://watirmelon.blog/2012/01/31/introducing-the-software-testing-ice-cream-cone/ Test automation pyramid and Anti-pattern UI ROI Developer Developer & QA QA general classification Integration Unit ̏Layer

Slide 20

Slide 20 text

https://watirmelon.blog/2012/01/31/introducing-the-software-testing-ice-cream-cone/ Test automation pyramid and Anti-pattern UI ROI Make tests as layer under the pyramid as possible Developer Developer & QA QA general classification Integration Unit ̏Layer

Slide 21

Slide 21 text

https://watirmelon.blog/2012/01/31/introducing-the-software-testing-ice-cream-cone/ Test automation pyramid and Anti-pattern UI ROI Make tests as layer under the pyramid as possible Developer Developer & QA QA general classification Integration Unit ̏Layer Target should be HERE

Slide 22

Slide 22 text

Implementation of “simple” integration test

Slide 23

Slide 23 text

Postman • GUI Web API Development Environment • also can use API Testing • create test code by GUI

Slide 24

Slide 24 text

Newman • a command line collection runner for Postman.

Slide 25

Slide 25 text

Get API information first • Postman Interceptor (Chrome Extension) • Chrome Developer Tool • Charles Proxy (mobile)

Slide 26

Slide 26 text

how to write script from Postman.app • Create Request block per API 1. Select API Method 2. Input API Endpoint URL 3. (If Needed) Input Auth Info
 e.g. Request Header 4. Create Environment 5. Write Test (Assertion)

Slide 27

Slide 27 text

Manage Environment Beta Real

Slide 28

Slide 28 text

Write Tests (Assertion) • Write Assertion by JavaScript tests["Status code is 200"] = responseCode.code === 200; tests["Response time is less than 200ms"] = responseTime < 200; tests["Body matches string"] = responseBody.has("categories");

Slide 29

Slide 29 text

Export Test Script • Export by JSON files

Slide 30

Slide 30 text

sample JSON file

Slide 31

Slide 31 text

Run Tests $ newman run postman_collection.json

Slide 32

Slide 32 text

Integration with CI • build trigger • After every API server deploy and CI completion.

Slide 33

Slide 33 text

build trigger: After API server CI finished build command: execute Shell script

Slide 34

Slide 34 text

Console Output

Slide 35

Slide 35 text

Console Output Test result for each API

Slide 36

Slide 36 text

Console Output Test result for each API All Test result

Slide 37

Slide 37 text

Notify HipChat after the test finished

Slide 38

Slide 38 text

Merit • Easy to introduce • (If you do the least) do not have to write code

Slide 39

Slide 39 text

Conclusion • Think about the scale according to resources • To start small • Start with the part with high effect

Slide 40

Slide 40 text

End