Slide 1

Slide 1 text

co-IT.eu GmbH We Empower Outstanding Business Solutions www.co-IT.eu Kentan – A Modular Test Data Composer @GregOnNet

Slide 2

Slide 2 text

@GregOnNet CTO Gregor Woiwode

Slide 3

Slide 3 text

github.com/kentan-official/kentan/

Slide 4

Slide 4 text

Why? The task synthesizing test data is underestimated.

Slide 5

Slide 5 text

Arrange Act Assert Theoretically … EVOLUTION OF UNIT TESTS

Slide 6

Slide 6 text

Arrange Act Assert Mostly we see… EVOLUTION OF UNIT TESTS

Slide 7

Slide 7 text

Arrange Act Assert Things can get even more complicated EVOLUTION OF UNIT TESTS

Slide 8

Slide 8 text

The share for Arrangement and Act grows

Slide 9

Slide 9 text

https://kentan-official.github.io/kentan/

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

The flow of Kentan ARCHITECTURE Setup Model Configure Test Sketch Compose Override

Slide 13

Slide 13 text

Support for Testing Frameworks KENTAN All that use

Slide 14

Slide 14 text

Setup Sketch export interface Product { id: number; title: string; description: string; priceInDollars: number; }

Slide 15

Slide 15 text

Sketch import { Sketch } from '@kentan-official/core'; import { Product } from '@models/product'; export class ForProduct extends Sketch { constructor() { super({ id: 1, title: 'XBox One‘, description: 'Gaming Console‘, priceInDollars: 300 }); } }

Slide 16

Slide 16 text

Sketch import { Sketch } from '@kentan-official/core'; import { Product } from '@models/product'; export class ForProduct extends Sketch { constructor() { super({ id: 1, title: 'XBox One‘, description: 'Gaming Console‘, priceInDollars: 300 }); } }

Slide 17

Slide 17 text

Sketch import { Sketch } from '@kentan-official/core'; import { Product } from '@models/product'; export class ForProduct extends Sketch { constructor() { super({ id: 1, title: 'XBox One‘, description: 'Gaming Console‘, priceInDollars: 300 }); } }

Slide 18

Slide 18 text

Sketch import { Sketch } from '@kentan-official/core'; import { Product } from '@models/product'; export class ForProduct extends Sketch { constructor() { super({ id: 1, title: 'XBox One', description: 'Gaming Console', priceInDollars: 300 }); } }

Slide 19

Slide 19 text

Configure SKETCH describe('Product', () => { describe('When a price is given', () => { it('should yield the actual price', () => { const givenPrice = 300; const product = Kentan.sketch(ForProduct).model(); expect(product.priceInDollars).toBe(givenPrice); }); }); });

Slide 20

Slide 20 text

Configure SKETCH describe('Product', () => { describe('When a price is given', () => { it('should yield the actual price', () => { const givenPrice = 300; const product = Kentan.sketch(ForProduct).model(); expect(product.priceInDollars).toBe(givenPrice); }); }); });

Slide 21

Slide 21 text

Configure SKETCH describe('Product', () => { describe('When a price is given', () => { it('should yield the actual price', () => { const givenPrice = 300; const product = Kentan.sketch(ForProduct).model(); expect(product.priceInDollars).toBe(givenPrice); }); }); });

Slide 22

Slide 22 text

Configure SKETCH describe('Product', () => { describe('When a price is given', () => { it('should yield the actual price', () => { const givenPrice = 300; const product = Kentan.sketch(ForProduct).model(); expect(product.priceInDollars).toBe(givenPrice); }); }); });

Slide 23

Slide 23 text

Configure SKETCH Kentan.sketch(ForShoppingBasket).model({ title: 'Play Station' }); Kentan provides bulk overrides.

Slide 24

Slide 24 text

Configure SKETCH Kentan.sketch(ForShoppingBasket) .take(10) .models({ title: index => `Game Console ${index}` }); Kentan creates lists

Slide 25

Slide 25 text

Configure SKETCH Kentan.sketch(ForShoppingBasket) .take(10) .models({ title: index => `Game Console ${index}` }); Bulk overrides for lists

Slide 26

Slide 26 text

npm install @kentan-official/core Kentan is hosted at

Slide 27

Slide 27 text

Demo https://github.com/kentan-official/quick-start

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Kentan has built-in support for cypress.io

Slide 30

Slide 30 text

Demo https://github.com/kentan-official/cypress-playground

Slide 31

Slide 31 text

The Downside Of Kentan KENTAN More Files Boilerplate Code

Slide 32

Slide 32 text

If you detect a weakness turn it into a strength.

Slide 33

Slide 33 text

+

Slide 34

Slide 34 text

ng add @kentan-official/schematics Add Kentan to https://kentan-official.github.io/kentan/docs/#/angular-cli/schematics

Slide 35

Slide 35 text

Demo https://github.com/kentan-official/angular-playground

Slide 36

Slide 36 text

Summary KENTAN Sketch creates reusable test data Generator builds configurable Sketch-Lists Helpers configure Sketches Tooling for Angular generating Sketchs automatically

Slide 37

Slide 37 text

co-IT.eu GmbH We Empower Outstanding Business Solutions www.co-IT.eu Thank You @GregOnNet