Presentation is loading. Please wait.

Presentation is loading. Please wait.

Improving Software Quality with Continuous Integration

Similar presentations

Presentation on theme: "Improving Software Quality with Continuous Integration"— Presentation transcript:

1 Improving Software Quality with Continuous Integration
Chris Farrell Quick Solutions

2 Questions Anytime Ask questions whenever you want

3 What is CI? NOT a software program you install
NOT something you buy or pay for NOT a new idea NOT specific to .Net or Java Is a set of process best practices applied during development to Reduce defects by doing QA during development Improve productivity by automating manual tasks Facilitate collaboration and teamwork

4 Who Created Continuous Integration


6 Why Do CI? Source:

7 Problems solved with CI
Integration Hell Difficult, Stressful deployments Human Error in Deployments Late feedback from QA

8 Benefits of CI Reduced Cost Improved Quality Stable velocity
Easy, more accurate/consistent deployments Can demo at any time Can deploy at any time Improved Transparency Improved QA

9 #1 – Single Source Repository
Everyone works from the same codebase *during* development Repository contains *all* needed files including SQL Scripts, Reports, Code, Dependencies, etc Tools: VSS, CVS, SVN, GIT, TFS,etc Client with multiple copies of the code!!!!! Have code but can’t find dependencies(or right versions) Not putting reports or db scripts in VCS

10 #2 Automate the Build Make it so that anyone can build with a single command Build could involve multiple projects and dependencies Multiple project build Automated Build should be able to build pieces AND the whole

11 Build Triggers Manual Build Build on Check-In Scheduled Build
CI server detects check-ins and triggers build Scheduled Build Nightly Builds

12 #3 Make the Build Self Testing
Does the latest version compile? Quality Metrics – Performance, Test Coverage Automated Tests FX Cop Style Guidelines UI/Functional Tests Integration Tests Unit Tests

13 #3 Tooling Build Tools Unit Testing Functional Testing UI Testing
MS Build, Nant, Rake, Maven Unit Testing Resharper, Nunit, MS Test, Gallio/MBUnit, etc Functional Testing SpecFlow, Cuke4Nuke UI Testing Microsoft Test Manager, WATIN, Selenium

14 #4 – Everyone Commits to the mainline every day
“Mainline” does not mean prod Typically you commit multiple times per day Commit at least at end of day in case someone is sick, a hard drive dies, workload shifts, etc Anyone can get the latest code at any time Provides support for versioning

15 #5 – Every Commit Should Build on an Integration Machine
Ensures that all code to build the project has been checked in to source control Doesn’t need to be a high end PC. Can be a VM or an obsolete dev machine

16 #6 – Keep the Build Fast The entire point of CI is to provide fast and frequent feedback If the build is broken, you want to find out before someone else checks out broken code Short feedback cycles For slow builds..prestage when needed

17 #7 – Test in a Clone of the Production Environment
Should be a close as possible. Every difference is a risk that what works in QA will not work in Production Might involve testing on multiple targets Should have similar Database size Quality of Test Data Network Security Configuration Server and Client Software

18 Database Deploy to Production Backup Database from Prod
Copy Database to CI Server Restore DB each build Apply Migrations

19 #8 – Make it Easy for Anyone to Get the Latest Executable
Business Analyst should be able to do Show & Tell at any time QA should be able to test at any time QA can trigger builds Sales should be able to see current version

20 #9 – Everyone can see what is happening
CI is about feedback and transparency CI should provide visibility towards Is the Build broken Who checked in code, when, for what feature Code Quality Metrics Automated Test Results Code Coverage Performance Metrics

21 #10 Automate Deployment When you have to deploy at 5pm on Friday or 6am on Monday So your QA testers can test without asking you if the latest version is out

22 #10 – Automate Deployment
CRITICAL Deployment is a deliverable that needs to be tested before deploying to production Speed of Deployment Labor Cost of Deployment Accuracy of manual deployments non-tech users must be able to deploy to test target multiple environments for testing Greatly reduces deployment stress

23 #10 – Automate Deployment
Automate *all* of deployment Backup of Production Database updates Data Migrations Code Deployment Report Deployment Practice makes perfect!!!

24 Other Uses/Benefits Can use CI to automate almost anything
Data Migration Jobs Backup local or remote data/files Send Reports Reset environments Sync environments(ex move AD from Prod to Dev)

25 Selling CI Issue – Time/Cost to Setup
Issue – No access for automated deploy due to politics/firewall Issue – Sensitive data Issue – Limited access to dev environment Time/Cost -use old pc -use free software -start small, improve incrementally -measure cost of defect and ROI from decreased defects Permissions -restrict prod move permissions to approved persons -deliver a zip file that can be x-copied -multiple CI environments. -compare risks/benefits – error prone, expensive deployments with less QA vs restricted build without qa and higher defects Sensitive Data -have scripts to scrub and obfuscate data Limited access to dev(ex, only the dba can update DB or only network admins can change AD even in dev) -make it their problem -promote visibility -find compromises. Make them a part of the solution instead of a part of the problem -share credit -escalate!

26 Free VCS
200 mb free SVN & GIT Free for public repositories/OSS Free private GIT repos(?2gb limit?) free TFS for OSS 2gb GIT, Mercurial, SVN

27 Popular CI Servers Hudson (Free) Jenkins (Free)
Jenkins (Free) TeamCity (sort of free) Free up to 20 build configurations/3 agents CruiseControl.Net (free) Team Foundation Server Included with MSDN Pro and higher

28 Build Automation Tools
MS Build C:\ Nant (port of Ant) Rake(Ruby Make)

29 Other Tooling SSRS Report Deployment DB Comparision FluentMigrator
DB Comparision Visual Studio 2010 Database Projects RedGate SQL Compare($395) FluentMigrator

30 TFS Demo Work Item Tracking Source Control Project Mgmt Charts
CI Build Unit Tests Integration Tests Automated Deployment

31 Jenkins Demo

32 QSI is Hiring

33 Chris Farrell Website: Twitter: @chrispfarrell

Download ppt "Improving Software Quality with Continuous Integration"

Similar presentations

Ads by Google