Chasing code quality in huge multi-location team project
-
Upload
agile-lietuva -
Category
Documents
-
view
1.318 -
download
1
description
Transcript of Chasing code quality in huge multi-location team project
April 9, 2023 www.ExigenServices.com
CHASING CODE QUALITY IN HUGE MULTI-LOCATION TEAM PROJECT
2 www.ExigenServices.com
GLOBAL EXIGEN SERVICES
EuropeEastern 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
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
CorrespondenceManagementSub-LedgerReporting &
Compliance Tasks &
Decisions
Document Generation
Configuration & Scheduling Security Process &
Task MgmtBusiness Activity
MonitoringContent
ManagementBusiness
Rules
CommonServices
Data & Sys Integration
Operations Management
New Business
Policy Servicing
Claims Financials
Claim Processing
BusinessProcesses&Core Functions
New Business
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
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.
5 www.ExigenServices.com
THIS PRESENTATION TOPIC
Stable Continuous Integration
Effective Code review
Useful Static code quality
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
7 www.ExigenServices.com
STABLE CONTINUOUS INTEGRATION
8 www.ExigenServices.com
CI FOR ONE TEAM
9 www.ExigenServices.com
CI WITH MULTIPLE TEAMS
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.
11 www.ExigenServices.com
FAILING FAST
“Failing fast” for development means getting response about your code quickly, from: compilerdeploymentunit and integration testUI testsstatic quality parameters
And all those answers should be given before code gets to source control.
12 www.ExigenServices.com
MULTIPLE TEAMS – MULTIPLE CONTINUOUS ENVIRONMENTS
13 www.ExigenServices.com
TEAM BRANCH
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.
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.
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.
17 www.ExigenServices.com
HOW IT WORKS
18 www.ExigenServices.com
HOW TO START IT
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
20 www.ExigenServices.com
EFFECTIVE CODE REVIEW
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
22 www.ExigenServices.com
CODE REVIEW
There are various proposals on code review – Pair Programming
Review about do less than 100%, with rules, likeReview only Selected commits.Review only commits from juniorsRandom reviews
Review 100% of code
We chose 100% review.
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
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.
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
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”
27 www.ExigenServices.com
REVIEWBOARD
28 www.ExigenServices.com
REVIEW CYCLE
29 www.ExigenServices.com
USEFUL STATIC CODE CONTROL
30 www.ExigenServices.com
CONTROL CODE QUALITY
We want to control basic parameters of code qualityStatic code violationCode unit and integration test coverageOther code parameters
We can do it effectively with tool called Sonar
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
32 www.ExigenServices.com
SONAR PROJECT VIEW
33 www.ExigenServices.com
CODE COVERAGE
34 www.ExigenServices.com
CODE DRILLDOWN
35 www.ExigenServices.com
CODE VIOLATIONS
36 www.ExigenServices.com
VIOLATION DRILLDOWN
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
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.
39 www.ExigenServices.com
PERSONAL VIOLATIONS DRILLDOWN
40 www.ExigenServices.com
PREVENT VIOLATIONS
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
42 www.ExigenServices.com
QUESTIONS?