Понравилась презентация – покажи это...
Rewrite/Refactorwith Agility in Today’s Tech Trends[building an agile Innovation-Debt resilience] Ananya Sen Sr. Software Engineer, Intuit October 10, 2014 #GHC14 2014
This code is so unmanageable! Could use that new framework here … Rewriting will take too long! Let’s just refactor this sprint. Need to move to the cloud soon! Release train is moving quickly Renu, Product Owner
In today’s tech trends, rewriting to tackle Innovation Debt, can be a necessary option, and can be done faster and/or incrementally, in many cases. Hypothesis
About me Coding with Web technologies for the last 10 years Enjoy coding with HTML5, Java, AngularJS, REST APIs MS in Software Engineering from SJSU Sr. Software Engineer at Intuit since 2012 Previously worked at Motorola Mobility and Snapfish. I’ve been through a few rewrites/refactor myself: UI rewrite from jQuery spaghetti ? responsive AngularJS app RESTful Web APIs ? JAX-RS REST APIs with RestEasy Struts-based MVC app ? UI widgets and REST APIs HTML5 Chrome App, refactored to introduce better design pattern
Concepts we’ll talk about Innovation debt Stale software w.r.t. technology Technical debt Incremental internal changes Agile Methodology to deliver incremental customer value
Why refresh code? Users expect more ~24% of total website traffic came from mobile devices in 2013, up 78% from 2012. Personal cloud traffic: 1.7 exabytes in 2012 to 20 exabytes in 2017. Innovation debt The “Law of Accelerating Returns” states thattechnological change is exponential. Cost: Lack of user delight, talent attrition, hard to recruit Technical debt Take a 5-person team … Slowed down by 4 hours per person-week bytechnical debt … At $50 per hour per developer … The total cost is $52,000 per year. Revenue declines while features grow
Some tech trends to chase Cloud-ready High availability Mobile-ready Responsive Web [HTML5] Native apps Social presence Social media marketing Integration with social feeds Big data
Some tech trends that can help Open source frameworks & boilerplates Better IDEs like WebStorm, Eclipse, Netbeans, etc. Online training & massive open online courses Developer conferences everywhere!
Patterns to change code Refactor“Disciplined technique for restructuring an existing body of code, without changing its external behavior.” – Martin Fowler Works well with a modular design and high test coverage 2. RewriteNecessary to fix: High innovation debt Monolithic design Elements of Technical Debt
Patterns to change code 3. Continuous incremental rewrites Works well with a modular design
Here are some rewrite success stories at Intuit
Overview of examples Reasons for the rewrites: High cost of operation Slow customer onboarding Platform changes (e.g., iOS changes) Cope with competition Unmanageable codebase Stale technological stack
Cloud Console UIrewrite with AngularJS Why do it? Inherited unmanageable code, stale framework, had to unit test, insufficient documentation Result jQuery spaghetti ? AngularJS, Bootstrap, Jasmine unit tests with Karma test runner, Grunt build system, Bower package management >50 bugs ? 0 bugs Old website fully transitioned to responsive website in 2 months Cost Rewrite in 1 month, 2 sprints, 2 developers, for user testing. Rolled out to 100% customers in 2 months. 1
Tech trends’ influence Open source NG-Boilerplate, AngularJS, Bootstrap, AngularJS directives Online professional training like pluralsight.com Cloud Console UIrewrite : Architectural change
AngularJS quick start recipe Learnt AngularJS at pluralsight.com Ng-boilerplate to quickly setup in < 15 min, with: AngularJS with modular structure Responsive with Bootstrap Font Awesome Karma + Jasmine Unit test automation on multiple browsers Build system with Grunt Add more Open source AngularJS directives with Bower: Ex: bower install angular-ui-utils –save
Cloud Console REST APIincremental rewrite for tech refresh Internal product for cloud operations self-service Why do it? Stale framework, inadequate documentation Tech trends’ influence Open source frameworks like RESTEasy, Spring, Swagger, jMock Result Resty Web APIs ? JAX-RS REST APIs,with RESTEasy & Spring beans Swagger docs Better unit tests with Jmock Cost 2 weeks, 1 sprint, 1 developer 2
…… <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/pcapi/v1/*</url-pattern> </servlet-mapping> ….. <servlet-mapping> <servlet-name>PublicCloudApi</servlet-name> <url-pattern>/publiccloudapi/v1/*</url-pattern> </servlet-mapping> ….. Hybrid configurations in web.xml for the incremental rewrite
Community-sourced support network for Intuit products Why do it? High operational cost; old codebase very hard to manage Tech trends’ influence Cloud for runtime cost optimization during tax season Open source: Ruby gem Cancan for authorization, Bootstrap for UI. Result Moved to AWS with a responsive UI, to significantly reduce cost and provide a better user experience. 0 bugs; 93% fewer lines of code; features retained as per usage data. Cost Took 1 month with 2 developers to build a proof-of-concept; and 6 months, for the full rewrite. Intuit Live Communityrewrite for cost optimization 4
Intuit’s QuickBooks Online iPhone/iPad apprewrite due to iOS changes Intuit’s accounting software for small business Why do it? iOS 7 had Apple's new UI design – a major change from iOS 6. Result Native Intuit apps for iOS 7 featured in the Apple App Store as amust-have business app. Native apps made ready for future changes with MVC design practices, limiting customizations, and staying in line with iOS platform best practices. Cost: 10 weeks with 14 engineers Tech trends’ influence Staying current by attending Apple's World Wide Developer Conference, taking pre-release OS versions, etc. Avoiding skinning the app by using native UI components Stick to the native IDE Xcode, tools, and Objective-C language. Professional training at "Big Nerd Ranch” 5
Conclusion Users today expect more. Innovation debt and technical debt are expensive. Rewrites can be faster and incremental, in the current technical ecosystem. And finally, this has to be part of the company strategy. At Intuit, development time is dedicated to reducing debt … 20% for technical debt 10% for innovation debt
Parting thought @ananya1sen email@example.com www.linkedin.com/in/ananya1sen/ Rewrites are getting less intimidating and so I can chase today’s tech trends!
References for data points outside Intuit Workflows of Refactoring http://martinfowler.com/articles/workflowsOfRefactoring/, by Martin Fowler Innovation Debthttps://www.linkedin.com/pulse/article/20140723123249-68300748-innovation-debt?trk=mp-details-rr-rmpost http://www.computer.org/portal/web/membership/Top-10-Tech-Trends-in-2014 http://www.marketingprofs.com/charts/2013/11010/web-traffic-from-mobile-devices-up-78-year-over-year http://www.kurzweilai.net/the-law-of-accelerating-returns http://www.imediaconnection.com/content/36343.asp http://www.danube.com/system/files/CollabNet_WP_Technical_Debt_041910.pdf http://www.brandonsavage.net/the-true-business-cost-of-technical-debt/ http://antonymarcano.com/blog/2011/06/sharks-debts-critical-mass/ http://www.innovationmanagement.se/2012/10/18/how-to-survive-your-innovation-project/ http://www.economist.com/news/business/21584307-new-book-points-out-big-role-governments-play-creating-innovative-businesses http://www.computerworld.com/article/2497495/private-cloud/here--there--everywhere--3-personal-cloud-storage-systems.html