SlideShare a Scribd company logo
1 of 44
Download to read offline
AMIR BARYLKO
                                 EASY
                            AUTOMATION
                             FOR EVERY DAY
                               PROJECTS

                            WINNIPEG CODE CAMP
                                  FEB 2011

Amir Barylko - CodeCamp 2011                     MavenThought Inc.
Sunday, February 27, 2011
WHO AM I?

    • Quality               Expert

    • Architect

    • Developer

    • Mentor

    • Great             cook

    • The          one who’s entertaining you for the next hour!
Amir Barylko - CodeCamp 2011                                       MavenThought Inc.
Sunday, February 27, 2011
RESOURCES

    • Email: amir@barylko.com

    • Twitter: @abarylko

    • Blog: http://www.orthocoders.com

    • Materials: http://www.orthocoders.com/presentations




Amir Barylko - CodeCamp 2011                            MavenThought Inc.
Sunday, February 27, 2011
WHO NEEDS
                            AUTOMATION?




Amir Barylko - CodeCamp 2011              MavenThought Inc.
Sunday, February 27, 2011
EVERY DAY PROJECT SETUP

    • Repetitive              task (project structure, scripts, etc)

    • Source                control setup

    • Testing               setup

    • Database                setup

    • Deployment                    setup


Amir Barylko - CodeCamp 2011                                           MavenThought Inc.
Sunday, February 27, 2011
MANUAL SETUP

    • Get          the last project, copy, paste & delete

    • Use          documentation and follow instructions (ha! good one!)

    • Use          the IDE to build

    • Copy             the assemblies, etc to where

    • Database              connection centralized or hardcoded


Amir Barylko - CodeCamp 2011                                      MavenThought Inc.
Sunday, February 27, 2011
WHAT’S WRONG?

    • Lengthy               process (waste)       • Very   hard to maintain

    • Hard            to reproduce                • Complex    for larger teams

    • Usually               no documented         • Hard   to deploy

    • The   architect just moved to               • High   dependency with the
        another country                            IDE

    • Coupled                to the environment

Amir Barylko - CodeCamp 2011                                            MavenThought Inc.
Sunday, February 27, 2011
WHAT TO DO?

    • Avoid  It works on my                        • Scripts   for every task!
        computer!
                                                   • Continuous     integration
    • Use          application skeletons
                                                   • TDD     & BDD
    • End          to end setup from day
        one!                                       • Clear
                                                         feature development
                                                    process
    • Always                in deliverable state


Amir Barylko - CodeCamp 2011                                               MavenThought Inc.
Sunday, February 27, 2011
ONE STEP AT A TIME
                                   Project skeleton
                                  Build Automation
                                  Test Automation
                                       CI setup
                               Push Changes (commit)


Amir Barylko - CodeCamp 2011                           MavenThought Inc.
Sunday, February 27, 2011
PROJECT SKELETON




Amir Barylko - CodeCamp 2011                   MavenThought Inc.
Sunday, February 27, 2011
FOLDER STRUCTURE
    •   MediaLibrary
        --- MavenThought.MediaLibrary.sln : Main solution file
        --- Rakefile: Main rake file to launch build, test, etc.
        +-- main: Project files (sources)
        +-- test: Test project files
        +-- features: Features used by Capybara + Cucumber
        +-- lib2: Dependencies that can't be installed with bundler
        +-- tools: Tools used to run tests, xslt, etc.




Amir Barylko - CodeCamp 2011                                     MavenThought Inc.
Sunday, February 27, 2011
BUILD AUTOMATION




Amir Barylko - CodeCamp 2011               MavenThought Inc.
Sunday, February 27, 2011
BUILD TOOLS

    •Batch files
    • MSBuild (XML)
    • NAnt (better XML)
    • FinalBuilder (Visual)
    • VisualBuild (Visual)
    • Rake (Ruby)
    • BooBS (Boo Build System)
    • Psake(Powershell)


Amir Barylko - CodeCamp 2011                 MavenThought Inc.
Sunday, February 27, 2011
ARE YOU NUTS? RUBY?

    • The          best tool for the job

    • What              does it mean to be a developer?

    • Ruby            is a great scripting language

    • Need              something? There is a gem for that....




