2. 2018 Spryker Systems GmbH
Who am I
Denis Turkov
- Lead Architect at Spryker on 2019
- Manage 3 different architecture teams
- Application Architecture
- Solution Architecture
- Technical Leadership
- E-commerce specialist in areas of B2C, B2B and
Enterprise Marketplaces
- Fall in love with high quality software
Twitter: PhilinTv
4. 2018 Spryker Systems GmbH
Development at Spryker
- up to 15 releases a day
- 368.245 lines (Tomas Votruba) on autumn 2017 (with 1.20% duplications)
- 620.838 lines on April 2018 (with 0.98% duplications)
- 1.097.818 lines on September 2019 (with ~0.92% duplications)
- doubled the number of modules last year
- up to 60 engineers changing code simultaneously
- Scrutinizer rate went from 9.5x to 9.8
5. 2018 Spryker Systems GmbH
High Code Quality
5
It is not enough for code to work
Robert C. Martin (uncle Bob)
12. 2018 Spryker Systems GmbH
Where are business benefits?
− Shorten feature to market cycle
− Shorten dev onboarding
− Knowledge sharing
− Long life time
− Cheaper maintenance
− Vendor income channel
20. 2018 Spryker Systems GmbH
Measure code quality
You don’t care about the quality,
when you are bootstrapping or riding a turtle
21. 2018 Spryker Systems GmbH
Measure code quality
In a long run, a codebase w/o quality KPIs is like driving a car w/o a dashboard.
22. 2018 Spryker Systems GmbH
Measure code quality
What you can measure
● Cyclomatic complexity
● Code duplication
● Bugs per line of code
● Test coverage
● Cohesion
● Coupling
● Instruction path length
● ...
23. 2018 Spryker Systems GmbH
Measure code quality - Aggregators
● Codebeat
● Scrutinizer
● Codacy
● Code climate
● Travis/CircleCI/Any other CI
with your custom checks
28. 2018 Spryker Systems GmbH
Upgrade to a professional
- Onboarding plan
- Collecting Requirements
- Training sessions
- Code reviews
- RFCs instead of opinions
29. 2018 Spryker Systems GmbH
Upgrade to a professional: Training
- Peer review
- Peer programming
- Workshops
- Hackathons
- Presentations & Webinars
30. 2018 Spryker Systems GmbH
Upgrade to a professional: CR
- Unified standards
- Code deep dive (no github screening)
- Review seniors’ code
- Peer review
- Multiple reviewers
31. 2018 Spryker Systems GmbH
Upgrade to a professional: RFC
- define an issue and a status quo
- suggest a solution with a text, diagrams, a code example
- vote for a solution with consensus
- update conventions, code-style guide and documentation
33. 2018 Spryker Systems GmbH
Code entropy
1. A computer program that is used will be modified
2. When a program is modified, its complexity will increase
Lehman, M. M.; Belady, L.A. (1985), Program evolution: processes of software change
34. 2018 Spryker Systems GmbH
Code entropy
Broken windows theory:
Think twice when you break the first window
35. 2018 Spryker Systems GmbH
Code entropy
Some other causes of entropy:
− no internal agreement
− difficult access to agreements/missing track on agreements updates
− poor code transparency
− indirect DRY violation
− ...
36. 2018 Spryker Systems GmbH
Code entropy
Always leave the campground cleaner
than you found it
The Boy Scout Rule
45. 2018 Spryker Systems GmbH
Tooling
− architecture sniffers
− based on phpmd (https://github.com/spryker/architecture-sniffer)
− based on phpstan
− code sniffer
− based on phpcs/phpcbf
− git-hooks
− release automation
− CI/CD
− tech-debt gateway
46. 2018 Spryker Systems GmbH
- Define rules
- Measure quality
- Grow professionals
- Don’t do twice - use tooling
Takeaways