large scale agile development practices

46
EXPERIENCE REPORT: LARGE SCALE AGILE DEVELOPMENT PRACTICES Daphne Chong (@daphnechong) Niall Connaughton (@nconnaughton)

Upload: skills-matter

Post on 13-May-2015

1.154 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Large scale agile development practices

EXPERIENCE REPORT: LARGE SCALE AGILE DEVELOPMENT PRACTICES

Daphne Chong (@daphnechong) Niall Connaughton (@nconnaughton)

Page 2: Large scale agile development practices

What was the project?

C# Winforms SQL Server database Large CRUD system App deployed to client sites

Started in 2001 Market leading product

Page 3: Large scale agile development practices

What was the project?

Low volume Performance important, but not critical Goal was a stable, consistent, feature-rich app Rapid release cycle (after any successful build)

Page 4: Large scale agile development practices

In 2006…

60 Developers 5 million lines of code (including tests) ~100 solutions, 250 projects 300+ db tables 160,000 automated tests

Page 5: Large scale agile development practices

Today…

60 Developers ~10 million lines of code 485 solutions 470 db tables 343,090 automated tests

Page 6: Large scale agile development practices

The Pit of Success

We want our customers to simply fall into winning practices by using our platform and frameworks

– Rico Mariani

Build platforms [where] developers just fall into doing the “right thing”... Types should be defined with a clear contact that communicates effectively how they are to be used (and how not to)

– Brad Abrams

Page 7: Large scale agile development practices

Pit of Success – Technical Factors

Inheritance Template Method pattern Strict naming conventions Common reusable controls Own type system Single generic repository – handled common

scenarios in CRUD, transactions, referential integrity, caching, persistence

Page 8: Large scale agile development practices

Pit of Success

Tried to avoid too much divergence in code Made it difficult for people to stray from the “true

path”

Page 9: Large scale agile development practices

Typical Application Layers

Page 10: Large scale agile development practices

Typical Application Layers

Page 11: Large scale agile development practices

Finding the value

Page 12: Large scale agile development practices

Consistency

70 % of a dev’s time is understanding existing code – Peter Hallam [2]

If you can reduce that even by a small amount, it’s significant productivity gain

Page 13: Large scale agile development practices

Consistency

Consistent approach to everything Naming conventions – project, solutions, file locations,

namespaces, class names, methods, database tables and columns

Formatting UI look and feel (achieved through base controls) Patterns of design

Page 14: Large scale agile development practices

Consistency

Standardised on a core set of technologies that best fit the application

Avoided “technology soup” support and maintenance

Reduced learning curve for new developers

Page 15: Large scale agile development practices

Insane things we did

60 devs, no feature branches! SourceSafe Highly sensitive to the build breaking True continuous integration Mitigated by clients opting in to “alpha”, “beta” or

“stable” versions Two large re-writes of architecture

Result was more suited to our needs than if we had kept the first and refactored it progressively

Page 16: Large scale agile development practices

How did we build?

Full build from batch file Update source files Solutions built in dependency order defined in xml All binaries output to one folder Build on dev machine = 20-25 minutes Build server with RAID = 4 minutes