Amir Barylko - CodeCamp 2011                                     MavenThought Inc.
Sunday, February 27, 2011
RAKE

    • Domain                Specific Language

    • Great, great, great           .... grandchild of make

    • Is     just Ruby

    • Lots          of gems (libraries) available




Amir Barylko - CodeCamp 2011                                  MavenThought Inc.
Sunday, February 27, 2011
ALBACORE

    • Basic           functionality for .NET projects

    • OpenSource

    • Active                Development

    • Very           easy to use




Amir Barylko - CodeCamp 2011                            MavenThought Inc.
Sunday, February 27, 2011
BASIC RAKEFILE
    require 'rubygems'
    require 'albacore'
    require 'rake/clean'

    include FileUtils

    solution_file = FileList["*.sln"].first

    project_name = "MavenThought.MovieLibrary"

    CLEAN.include("main/**/bin", "main/**/obj", "test/**/obj", "test/**/bin")

    CLOBBER.include("**/_*", "lib/*", "**/*.user", "**/*.cache", "**/*.suo")




Amir Barylko - CodeCamp 2011                                           MavenThought Inc.
Sunday, February 27, 2011
BASIC RAKEFILE II
    desc 'Default build'
    task :default => ["build:all"]

    namespace :build do

         desc "Build the project"
         msbuild :all, :config do |msb, args|
           msb.properties :configuration => args[:config] || :Debug
           msb.targets :Build
           msb.solution = solution_file
         end

      desc "Rebuild the project"
      task :re => ["clean", "build:all"]
    end



Amir Barylko - CodeCamp 2011                                   MavenThought Inc.
Sunday, February 27, 2011
SETUP DEPENDENCIES




Amir Barylko - CodeCamp 2011                 MavenThought Inc.
Sunday, February 27, 2011
MANY OPTIONS

    • Store            dependencies in source control (not recommended)

    • Use          Nuget and then store them in SC

    • Use          openwrap

    • Use          gems + bundler




Amir Barylko - CodeCamp 2011                                     MavenThought Inc.
Sunday, February 27, 2011
BUNDLER

    • Define                 Gemfile with dependencies

    • Run “bundle                install”

    • Create                task to setup .NET dependencies under lib




Amir Barylko - CodeCamp 2011                                            MavenThought Inc.
Sunday, February 27, 2011
GEMFILE
    source :rubygems

    group         :setup do
      gem         'albacore'
      gem         'git'
      gem         'noodle'
    end

    group         :dev do
      gem         'sharptestsex'
      gem         'gallio', '~> 3.2'
      gem         'rhino.mocks', '~> 3.6'
      gem         'structuremap.automocking', '~> 2.6.1.1'
      gem         'maventhought.testing'
      gem         'maventhought.commons'
    end


Amir Barylko - CodeCamp 2011                                 MavenThought Inc.
Sunday, February 27, 2011
COPY LOCAL
                            DEPENDENCIES
    desc 'Setup requirements to build and deploy'
    task :setup => ["setup:dep:local"]

    namespace :setup do
      namespace :dep do
        Noodle::Rake::NoodleTask.new :local do |n|
          n.groups << :runtime
          n.groups << :dev
        end
      end
    end




Amir Barylko - CodeCamp 2011                         MavenThought Inc.
Sunday, February 27, 2011
TEST AUTOMATION




Amir Barylko - CodeCamp 2011                  MavenThought Inc.
Sunday, February 27, 2011
UNIT TESTS

    • Each           project has a separate testing project

    • Clear            naming convention (MavenThought.Core.Tests)

    • Enforce TDD             when possible

    • Automate              since day one (even with empty tests)




Amir Barylko - CodeCamp 2011                                        MavenThought Inc.
Sunday, February 27, 2011
RUN TESTS
    desc "Run all tests"
    task :test => ["test:all"]

    namespace :test do

         desc 'Run all tests'
         task :all => [:default] do
           tests = FileList["test/**/bin/debug/**/*.Tests.dll"].join " "
           system "./tools/gallio/bin/gallio.echo.exe #{tests}"
         end

    end



