high-octane dev teams: three things you can do to improve code quality
DESCRIPTION
Bugs suck. But we know they are inevitable. Finding bugs fast and dealing with them early results in higher quality code. This session explores the practical approaches to improving code quality with automated testing, continuous integration and effective code review.Atlassian Speaker: Brendan HumphreysCustomer Speaker: Rik Tamm-Daniels of AttivioKey Takeaways: * Overviews of key concepts and how to get started * Walk-throughs and configuration tips for Clover, Bamboo and Crucible * Stories from the trenchesTRANSCRIPT
High OctaneDev Teams
Brendan Humphreys
High Octane? Concepts / History Four rules of code review Rik Tamm-Daniels, Attivio, Inc.
High Octane?
Machines vs Humans
Smarter Tools
• Checkstyle, Lint, PMD
• Findbugs
• Clover
Continuous Feedback
Feedback and Audience
1998
2007
Adoption in Atlassian
#1:Strive for Ego-Free Reviews
#1: Ego-Free Reviews
#1: Ego-Free Reviews
• No personal Pronouns
#1: Ego-Free Reviews
• No personal Pronouns
• No point scoring
#1: Ego-Free Reviews
• No personal Pronouns
• No point scoring
• Moderator to police
#2:Don’t be a Pedant
#2: Don’t be a Pedant
#2: Don’t be a Pedant
• Use tools to enforce coding style, catch common errors
#2: Don’t be a Pedant
• Use tools to enforce coding style, catch common errors
• Look for the forrest, not the trees
#3: Find Problems,
Not Solutions
#3: Find Problems, Not Solutions
#3: Find Problems, Not Solutions
• Except for trivial fixes
#3: Find Problems, Not Solutions
• Except for trivial fixes
• Pair program instead
#4: Embrace Feedback
•Especially if you are a junior developer
•You will learn to love it!
#4: Embrace Feedback
Agile Quality: High-Octane Style
Rik Tamm-Daniels VP, Engineering June 1st, 2009
©2007Confiden,al&Proprietary.AllRightsReserved.
• Located in Newton, MA • Founded August 2007 • 45+ Employees • What we do: Unified Information Access
About Attivio
©2007Confiden,al&Proprietary.AllRightsReserved.
• Attivioʼs Active Intelligence Engine – Unified Information Access Platform – Query Unstructured and Structured Information with the
Precision of SQL and the Fuzziness of Search • Shipped Product (OEM and Direct)
– Maintenance Release Window at the end of each sprint – Minor Release every 3-4 months – Major Releases Every 12-18 months
• Product Specs: – 100% Java – 200 MB Install – 200K Lines of Code (8000+ automated tests)
What are we building?
©2007Confiden,al&Proprietary.AllRightsReserved.
• Our Team – 15 Engineers (10 very senior) – Expertise in
Enterprise Search, Data Warehousing, ETL, Linguistics, Data Mining
• Our Process – Agile Development
• 4 week Sprints: 3 weeks of design/code/document/test and 1 week of “Reflection”
– Agile QA
What makes Attivio High-Octane?
©2007Confiden,al&Proprietary.AllRightsReserved.
• Atlassian Tools installed on Day 1 – Bamboo – JIRA – Confluence – Fisheye – Clover – First Bamboo build was Green!
Attivio and Atlassian: How it all began
©2007Confiden,al&Proprietary.AllRightsReserved.
• Evolutionary Process – Sprint-by-sprint incremental process changes
• Reliance on Tools – Process Tools: JIRA, Confluence, Clover, Bamboo,
Fisheye – Dev Tools: SVN, Ant, Eclipse, JMeter
• Comprehensive Quality Strategy
Our Process
©2007Confiden,al&Proprietary.AllRightsReserved.
• Maintaining “Releaseability” of code – Ensure unit tests are built concurrently with code – Have a “light” Release Process – Getting green builds
• Where does QA fit in? – Options
• QA “follows” development by one sprint • Use a traditional QA waterfall model step • Our Model: a QA sprint before each release
• What do QA Engineers do? – Our model: Expert team for critical testing hotspots, critical
performance tests, higher-level system testing
Agile Quality Challenges
©2007Confiden,al&Proprietary.AllRightsReserved.
• We focus on three metrics of Code Quality: – How much code is tested and how often? – How quickly can we detect defects? – How quickly can we resolve defects?
• We address these with: – Continuous Integration – Code Coverage – Unified Testing
Agile + Quality
©2007Confiden,al&Proprietary.AllRightsReserved.
• We use Bamboo for Continuous Integration, Nightly Builds and System Test Builds – Continuous Builds run on each check-in – Nightly Builds of each Branch are scheduled and
staggered – System Test Builds depend upon Nightly Builds
• All Bamboo Agents run on VMWare Virtual Machines
Continuous Integration - Build Process
©2007Confiden,al&Proprietary.AllRightsReserved.
Linuxx64VM
DefaultAgent
Linuxx64VM
Con,nuousTrunkBuild
FullNightlyBuild
Linuxx64VM
OldVersionCon,nuous
Linuxx64VM
QAInstall/SystemTests
Linuxx86VM
FullNightlyBuild
Windowsx86VM
CodeCheck
FullNightlyBuild
Windowsx64VM
FullNightlyBuild
Solarisx64VM
FullNightlyBuild
Build Agent Configuration BuildAgent
BuildType
©2007Confiden,al&Proprietary.AllRightsReserved.
Branching Methodology
Source:Collabnet
©2007Confiden,al&Proprietary.AllRightsReserved.
• We use the Unstable Branching Strategy – Fits with the agile methodology better that the Agile
Branching strategy • No need to deal with too many branches • Since our modules are already self contained we are
continually integrating all modules right in trunk • Less merging more branching • Ready to release code at any time without merging or
branching – In large part because of our test coverage – Having system, integration, smoke and performance testing as
part of our daily activity
Branching Methodology
©2007Confiden,al&Proprietary.AllRightsReserved.
• High Coverage numbers have produced low-defect releases
• We ship with better than 80% coverage for ALL Releases
• 80% based on industry best practices • Clover produces reports for our core and add-on
modules • Integration Points: GUnit (grails), Selenium/
JUnit, Fluint (Flex)
Code Coverage
©2007Confiden,al&Proprietary.AllRightsReserved.
• Run separately from other builds to reduce build times
• Produces Code Coverage Artifacts – Clover – Cobertura – Findbugs
• We donʼt use Bambooʼs integrated Clover Report because it doesnʼt ft our build directory structure (each module built separately)
Code Coverage Build
©2007Confiden,al&Proprietary.AllRightsReserved.
Code Coverage Build Artifacts
©2007Confiden,al&Proprietary.AllRightsReserved.
• Unified Testing Defined: – Common Infrastructure (Execution, Reporting)
• Execution: Bamboo • Reporting: Clover/Bamboo
– Single point of defect detection and investigation • Bamboo + JIRA and Fisheye Integration
• Benefits – Fewer systems for QA to learn – Easier to maintain than traditional QA environments – Consistent format for defect reporting and notification – Unified view of system quality – Easier to identify testing gaps
Unified Testing
©2007Confiden,al&Proprietary.AllRightsReserved.
• JUnit - unit and integration tests • Custom ant-based install automation framework
and system test framework – Generic Ant Build Model
• Heavy use of MacroDefs and AntCalls • Custom Ant Tasks
– Mimics JUnit response and output format – Can be run on build box or run on multiple build boxes
(multi-node tests, performance tests)
Unified Testing – How we do it
©2007Confiden,al&Proprietary.AllRightsReserved.
• The combination of Bamboo and Clover give us a complete view of product quality – High-level build status – Test Failure Reports – Build Logs – Build Artifacts (Clover, Findbugs)
• JIRA and Fisheye integration allows us to quickly identify and resolve problems – JIRA tickets – Check-in Diffs
Unified Testing - Reporting
©2007Confiden,al&Proprietary.AllRightsReserved.
Unified Testing Demo
©2007Confiden,al&Proprietary.AllRightsReserved.
• Being a High-Octane Dev Team requires focus on Quality
• A High-Octane Agile Quality Program Needs: – Continuous Integration for Early Defect Detection and
Resolution – A High-level of Code Coverage – Unified Test Execution for Simplicity – Unified Test Reporting for Visibility – Tooling to Tie it all Together
Conclusions
©2007Confiden,al&Proprietary.AllRightsReserved.
Discussion Time!