Automated Builds and Testing

26
Automated Builds and Testing Wm. Barrett Simms FrontRunnerMD [email protected] 781.405.4686 Twitter : @wbsimms

description

Automated Builds and Testing. Wm. Barrett Simms FrontRunnerMD [email protected] 781.405.4686 Twitter : @ wbsimms. Systems Administrator Linux – Solaris Perl Java .NET/C# Agile Project Manager I love what I do for work. Whoami – Past to Present. How I build software - PowerPoint PPT Presentation

Transcript of Automated Builds and Testing

Page 1: Automated Builds and Testing

Automated Builds and Testing

Wm. Barrett [email protected] : @wbsimms

Page 2: Automated Builds and Testing

Whoami – Past to Present Systems Administrator

Linux – Solaris Perl Java .NET/C# Agile Project Manager

I love what I do for work.

Page 3: Automated Builds and Testing

What you’ll learn How I build software How this helps teams Techniques Tools Show a fairly complete approach

Page 4: Automated Builds and Testing

WHY?

Page 5: Automated Builds and Testing

Automated Build/Test Benefits

Process PersonalMerging ConfidenceOnboarding employees Improved skillsTesting/QA Collective OwnershipCollaboration Communication

Page 6: Automated Builds and Testing

Problems?

Page 7: Automated Builds and Testing

Multiple Developers

Main

Joe

Sue

Ted

Jan

Page 8: Automated Builds and Testing

Dependent Projects

Common

Middle LayerBusiness Logic

Code Smell:Shotgun Surgery!!

Page 9: Automated Builds and Testing

Database Changes

Jan

Bob

Main

Page 10: Automated Builds and Testing

Branching and Merging

Mai

n Lin

eBranch 1

Branch 2

???

Page 11: Automated Builds and Testing

Mainline merge process

Build/Test Dev branch

Build/Test

Mainline

Merge Dev

branch to

Mainline

Build/Test

Mainline

Check code into

Mainline

Page 12: Automated Builds and Testing

Buildservers

Developer merges to mainline

Buildserver gets changes

Buildserver builds, runs all tests and notifies team

Test results are published to team and viewable by all.

Page 13: Automated Builds and Testing

Automated testing

Unit tests=

Quality Software

Page 14: Automated Builds and Testing

Typical bug velocity

Se-ries1

0500

1000150020002500

Bug Count

Page 15: Automated Builds and Testing

Negative bug velocity

Se-ries1

0500

1000150020002500

Bug Count

Page 16: Automated Builds and Testing

Common resistance I can’t write unit tests because…

I have a UI WaitN, QTP, Selenium

Fixing someone else’s poorly written code Refactoring, training

I use a database The tricky part.

Page 17: Automated Builds and Testing

Databases – The tricky part Common Questions

How do I write unit tests when I require a database

How do I merge changes? How do I add default/test data? How do I update…

Buildserver Production site(s)

Page 18: Automated Builds and Testing

A decent answer

Use SQL scripts! Table View Procedures Key and Constraints Default Data Test Data

Page 19: Automated Builds and Testing

My one slide solution

Automated Build Server TFS

Auto Generate Database DumpDatabase/CreateDatabase

Automated Testing MSTest

Page 20: Automated Builds and Testing

Generating the scripts DumpDatabaseToSql.exe

Microsoft.SqlServer.Management.Smo

Page 21: Automated Builds and Testing

Generating the scripts (2)

Page 22: Automated Builds and Testing

Database Files All schema files in

revision control.

Page 23: Automated Builds and Testing

Creating the database

Page 24: Automated Builds and Testing

Another trick: Entity Framework

EdmGen2 http://archive.msdn.microsoft.com/EdmGen2

Page 25: Automated Builds and Testing

Unit testing with the database Boy Scout Rule

Leave the campground cleaner than you found it.

At least… leave it as you found it.

Page 26: Automated Builds and Testing

Finally… sort of… Wrap it all up in a build script.

MSBuild, NAnt….

I’m using MSBuild… But prefer NAnt.