Amir Barylko - CodeCamp 2011                                   MavenThought Inc.
Sunday, February 27, 2011
CI SETUP




Amir Barylko - CodeCamp 2011              MavenThought Inc.
Sunday, February 27, 2011
BENEFITS OF CI

    • Integrate              code frequently

    • Trigger               events (deployment, etc)

    • Validate              build

    • Regression               tests (unit, integration, acceptance)




Amir Barylko - CodeCamp 2011                                           MavenThought Inc.
Sunday, February 27, 2011
MANY OPTIONS

          TeamCity
      •Team System Build server
      •Hudson
      •CruiseControl.NET



Amir Barylko - CodeCamp 2011               MavenThought Inc.
Sunday, February 27, 2011
TEAM CITY

    • Very           easy to use

    • Free           for 20 projects & 3 agents

    • Web             Based

    • Awesome               UI

    • Supports: Rake, MsBuild, Nant, etc....



Amir Barylko - CodeCamp 2011                      MavenThought Inc.
Sunday, February 27, 2011
PUSH CHANGES




Amir Barylko - CodeCamp 2011               MavenThought Inc.
Sunday, February 27, 2011
CLEAR PROCESS

    • Branch                per feature

    • Commit                 often

    • Merge                 changes from trunk often

    • Automate                 commit (to avoid mistakes)




Amir Barylko - CodeCamp 2011                                MavenThought Inc.
Sunday, February 27, 2011
GOING ALL THE WAY
                                   Static Analysis Tools
                                      Deployment
                               Acceptance Tests Automation




Amir Barylko - CodeCamp 2011                                 MavenThought Inc.
Sunday, February 27, 2011
TOOLS




Amir Barylko - CodeCamp 2011           MavenThought Inc.
Sunday, February 27, 2011
STATIC ANALYSIS

    • StyleCop

    • FxCop

    • Code              Coverage

    • Dependencies

    • Simian



Amir Barylko - CodeCamp 2011                   MavenThought Inc.
Sunday, February 27, 2011
STYLECOP
    namespace :tools do
        desc "Runs stylecop and generates a report on the Output folder"
        task :stylecop do
            mkdir "Output" unless File.directory? "Output"
            stylecop = "tools/stylecopcmd/StyleCopCmd"
            # Run the StyleCopCmd from tools
            sh "#{stylecop} -sf #{solution_file} -ifp AssemblyInfo.cs -of..."
            sh "tools/Xslt/msxsl.exe Output/stylecop.violations.xml ...."


            xmldoc = Document.new(File.new("Output/stylecop.violations.xml"))
            violations = XPath.first(xmldoc, "/StyleCopViolations/Violation")
            abort "Stylecop Failed!" unless violations.nil?
        end
    end


Amir Barylko - CodeCamp 2011                                                MavenThought Inc.
Sunday, February 27, 2011
DEPLOYMENT




Amir Barylko - CodeCamp 2011                MavenThought Inc.
Sunday, February 27, 2011
ASSEMBLY VERSION

    • Use          SVN revision

    • Combine                 Major.Minor.Build.Revision

    • Update AssemblyInfo.cs

    • Build           in release

    • Deploy                to a folder as a zipfile


Amir Barylko - CodeCamp 2011                               MavenThought Inc.
Sunday, February 27, 2011
ACCEPTANCE TESTS




Amir Barylko - CodeCamp 2011                   MavenThought Inc.
Sunday, February 27, 2011
RUNNING CUCUMBER

    • Start           the server

    • Setup             database

    • Run           the scenario

    • Stop           the server




Amir Barylko - CodeCamp 2011               MavenThought Inc.
Sunday, February 27, 2011
QUESTIONS?




Amir Barylko - CodeCamp 2011                MavenThought Inc.
Sunday, February 27, 2011
RESOURCES

    • Email: amir@barylko.com

    • Twitter: @abarylko

    • Presentation: http://www.orthocoders.com/presentations

    • Source                Code: https://github.com/amirci/democc_2011




