Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

API Specifications as Executable Contracts @harikrishnan83

Slide 3

Slide 3 text

Hari Krishnan Consultant and Coach @harikrishnan83 Cloud Transformation Extreme Programming Agile and Lean

Slide 4

Slide 4 text

Teaser / Quick Demo OpenAPI Specification to API Tests #NO-CODE

Slide 5

Slide 5 text

Context Why Contract Driven Development? #CDD

Slide 6

Slide 6 text

© 2022 All Rights Reserved

Slide 7

Slide 7 text

© 2022 All Rights Reserved

Slide 8

Slide 8 text

© 2022 All Rights Reserved

Slide 9

Slide 9 text

© 2022 All Rights Reserved

Slide 10

Slide 10 text

Shift-Left Identify compatibility issues without integration testing

Slide 11

Slide 11 text

© 2022 All Rights Reserved Are API Specifications sufficient for his?

Slide 12

Slide 12 text

Executable Contacts Enforcing API Specifications

Slide 13

Slide 13 text

© 2022 All Rights Reserved

Slide 14

Slide 14 text

Consumer Side Story Emulating the Provider #SMART-MOCKS

Slide 15

Slide 15 text

Smart Mocks Live Demo

Slide 16

Slide 16 text

© 2022 All Rights Reserved Workflow Tests / Need for Dynamic Mocks • Step 1 - POST /products – Request: {data} – Response: productId • Step 2 - GET /products/{productId} Output of Step 1 = Input of Step 2

Slide 17

Slide 17 text

Anatomy of a Component Test Isolating Components with Smart Mocks

Slide 18

Slide 18 text

© 2022 All Rights Reserved

Slide 19

Slide 19 text

Provider Side Story Contract as Tests #TESTS-FOR-FREE

Slide 20

Slide 20 text

© 2022 All Rights Reserved

Slide 21

Slide 21 text

Tracer Bullet Approach Live Demo

Slide 22

Slide 22 text

Backward Compatibility Contract vs Contract

Slide 23

Slide 23 text

© 2022 All Rights Reserved

Slide 24

Slide 24 text

Contract vs Contract Live Demo

Slide 25

Slide 25 text

© 2022 All Rights Reserved POP-QUIZ Which of these changes are backward compatible? • In Request – Add a mandatory / required field • In Request – Change Optional Nullable field to Optional Non-Nullable • What if I change a schema component that is referenced – in request and response? – at various levels of hierarchy as part of other schema components – across multiple specification files (remote references)

Slide 26

Slide 26 text

Central Contract Repo Are we on the same page? #TREAT-CONTRACT-AS-CODE

Slide 27

Slide 27 text

© 2022 All Rights Reserved

Slide 28

Slide 28 text

© 2022 All Rights Reserved

Slide 29

Slide 29 text

© 2022 All Rights Reserved Contract Versioning Major – Backward Incompatible Change Minor – Backward Compatible Change Patch – Structure Change Only. Example: Extracting common schema to components section

Slide 30

Slide 30 text

© 2022 All Rights Reserved Referring to Contracts in Central Contract Repo

Slide 31

Slide 31 text

Embracing CDD Contract Driven Development and CI Pipelines

Slide 32

Slide 32 text

© 2022 All Rights Reserved

Slide 33

Slide 33 text

© 2022 All Rights Reserved Credits • Team – Naresh Jain @nashjain – Joel Rosario @finalprefix – Hari Krishnan @harikrishnan83 – and thanks to all Specmatic Contributors, Early Adopters • Third party marks and brands are the property of their respective holders

Slide 34

Slide 34 text

Q and A https://specmatic.in/

Slide 35

Slide 35 text

Thank You! @harikrishnan83 https://specmatic.in/