Steroids for .NET
Developers
Serhiy Kalinets
@skalinets
kalinets@gmail.com
Rails Reactor
About Me
16 years in the business
In .NET since 2005
Love to code
Software Architect
@ Rails Reactor
@skalinets 2
@skalinets 3
@skalinets 4
Developer Should
Spend more time coding
Spend less time for other stuff
Get the most fun while coding
@skalinets 5
http://blog.programming-school.jp/@skalinets 6
IRL
• Non technical sh*t (meetings etc.)
• Deployment
• Debugging
• Troubleshooting
• Environment Setup
@skalinets 7
Everything should be no-brainer
• Continuous Integration
• Continuous Delivery
• Continuous Deployment
• Continuous Development
@skalinets 8
@skalinets 9
Main Ideas
• Iterative process
• Start with infrastructure and delivery process
(Iteration 0)
• Requirements  Acceptance Test  Development
via TDD  Ready Feature
@skalinets 10
Iteration 0 (Walking Skeleton)
• Build
• Run Unit Tests
• Prepare Deployment Package
• Deploy to Dev
• Run Acceptance Tests
• Deploy to QA
@skalinets 11
@skalinets 12
Build: Fake (F# Make)
• If you ever wanted to use F#
@skalinets 13
@skalinets 14
Delivery Pipeline Tools
VCS: git
CI: TeamCity
Deployment: Octopus
Versioning: gitversion
@skalinets 15
Feedback Cycle
@skalinets 16
40
34
36
30
26
28
26
0
2
4
6
8
10
12
0
4
0
4
6
2 2
1 2 3 4 5 6 7
Bugs Regression Features
@skalinets 17
Levels of Testing
• Unit
• Integration
• Acceptance
• Manual (Exploratory)
@skalinets 18
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 19
• Regression
• Should always be Green
• In-Progress
• Can be red while feature is being developed
2 Acceptance Sets
@skalinets 20
Acceptance Tests: Canopy
• Human friendly DSL for web testing
• Wraps WebDriver
• Uses F#
@skalinets 21
module MyTests
open 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 24
https://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
@skalinets 41
• http://bit.ly/dotnet-steroids
• http://fsharp.github.io/FAKE/
• http://nsubstitute.github.io/
• https://github.com/AutoFixture/AutoFixture
• http://approvaltests.com/
• https://lefthandedgoat.github.io/canopy/
• https://xunit.github.io/
• http://fluentassertions.com/
links
@skalinets 42
Thanks
https://skalinets.github.io/
https://www.facebook.com/serhiy.kalinets
kalinets@gmail.com
https://twitter.com/skalinets
@skalinets 43

Стероиды для Дотнетчика