sigis jermolovicius chasing code quality in huge multi location team project
TRANSCRIPT
![Page 1: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/1.jpg)
October 15, 2012 www.ExigenServices.com
CHASING CODE QUALITY IN HUGE MULTI-
LOCATION TEAM PROJECT
![Page 2: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/2.jpg)
2 www.ExigenServices.com
GLOBAL EXIGEN SERVICES
Europe
Eastern Europe
US
RigaR&D Center
VilniusR&D Center
Asia-PacificWuxiR&D Center
SuzhouR&D Center
London
Frankfurt
New YorkSan FranciscoHeadquarters
San Paulo
Christchurch
Johannesburg
KazanR&D Center
Nizhniy NovgorodR&D Center
St. PetersburgR&D Center
MinskR&D Center
OdessaR&D Center Dnepropetrovsk
R&D Center• Founded in 2000
• 1’500 professionals
• Revenue approx. $70M
Adelaide
![Page 3: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/3.jpg)
3 www.ExigenServices.com
EXIGEN SUITE COMPONENTS
3rd Party Interface
BillingInterface
ClaimsInterface
Commission Interface
Self-Service Portal Interface
Reinsurance Interface
Analytics Interface
3rd Party Mgmt
Accounts & CRM
CorrespondenceManagement
Sub-LedgerReporting &Compliance
Tasks & Decisions
Document Generation
Configuration & Scheduling
SecurityProcess & Task Mgmt
Business Activity
Monitoring
Content Management
Business Rules
CommonServices
Data & Sys Integration
Operations Management
New Business
Policy Servicing
Claims Financials
Claim Processing
BusinessProcesses&Core Functions
NewBusiness
Rating
Policy Servicing
Adjudicaton & Settlement
Claim Financials
FNOL
Claim Processing
ProductManagement
Under-Writing
POLICYCORE CLAIMCORE
Payment Processes
Payment Management
Invoice &Collection
Bill Plan Management
BILLINGCORE
PRODUCT FACTORY
Distribution Management Sales and Customer Service DISTRIBUTIONCORE
![Page 4: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/4.jpg)
4 www.ExigenServices.com
WHEN YOU START FAILING
Agile works says:
One location, team, scrum master and product owner
Everybody are universal and senior;
But in sometimes we have
Multi location, teams, scrum masters and PO’s
And mixed level;
And here problems arise.
![Page 5: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/5.jpg)
5 www.ExigenServices.com
THIS PRESENTATION TOPIC
Stable Continuous Integration
Effective Code review
Useful Static code quality
![Page 6: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/6.jpg)
6 www.ExigenServices.com
TECHNOLOGIES WE SELECTED
Source control (DSVC) - hg (Mercurial) mercurial.selenic.com
Build tool - Jenkins jenkins-ci.org
Review tool - Reviewboard reviewboard.org
Static code quality - Sonar sonarsource.org
![Page 7: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/7.jpg)
7 www.ExigenServices.com
STABLE CONTINUOUS INTEGRATION
![Page 8: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/8.jpg)
8 www.ExigenServices.com
CI FOR ONE TEAM
![Page 9: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/9.jpg)
9 www.ExigenServices.com
CI WITH MULTIPLE TEAMS
![Page 10: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/10.jpg)
10 www.ExigenServices.com
WHAT TO DO?
Options
Fight with continuous integration failures every day
Fail fast. Setup your continuous integration to no accept failing
code.
![Page 11: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/11.jpg)
11 www.ExigenServices.com
FAILING FAST
“Failing fast” for development means getting response about your
code quickly, from:
compiler
deployment
unit and integration test
UI tests
static quality parameters
And all those answers should be given before code gets to source
control.
![Page 12: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/12.jpg)
12 www.ExigenServices.com
MULTIPLE TEAMS – MULTIPLE
CONTINUOUS ENVIRONMENTS
![Page 13: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/13.jpg)
13 www.ExigenServices.com
TEAM BRANCH
![Page 14: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/14.jpg)
14 www.ExigenServices.com
BENEFITS
Team continuous integration environment is effected only by team
changes.
Only finished and tested features will get to central. Gatekeeper
would be responsible to merge.
![Page 15: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/15.jpg)
15 www.ExigenServices.com
STILL TO BE IMPROVED
There is still possibility that gatekeeper will push bad code
We don’t reach our ultimate goal - STABILITY of central.
![Page 16: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/16.jpg)
16 www.ExigenServices.com
ONE STEP FURTHER - TEAM-MERGE
To achieve our goal we created CI job that doesn't allow bad code.
It does automatic code merge, compile, test and push.
– rights write to central are revoked for anyone and only "special"
"team-merge" user can do merge.
– only possible way to commit code from team-branch to central
is through "team-merge" script.
![Page 17: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/17.jpg)
17 www.ExigenServices.com
HOW IT WORKS
![Page 18: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/18.jpg)
18 www.ExigenServices.com
HOW TO START IT
![Page 19: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/19.jpg)
19 www.ExigenServices.com
FINAL TIPS
Your environment should be stable enough to do this approach.
Better have small number of working test rather than huge number
of failing test.
Each team has own CI plans – hardware is required
![Page 20: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/20.jpg)
20 www.ExigenServices.com
EFFECTIVE CODE REVIEW
![Page 21: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/21.jpg)
21 www.ExigenServices.com
CODE REVIEW OR NOT CODE REVIEW
Code review, if:
– You plan long life cycle for your product
– Your customer insist on high quality and you have maintenance
contract.
Don’t code review, if:
– Your product has short life cycle (demos, POC, etc.)
– You don’t care about maintenance after it’s done
![Page 22: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/22.jpg)
22 www.ExigenServices.com
CODE REVIEW
There are various proposals on code review –
Pair Programming
Review about do less than 100%, with rules, like
Review only Selected commits.
Review only commits from juniors
Random reviews
Review 100% of code
We chose 100% review.
![Page 23: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/23.jpg)
23 www.ExigenServices.com
CODE REVIEW AFTER COMMIT
Guarantee that reviewed code is committed
No special actions required if reviewed code passes
Issues:
In case code doesn’t pass you have bad code in repository until it’s
fixed.
Bad code effects others
![Page 24: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/24.jpg)
24 www.ExigenServices.com
CODE REVIEW BEFORE COMMIT
Review patches or review branch.
Bad code doesn’t effect others.
Issues:
You have no guarantee that good code reviewed will get to
repository. As somebody needs to merge it.
What we needed is:
Automated merge on code review pass.
![Page 25: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/25.jpg)
25 www.ExigenServices.com
100% CODE REVIEW
What we want is
1. Work as a team.
2. Review all code changes
3. Do not effect others
Therefore we need code review systems what would assure 100%
review.
Other requirements:
DVCS-backed review system
Acts as a front end for to central DVCS-repo
When review is complete auto merge with default branch
![Page 26: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/26.jpg)
26 www.ExigenServices.com
CODE REVIEW TOOLS
For git users there is good tool called gerrit
http://code.google.com/p/gerrit/
If you use mercurial (hg), it’s bit more complicated – as where is
no analogue for gerrit for hg.
Our approach was to use reviewboard.org and mercurial enhanced
with python scripts what are mimicking gerrit approach.
To initiate review you should call “hg postreview”
![Page 27: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/27.jpg)
27 www.ExigenServices.com
REVIEWBOARD
![Page 28: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/28.jpg)
28 www.ExigenServices.com
REVIEW CYCLE
![Page 29: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/29.jpg)
29 www.ExigenServices.com
USEFUL STATIC CODE CONTROL
![Page 30: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/30.jpg)
30 www.ExigenServices.com
CONTROL CODE QUALITY
We want to control basic parameters of code quality
Static code violation
Code unit and integration test coverage
Other code parameters
We can do it effectively with tool called Sonar
![Page 31: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/31.jpg)
31 www.ExigenServices.com
METRICS
What you want to measure?
– Test Coverage?
– Static code violations?
– Code metrics?
Answer to this is SONAR
Automates metrics and creates reports.
Allows to analyze code to the code line details.
sonarsource.org
![Page 32: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/32.jpg)
32 www.ExigenServices.com
SONAR PROJECT VIEW
![Page 33: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/33.jpg)
33 www.ExigenServices.com
CODE COVERAGE
![Page 34: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/34.jpg)
34 www.ExigenServices.com
CODE DRILLDOWN
![Page 35: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/35.jpg)
35 www.ExigenServices.com
CODE VIOLATIONS
![Page 36: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/36.jpg)
36 www.ExigenServices.com
VIOLATION DRILLDOWN
![Page 37: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/37.jpg)
37 www.ExigenServices.com
WHAT’S NEXT WITH SONAR
Good is that we have tool to control
Bad is that what people are still people and tend to do crappy
code.
number of violations is increasing.
still repeating same errors.
code is unmaintainable
![Page 38: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/38.jpg)
38 www.ExigenServices.com
OUR APPROACH
Decide that violations are critical for you and what you can live
with.
What we do:
Using multistage commit we don’t accept code with blocker
violations.
Commit is declined and developer should rework their code
before next commit.
Use personal violations view to work with particular developers
coding style.
![Page 39: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/39.jpg)
39 www.ExigenServices.com
PERSONAL VIOLATIONS DRILLDOWN
![Page 40: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/40.jpg)
40 www.ExigenServices.com
PREVENT VIOLATIONS
![Page 41: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/41.jpg)
41 www.ExigenServices.com
TIPS
Declare violations as critical first.
Allow teams to fix them.
Increase severity to blocker after all existing are fixed
Decline new violations of same type
![Page 42: Sigis jermolovicius chasing code quality in huge multi location team project](https://reader034.vdocuments.us/reader034/viewer/2022052622/5596d9d51a28ab325e8b45d6/html5/thumbnails/42.jpg)
42 www.ExigenServices.com
QUESTIONS?