Сергей Калинец "Стероиды для Дотнетчика"

Preview:

Citation preview

Стероиды для ДотнетчикаСергей Калинец @skalinetsRails Reactor

About Me16 years in the business

In .NET since 2005

Love to code

Software Architect @ Rails Reactor

@skalinets 2

@skalinets 3

@skalinets 4

@skalinets 5

Developer ShouldSpend more time coding

Spend less time for other stuff

Get the most fun while coding

@skalinets 6http://blog.programming-school.jp/

@skalinets 7

IRL• Non technical sh*t (meetings etc.)• Deployment• Debugging• Troubleshooting• Environment Setup

@skalinets 8

Everything should be no-brainer• Continuous Integration

• Continuous Delivery

• Continuous Deployment

• Continuous Development

@skalinets 9

@skalinets 10

Main Ideas• Iterative process

• Start with infrastructure and delivery process (Iteration 0)

@skalinets 11

Iteration 0 (Walking Skeleton)• Build• Run Unit Tests• Prepare Deployment Package• Deploy to Dev• Run Acceptance Tests• Deploy to QA

@skalinets 12

@skalinets 13

Build: Fake (F# Make)• If you ever wanted to use F#

@skalinets 14

@skalinets 15

Delivery Pipeline ToolsVCS: git

CI: TeamCity

Deployment: Octopus

Versioning: gitversion

@skalinets 16

Feedback Cycle

@skalinets 17

1 2 3 4 5 6 7

40

34 36

3026 28 26

0

2

4

6

8

10 12

04

04 6

2 2

Bugs Regression Features

@skalinets 18

Levels of Testing• Unit• Integration• Acceptance• Manual (Exploratory)

@skalinets 19

Acceptance Tests• Test system or application from end to end• In most cases interact with UI• If not possible – test closest to UI (API)

@skalinets 20

Acceptance Tests: Canopy• Human friendly DSL for web testing• Wraps WebDriver• Uses F#

@skalinets 21

module MyTestsopen canopy

let fwdays () =    // context is used to group tests    context “Just some tests"        // this is a test name     "Demo canopy on fwdays 2017" &&& fun _ ->                // open URL        url "https://frameworksdays.com"                // the rest might not need explanation        click ".NET fwdays '17"        click "Программа"        click "Стероиды для Дотнетчика"         

@skalinets 22

@skalinets 23

And finally… coding

@skalinets 24https://xkcd.com/303/

@skalinets 25

@skalinets 26

Unit Tests

@skalinets 27

@skalinets 28

@skalinets 29

Mock, stub, fake, spy, test double? Strict or loose?

Nah, just substitute for the type you need!

From http://nsubstitute.github.io/

@skalinets 30

Demo Scenario

@skalinets 31

• When adding new post to the blog

• It should be saved in database

Demo Scenario

@skalinets 32

@skalinets 33

@skalinets 34

@skalinets 35

@skalinets 36

@skalinets 37

@skalinets 38

@skalinets 39

@skalinets 40

Recommended