Patterns for Evolving Agile Architecture
Total Page:16
File Type:pdf, Size:1020Kb
5/3/2017 Deliver FAST “with confidence” Joseph W. Yoder Twitter: @metayoda [email protected] The Refactory http://www.refactory.com Teams That Innovate http://www.teamsthatinnovate.com Copyright 2017 Joseph Yoder & The Refactory, Inc. Introducing Joseph Founder and Architect, The Refactory, Inc. Pattern enthusiast, author and Hillside Board President Author of the Big Ball of Mud Pattern Adaptive Systems expert (programs adaptive software, consults on adaptive architectures, author of adaptive architecture patterns, metatdata maven, website: adaptiveobjectmodel.com) Agile enthusiast and practitioner Business owner (leads a world class development company) Consults and trains top companies on design, refactoring, pragmatic testing Amateur photographer, motorcycle enthusiast, enjoys dancing samba!!! Loves Sushi, Ramen, Taiko Drums 1 5/3/2017 Confidence 2 5/3/2017 Kano Model architecture quality can be invisible www.kanomodel.com 3 5/3/2017 architecture quality can be invisible …especially when the spotlight is on FEATURES 4 5/3/2017 Mobile New Products Version EBiz Features © Can Stock Photo Inc. / alex5248 The Solution © Can Stock Photo Inc. / Freezingpicture 5 5/3/2017 What’s below the waterline? Reliability all those “ilities” Scalability we can’t ignore … Performance Stability Maintainability © Can Stock Photo Inc. / SergeyNivens Chris Richardson 12 6 5/3/2017 Agile Myths Simple solutions are always best We can easily adapt to changing requirements (new requirements) Scrum/TDD will ensure good Design/Architecture Good architecture simply emerges from “good” development practice You always go fast when doing agile Make significant architecture changes at the last moment “www.agilemyths.com” Sustaining Your Architecture Big Ball of Mud Alias: Shantytown, Spaghetti Code A BIG BALL OF MUD is haphazardly structured, sprawling, sloppy, duct-tape and bailing wire, spaghetti code jungle. The de-facto standard software architecture. Why is the gap between what we preach and what we practice so large? We preach we want to build high quality systems but why are BBoMs so prevalent? Sustaining Your Architecture 7 5/3/2017 Big Ball of Mud Alias: Shantytown, Spaghetti Code A BIG BALL OF MUD is haphazardly Lisa Pollack structured, sprawling, sloppy, duct-tape and bailing wire, spaghetti code jungle. Brazilian architect Oscar Niemeyer The de-facto standard software architecture. Why is the gap between what we preach and what we practice so large? We preach we want to build high quality systems but why are BBoMs so prevalent? Sustaining Your Architecture Complex vs Complicated Systems (Cynefin Framework) "Cynefin as of 1st June 2014" by Snowded - Own work. Licensed under CC BY-SA 3.0 via Commons - https://commons.wikimedia.org/wiki/File:Cynefin_as_of_1st_June_2014.png#/media/File:Cynefin_as_of_1st_June_2014.png 8 5/3/2017 How can I be more confident Linda Masters Northrop © Can Stock Photo / Values Drive Practices 9 5/3/2017 Agile/Lean Design Values Core values: Design Simplicity Quick Feedback Frequent Releases Continuous Improvement Teamwork/Trust Satisfying stakeholder needs Building Quality Software Keep Learning Sustainable Development 10 5/3/2017 Delivery Size??? Delivery Size is Key Large Delivery Size can cause many issues Issues: More potential defects Longer time to get feedback Slower adjust time Harder to experiment Bugs take a long time to fix 11 5/3/2017 Small Deliveries Quick Feedback Chris Richardson 12 5/3/2017 What about Quality? Code Bad Smells Have you ever looked at a piece of software that doesn't smell very nice? A code smell is any symptom in the source code that can indicate a problem! 13 5/3/2017 Neglect Is Contagious .Disorder increases and software rots over time .Don’t tolerate a broken window http://www.pragmaticprogrammer.com/ppbook/extracts/no_broken_windows.html Is it better to Or to let dirt clean little by and mess little? accumulate? 14 5/3/2017 Some dirt becomes very hard to clean if you do not clean it right away! Technical Debt? Clean Code Doesn't Just Happen •You have to craft it •You have to maintain it •You have to make a professional commitment “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler 15 5/3/2017 Refactoring “If you value clean code…” Refactorings Behavior Preserving Program Transformations • Rename Instance Variable • Promote Method to Superclass • Move Method to Component Always done for a reason!!! Refactoring is key and integral TDD to most Agile processes!!! Sustaining Your Architecture 16 5/3/2017 Two Refactoring Types* Floss Refactorings—frequent, small changes, intermingled with other programming (daily health) Root canal refactorings—infrequent, protracted refactoring, during which programmers do nothing else (major repair) * Emerson Murphy-Hill and Andrew Black in “Refactoring Tools: Fitness for Purpose” http://web.cecs.pdx.edu/~black/publications/IEEESoftwareRefact.pdf Ten Most Putrid List 0) Magic Numbers, 1) Sloppy Layout, 2) Dead Code, 3) Lame Names, 4) Commented Code, 5) Duplicated Code, 6) Feature Envy, 7) Inappropriate Intimacy, 8) Long Methods & Large Class, 9) Primitive Obsession & Long Parameter List, 10) Switch Statement & Conditional Complexity … 17 5/3/2017 Safe Refactorings Rename is always safe!!! New Abstract Class moving common features up Extract Method (always safe) Extract Interface / Extract Constant Pull Up / Push Down Create common component for shared internal methods Fairly safe but can be harder to share Sustaining Your Architecture You Must Test When you find smelly code, you often apply refactorings to clean your code. Testing is a key principle for safe refactoring! Sustaining Your Architecture 18 5/3/2017 Common Wisdom Work refactoring into your daily routine… “In almost all cases, I’m opposed to setting aside time for refactoring. In my view refactoring is not an activity you set aside time to do. Refactoring is something you do all the time in little bursts.” — Martin Fowler Sustaining Your Architecture But We Don’t Have Time! 19 5/3/2017 PAUSE POINTS HELP Professional Responsibility There’s no time to wash hands, get to the next patient! http://en.wikipedia.org/wiki/Image:I_Semmelweis.jpg 20 5/3/2017 Professionalism Make it your responsibility to create software: Delivers business value Is clean Is tested Is simple Good design principles When working with existing code: If you break it, you fix it You never make it worse than it was You always make it better Quality Focused Checklists • Release Checklists* – Agreed upon checklist for quality and major architecture concerns • Use at pause points – sprint planning, release planning, … *Thanks, James Thorpe for sharing your company’s checklist 21 5/3/2017 Two Kinds of Checklists 1.Read-review 2.Do-confirm Checklists at MozaicWorks* *Thanks, Alex Balboaca for sharing 22 5/3/2017 Slack Time Key Principle: Need Slack time to improve Ways to get slack time… Monitor and Make Visible Reduce Waste (Muda) Inject time into process (retros, daily cleanup, …) Try little experiments… Kaizen The Sino-Japanese word "kaizen" simply means "change for better", with no inherent meaning of either "continuous" or "philosophy" in Japanese dictionaries or in everyday use. The word refers to any improvement, one-time or continuous, large or small, in the same sense as the English word "improvement". (Wikipedia) Most view it as Continuous Improvement… 23 5/3/2017 Continuous Improvement “Retrospectives are Key!!!” Small Steps we can take - next sprint!!! Spotify: Innovation 24 5/3/2017 Regular Practices Allocate time for dealing with tech debt Team building and education sessions Evaluate and Reflect…small changes HOW SYSTEM QUALITY WORK CAN FIT INTO YOUR RHYTHMS 25 5/3/2017 Build architectural quality into your project rhythms “QUALITY IS NOT AN ACT, IT IS A HABIT.” —ARISTOTLE Some decisions are too important to leave until The Last Responsible Moment SO CHOOSE THE MOST RESPONSIBLE MOMENT 26 5/3/2017 Qualify the Roadmap “All you need is the plan, the roadmap, and the courage to press on to your destination” — Earl Nightingale LOW HIGH TBD RISK RISK NORMAL Qualify the Roadmap 2017 2018 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar MOBILE WEB v1 MOBILE WEB v2 RICH MOBILE WEB APPS PC PLATFORM v1 PC PLATFORM v2 ONGOING RELEASES DEVELOPMENT MOBILE RESEARCH ANDROID v1 IOS v1 RESPONSIVE DESIGN PERSISTENCE FRAMEWORK MOBILE GENERIC SERVICES SYBASE TO ORACLE MIGRATION LOAD BALANCING MOBILE SECURITY PLATFORM STABILITY CLOUD RESEARCH MICROSERVICES NO SQL / BIG DATA v1 NO SQL / BIG DATA v2 ENTEPRISE ARCHITECTURE DELIVERY BUDGET RESOURCE ARCHITECTURE DEPENDENCIES RISKS ISSUES ON RADAR Delays Budget will All resources Persistence Partnerships expected to need on track. Framework and services COMPETITOR DELIVERY AUG 2017 Version 1 bolstering in Load- all in place E Corp – new Tech issues New mobile Q2 2017 Balancing. and on track. product. opportunity Cloud ARCHITECTURE ARCHITECTURE OCT 2017 DASHBOARD Performance Migration Re-evaluate Platform stability Security NO SQL strategy 27 5/3/2017 Qualify the Backlog You can add backlog items for technical debt and quality-related architecture work… yes, you can Make Architecture Work Visible and Explicit Visible Invisible Positive Value Invisible Architectural Visible Feature Feature Negative Value Visible Defect Technical Debt Color your backlog—Phillipe Kruchten http://philippe.kruchten.com/2013/12/11/the-missing-value-of-software-architecture/ 28 5/3/2017 Question: