love your architecture ii - sei digital library...love your architecture ii author paulo merson,...
TRANSCRIPT
![Page 1: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/1.jpg)
Love your architecture II SATURN 2017Paulo Merson
Denver Art Museum. Photo by Danielle Webster
![Page 2: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/2.jpg)
A not so uncommon story…
![Page 3: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/3.jpg)
A software architecture was carefully defined based on• architecture and design patterns• experience with similar design problems• discussions with several stakeholders
![Page 4: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/4.jpg)
The architecture was incrementally refined and implementedSprint after sprint, code became the main artifact
![Page 5: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/5.jpg)
Development and maintenance• spanned several years• involved tens of people
![Page 6: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/6.jpg)
The end of the story…
![Page 7: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/7.jpg)
Actual architecture != intended architecture
![Page 8: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/8.jpg)
![Page 9: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/9.jpg)
![Page 10: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/10.jpg)
Lack of architecture conformance• makes the code hard to understand and change, mainly
because of undesired dependencies• may affect portability, performance, interoperability,
security and other qualities
![Page 11: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/11.jpg)
How to avoid code and architecture disparity?
![Page 12: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/12.jpg)
1) Communicate the architecture to developers• Not the focus of this presentation
![Page 13: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/13.jpg)
2) Automate architecture conformance analysis• Often done with static analysis tools
![Page 14: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/14.jpg)
Two limitations of static analysis tools, as commonly used…
![Page 15: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/15.jpg)
1) Many people just enable built-in checks, which• are oblivious to your architecture design constraints
2) Developers can ignore reported violations• There’s no time to “clean the house”• There may be no accountability for
adding violations
![Page 16: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/16.jpg)
How did we overcome limitation 1?
![Page 17: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/17.jpg)
We created custom checks
![Page 18: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/18.jpg)
How did we overcome limitation 2?
![Page 19: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/19.jpg)
Upon code commit a pre-commit hook• runs custom checks on each source file
If a custom check detects a violation• the commit operation is denied• developer sees a descriptive error message • architecture team is notified of the failed commit• developer gets email with further explanation
![Page 20: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/20.jpg)
Custom checks at TCUBrazilian Federal Court of Accounts (tcu.gov.br)
![Page 21: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/21.jpg)
We’ve created 51 custom checks• 27 checks for architecture conformance• 14 checks for coding guidelines• 10 checks for application security
![Page 22: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/22.jpg)
Architecture conformance checks enforce for example• the layered architecture• placement of data access logic• mandated generalizations• naming of software elements• design standards in
reference architectures
![Page 23: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/23.jpg)
Some lessons learned…
![Page 24: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/24.jpg)
Add to pre-commit hooks only the checks• with zero violations in the target codebase• that enforce mandatory rules
![Page 25: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/25.jpg)
But add all checks to sonarqube analysisAnd run analysis in your continuous integration
![Page 26: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/26.jpg)
Adopt an architecturally-evident coding style
An architecturally-evidentcoding style encourages you to embed hints in the source code that makes the architecture evident to a developer who reads the code
![Page 27: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/27.jpg)
Let developers know about the custom checks and suggest changes and improvementsLet architects understand the potential of the custom checks
![Page 28: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/28.jpg)
For more informationEmail: [email protected], P. Ultimate architecture enforcement: custom checks enforced at code-commit time. SPLASH Wavefront 2013. Merson, P., Yoder, J., Guerra, E. Continuous Inspection: A Pattern for Keeping your Code Healthy and Aligned to the Architecture. Asian PLoP 2014.
![Page 29: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/29.jpg)
The single best thing you can do for the long term health, quality and maintainability of a non-trivial software system is to
carefully manage and control the dependencies between its different elements and components by defining and enforcing an
architectural blueprint over its lifetime—Alexander Zitzewitz
Loving your architecture == defining and enforcing it
![Page 30: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/30.jpg)
Backup slides
![Page 31: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/31.jpg)
Some results…
![Page 32: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/32.jpg)
750+ commit attempts denied in the first 24 months Enhacements to the checkstyle and PMD APIs submitted to these open source projects~12,000 violations fixed in the codebase
The real value was• increased code quality • improved awareness of the architecture and coding guidelines
![Page 33: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/33.jpg)
More lessons learned…
![Page 34: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/34.jpg)
Be careful not to become the “architecture police” Be the “architecture mentors”
![Page 35: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/35.jpg)
Create a mechanism to easily trump a check in exceptional cases
![Page 36: Love Your Architecture II - SEI Digital Library...Love Your Architecture II Author Paulo Merson, Brazilian Federal Court of Accounts (TCU) Subject Architecture requires attention throughout](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07f7e97e708231d41faa98/html5/thumbnails/36.jpg)
Automate the email with further clarification about a denied commit attempt