Amir Barylko - CodeCamp 2011                                         MavenThought Inc.
Sunday, February 27, 2011
RESOURCES II

    •Ruby Installer: http://www.ruby-lang.org/en/downloads/
    •Rake: http://rake.rubyforge.org/
    •Albacore: https://github.com/derickbailey/Albacore
    •Noodle: https://github.com/spraints/noodle
    •MavenThought Testing: https://github.com/amirci/mt_testing
    • TeamCity: http://www.jetbrains.com/teamcity/download/
    • Capybara: https://github.com/jnicklas/capybara


Amir Barylko - CodeCamp 2011                               MavenThought Inc.
Sunday, February 27, 2011
RESOURCES III

    •MSBuild :http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx
    •NAnt :http://nant.sourceforge.net/
    •FinalBuilder: http://www.finalbuilder.com/
    •VisualBuild: http://www.kinook.com/VisBuildPro/
    •BooBS:http://code.google.com/p/boo-build-system/
    •Psake: https://github.com/JamesKovacs/psake
    •Powershell: http://bit.ly/ehQcTb
    •TFS: http://msdn.microsoft.com/en-us/vstudio/ff637362

Amir Barylko - CodeCamp 2011                               MavenThought Inc.
Sunday, February 27, 2011

More Related Content

What's hot

prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
Amir Barylko
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-driven
Amir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
Amir Barylko
 
Rise of the hybrids
Rise of the hybridsRise of the hybrids
Rise of the hybrids
Oron Ben Zvi
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 

What's hot (20)

prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-driven
 
decoupling-ea
decoupling-eadecoupling-ea
decoupling-ea
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planning
 
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
 
YEG-UG-Capybara
YEG-UG-CapybaraYEG-UG-Capybara
YEG-UG-Capybara
 
Android java fx-jme@jug-lugano
Android java fx-jme@jug-luganoAndroid java fx-jme@jug-lugano
Android java fx-jme@jug-lugano
 
Agile planning
Agile planningAgile planning
Agile planning
 
PRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakesPRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakes
 
obs-tdd-intro
obs-tdd-introobs-tdd-intro
obs-tdd-intro
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Rise of the hybrids
Rise of the hybridsRise of the hybrids
Rise of the hybrids
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
Diy arduino
Diy arduinoDiy arduino
Diy arduino
 
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregator
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 

Viewers also liked (7)

Google mock for dummies
Google mock for dummiesGoogle mock for dummies
Google mock for dummies
 
C++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect matchC++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect match
 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
 
C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing Framework
 
ソフトウェアテスト入門
ソフトウェアテスト入門ソフトウェアテスト入門
ソフトウェアテスト入門
 
ソフトウェア開発工程とテスト入門
ソフトウェア開発工程とテスト入門ソフトウェア開発工程とテスト入門
ソフトウェア開発工程とテスト入門
 
ドメイン駆動設計のためのオブジェクト指向入門
ドメイン駆動設計のためのオブジェクト指向入門ドメイン駆動設計のためのオブジェクト指向入門
ドメイン駆動設計のためのオブジェクト指向入門
 

Similar to every-day-automation

Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and Deployit
XebiaLabs
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
Charles Nutter
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Kalkey
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
Anton Arhipov
 
Using Jenkins with iOS projects
Using Jenkins with iOS projectsUsing Jenkins with iOS projects
Using Jenkins with iOS projects
AppsDojo
 
DevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
DevelopersSummit2011 【17-E-1】 DBも変化せよ - JiemamyDevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
DevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
都元ダイスケ Miyamoto
 

Similar to every-day-automation (20)

Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and Deployit
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Going literate in Amadeus JUC Berlin June 25th 2014
Going literate in Amadeus JUC Berlin June 25th 2014Going literate in Amadeus JUC Berlin June 25th 2014
Going literate in Amadeus JUC Berlin June 25th 2014
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Jenkins 1
Jenkins 1Jenkins 1
Jenkins 1
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 
AOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformAOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java Platform
 
Resume
ResumeResume
Resume
 
Using Jenkins with iOS projects
Using Jenkins with iOS projectsUsing Jenkins with iOS projects
Using Jenkins with iOS projects
 
CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page Apps
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan Paulovich
 
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011
 
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ BrnoJenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
 
DevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
DevelopersSummit2011 【17-E-1】 DBも変化せよ - JiemamyDevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
DevelopersSummit2011 【17-E-1】 DBも変化せよ - Jiemamy
 
MacRuby for Fun and Profit
MacRuby for Fun and ProfitMacRuby for Fun and Profit
MacRuby for Fun and Profit
 
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
Jumping from Continuous Integration to Continuous Delivery with Jenkins Enter...
 

More from Amir Barylko

Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
Amir Barylko
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; Coffeescript
Amir Barylko
 

More from Amir Barylko (20)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; Coffeescript
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

every-day-automation

  • 1. AMIR BARYLKO EASY AUTOMATION FOR EVERY DAY PROJECTS WINNIPEG CODE CAMP FEB 2011 Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 2. WHO AM I? • Quality Expert • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 3. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Blog: http://www.orthocoders.com • Materials: http://www.orthocoders.com/presentations Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 4. WHO NEEDS AUTOMATION? Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 5. EVERY DAY PROJECT SETUP • Repetitive task (project structure, scripts, etc) • Source control setup • Testing setup • Database setup • Deployment setup Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 6. MANUAL SETUP • Get the last project, copy, paste & delete • Use documentation and follow instructions (ha! good one!) • Use the IDE to build • Copy the assemblies, etc to where • Database connection centralized or hardcoded Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 7. WHAT’S WRONG? • Lengthy process (waste) • Very hard to maintain • Hard to reproduce • Complex for larger teams • Usually no documented • Hard to deploy • The architect just moved to • High dependency with the another country IDE • Coupled to the environment Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 8. WHAT TO DO? • Avoid It works on my • Scripts for every task! computer! • Continuous integration • Use application skeletons • TDD & BDD • End to end setup from day one! • Clear feature development process • Always in deliverable state Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 9. ONE STEP AT A TIME Project skeleton Build Automation Test Automation CI setup Push Changes (commit) Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 10. PROJECT SKELETON Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 11. FOLDER STRUCTURE • MediaLibrary --- MavenThought.MediaLibrary.sln : Main solution file --- Rakefile: Main rake file to launch build, test, etc. +-- main: Project files (sources) +-- test: Test project files +-- features: Features used by Capybara + Cucumber +-- lib2: Dependencies that can't be installed with bundler +-- tools: Tools used to run tests, xslt, etc. Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 12. BUILD AUTOMATION Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 13. BUILD TOOLS •Batch files • MSBuild (XML) • NAnt (better XML) • FinalBuilder (Visual) • VisualBuild (Visual) • Rake (Ruby) • BooBS (Boo Build System) • Psake(Powershell) Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 14. ARE YOU NUTS? RUBY? • The best tool for the job • What does it mean to be a developer? • Ruby is a great scripting language • Need something? There is a gem for that.... Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 15. RAKE • Domain Specific Language • Great, great, great .... grandchild of make • Is just Ruby • Lots of gems (libraries) available Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 16. ALBACORE • Basic functionality for .NET projects • OpenSource • Active Development • Very easy to use Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 17. BASIC RAKEFILE require 'rubygems' require 'albacore' require 'rake/clean' include FileUtils solution_file = FileList["*.sln"].first project_name = "MavenThought.MovieLibrary" CLEAN.include("main/**/bin", "main/**/obj", "test/**/obj", "test/**/bin") CLOBBER.include("**/_*", "lib/*", "**/*.user", "**/*.cache", "**/*.suo") Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 18. BASIC RAKEFILE II desc 'Default build' task :default => ["build:all"] namespace :build do desc "Build the project" msbuild :all, :config do |msb, args| msb.properties :configuration => args[:config] || :Debug msb.targets :Build msb.solution = solution_file end desc "Rebuild the project" task :re => ["clean", "build:all"] end Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 19. SETUP DEPENDENCIES Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 20. MANY OPTIONS • Store dependencies in source control (not recommended) • Use Nuget and then store them in SC • Use openwrap • Use gems + bundler Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 21. BUNDLER • Define Gemfile with dependencies • Run “bundle install” • Create task to setup .NET dependencies under lib Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 22. GEMFILE source :rubygems group :setup do gem 'albacore' gem 'git' gem 'noodle' end group :dev do gem 'sharptestsex' gem 'gallio', '~> 3.2' gem 'rhino.mocks', '~> 3.6' gem 'structuremap.automocking', '~> 2.6.1.1' gem 'maventhought.testing' gem 'maventhought.commons' end Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 23. COPY LOCAL DEPENDENCIES desc 'Setup requirements to build and deploy' task :setup => ["setup:dep:local"] namespace :setup do namespace :dep do Noodle::Rake::NoodleTask.new :local do |n| n.groups << :runtime n.groups << :dev end end end Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 24. TEST AUTOMATION Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 25. UNIT TESTS • Each project has a separate testing project • Clear naming convention (MavenThought.Core.Tests) • Enforce TDD when possible • Automate since day one (even with empty tests) Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 26. RUN TESTS desc "Run all tests" task :test => ["test:all"] namespace :test do desc 'Run all tests' task :all => [:default] do tests = FileList["test/**/bin/debug/**/*.Tests.dll"].join " " system "./tools/gallio/bin/gallio.echo.exe #{tests}" end end Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 27. CI SETUP Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 28. BENEFITS OF CI • Integrate code frequently • Trigger events (deployment, etc) • Validate build • Regression tests (unit, integration, acceptance) Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 29. MANY OPTIONS TeamCity •Team System Build server •Hudson •CruiseControl.NET Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 30. TEAM CITY • Very easy to use • Free for 20 projects & 3 agents • Web Based • Awesome UI • Supports: Rake, MsBuild, Nant, etc.... Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 31. PUSH CHANGES Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 32. CLEAR PROCESS • Branch per feature • Commit often • Merge changes from trunk often • Automate commit (to avoid mistakes) Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 33. GOING ALL THE WAY Static Analysis Tools Deployment Acceptance Tests Automation Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 34. TOOLS Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 35. STATIC ANALYSIS • StyleCop • FxCop • Code Coverage • Dependencies • Simian Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 36. STYLECOP namespace :tools do desc "Runs stylecop and generates a report on the Output folder" task :stylecop do mkdir "Output" unless File.directory? "Output" stylecop = "tools/stylecopcmd/StyleCopCmd" # Run the StyleCopCmd from tools sh "#{stylecop} -sf #{solution_file} -ifp AssemblyInfo.cs -of..." sh "tools/Xslt/msxsl.exe Output/stylecop.violations.xml ...." xmldoc = Document.new(File.new("Output/stylecop.violations.xml")) violations = XPath.first(xmldoc, "/StyleCopViolations/Violation") abort "Stylecop Failed!" unless violations.nil? end end Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 37. DEPLOYMENT Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 38. ASSEMBLY VERSION • Use SVN revision • Combine Major.Minor.Build.Revision • Update AssemblyInfo.cs • Build in release • Deploy to a folder as a zipfile Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 39. ACCEPTANCE TESTS Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 40. RUNNING CUCUMBER • Start the server • Setup database • Run the scenario • Stop the server Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 41. QUESTIONS? Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 42. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Presentation: http://www.orthocoders.com/presentations • Source Code: https://github.com/amirci/democc_2011 Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 43. RESOURCES II •Ruby Installer: http://www.ruby-lang.org/en/downloads/ •Rake: http://rake.rubyforge.org/ •Albacore: https://github.com/derickbailey/Albacore •Noodle: https://github.com/spraints/noodle •MavenThought Testing: https://github.com/amirci/mt_testing • TeamCity: http://www.jetbrains.com/teamcity/download/ • Capybara: https://github.com/jnicklas/capybara Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011
  • 44. RESOURCES III •MSBuild :http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx •NAnt :http://nant.sourceforge.net/ •FinalBuilder: http://www.finalbuilder.com/ •VisualBuild: http://www.kinook.com/VisBuildPro/ •BooBS:http://code.google.com/p/boo-build-system/ •Psake: https://github.com/JamesKovacs/psake •Powershell: http://bit.ly/ehQcTb •TFS: http://msdn.microsoft.com/en-us/vstudio/ff637362 Amir Barylko - CodeCamp 2011 MavenThought Inc. Sunday, February 27, 2011