Quick build tool (written in c#) Only build solutions that have changes

Page 17: Large scale agile development practices

Development - Architecture

Built our own architecture Re-usable controls Comprehensive base classes Own type system

Primitive types as well as Custom types Could define helper

methods .IsEmpty, .SubstringSafe() , IsInRange()

Page 18: Large scale agile development practices

Development - Architecture

Architecture constantly extended Approach was always unified though the

architecture Enabled good ideas to have widespread effect

Page 19: Large scale agile development practices

Development – Technical debt

Management support for improving bad code Aggressive attitude to technical debt Very little dead code

Example: methods with 7 overloads that can’t be deleted because don’t know who’s consuming them

Page 20: Large scale agile development practices

Development – Technical debt

Constant small amount of pain Rare occurrences of large amounts of pain Once a hard cost has been paid, make sure that

nobody ever has to pay the cost again

Page 21: Large scale agile development practices

Development - Custom Tools

Automated repetitive and error prone tasks Custom ORM generator Database upgrading tool GUI binding helpers to ensure targets exist Build monitor system tray application Code Generators for new modules Automated deployment tool

Page 22: Large scale agile development practices

Testing

Two types of tests Business Tests: user functionality Meta Tests: code design and contracts

Page 23: Large scale agile development practices

Testing

Most of our tests were actually integration tests of varying scope

Didn’t use a mocking framework (not yet well known)

Created our own stubs by inheriting from the concrete class and overriding any methods that used resources, etc.

Page 24: Large scale agile development practices

Business Tests

Generally state based logic Easy to read and write Fairly resilient throughout refactoring Derived from a base TestCase with ~25 basic tests

Array properties don’t return null Properties don’t throw NullReferenceExceptions Don’t alter the state of the object before shown in GUI

Page 25: Large scale agile development practices

Business Tests - Example

Page 26: Large scale agile development practices

Meta Tests

Don’t test direct functionality Enforced consistency, patterns and code contracts Implemented using reflection and attributes Slow to run, but very valuable

Page 27: Large scale agile development practices

Meta Tests – Examples

Check code conforms to conventions and contracts Public constructor with a specific parameter exists Assemblies are strong named Check for memory leaks

Check that each model had an associated test

[TestsSubclassesOf(typeof(BusinessBase))]public abstract class BusinessBaseTest{

// contract tests here}

Page 28: Large scale agile development practices

Meta Tests

The Meta Tests help to enforce the rules, rather than having a “bad cop” in your team Not political or personal Once established, it gave power to the rest of the

team to contribute new tests and rules

Page 29: Large scale agile development practices

Meta Tests

Allowed the architecture to grow rapidly Already know the code conforms to a particular

standard

Page 30: Large scale agile development practices

How do you run 343,000 tests?

Initial approach similar to CruiseControl One machine building and running all tests Results emailed after completion

… stalled once we hit 25,000 tests … Took 4 hrs to run Feedback cycle wasn’t fast enough

Page 31: Large scale agile development practices

Growth of Tests

Page 32: Large scale agile development practices

Distributed Testing Framework

Highly customised Tests distributed to up to 60 agents Build time around 1 hour

if built on single agent = 30-40 hours Package on successful build Agents ran on idle developer machines Ran 24/7

Page 33: Large scale agile development practices

Distributed Testing Framework

Page 34: Large scale agile development practices

Distributed Testing Framework

Developer submitted builds could be processed (i.e. pre-checkin)

Task tray to signal progress Red light = broken tests, broken build or checkin

embargo Green light = OK to check in

Page 35: Large scale agile development practices

Team

Very Flat structure 6-8 devs in architecture team (“Blue Code”)

Business & GUI architecture Development tools Testing framework Database development Upgrading code

Most other developers building business rules into software (“Red Code”)

Page 36: Large scale agile development practices

Architecture vs Business teams

Page 37: Large scale agile development practices

Team - Architecture

Made up less than 20% of team Improved productivity by much more than 20% Allowed devs to focus on smaller slice of stack and

get quicker feedback cycles

Page 38: Large scale agile development practices

Team - Business

Low barrier to entry for development Junior or new developers could be productive very

quickly Varied skill sets in the team were utilitsed

accordingly Technically minded people drawn to architecture Business minded people focused on implementing

customer requirements

Page 39: Large scale agile development practices

Team – Sharing Information

Free flowing collaboration Some development overhead in helping other

people Some information silo-ing

Page 40: Large scale agile development practices

Team – Pair Programming

Initially strict pairing Became “organic”

Not enforced Never discouraged

Page 41: Large scale agile development practices

Team – Work Ethic

People took a lot of responsibility and accountability of their own accord

Boy scout rule – leave things cleaner than when you found it

Always fix broken windows

Page 42: Large scale agile development practices

Work satisfaction

Low turnover rates for first 4 years Lots of smart people to work with More meritocracy than political Developers took pride in their work Ability to implement large scale change open to

everyone

Page 43: Large scale agile development practices

Work Satisfaction – flip side

Hard to have interesting work for 60 developers Could be pigeon-holed into the business layer More stress than an average agile environment Long work hours implied because there’s only one

build – responsibility to keep the dev machine going. No leaving the build broken or failing tests throughout lunch or overnight.

Page 44: Large scale agile development practices

Conclusion

Team made a lot of investment in design and conformity

Easy to do with a CRUD system, harder with other types of business software

Project has expanded and moved on, but the architecture has evolved with it and is still in use

Page 45: Large scale agile development practices

Thanks to…

Zubin AppooSenior Manager, Product Development

www.cargowise.com

Page 46: Large scale agile development practices

References

[1] Brad Abrams, The Pit of Success http://blogs.msdn.com/b/brada/archive/2003/10/02/50420.aspx

[2] Peter Hallam, What do Programmers Really do Anyway? http://blogs.msdn.com/b/peterhal/archive/2006/01/04/509302.aspx