Rewrite/Refactorwith Agility in Today’s Tech Trends[building an agile Innovation-Debt resilience]

The Presentation inside:

Slide 0

Rewrite/Refactor with Agility in Today’s Tech Trends [building an agile Innovation-Debt resilience] Ananya Sen Sr. Software Engineer, Intuit October 10, 2014 #GHC14 2014

Slide 1

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

Slide 2

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

Slide 3

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

Slide 4

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

Slide 5

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 that technological 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 by technical debt … At $50 per hour per developer … The total cost is $52,000 per year. Revenue declines while features grow

Slide 6

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

Slide 7

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!

Slide 8

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. Rewrite Necessary to fix: High innovation debt Monolithic design Elements of Technical Debt

Slide 9

Patterns to change code 3. Continuous incremental rewrites Works well with a modular design

Slide 10

Here are some rewrite success stories at Intuit

Slide 11

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

Slide 12

Cloud Console UI rewrite 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

Slide 13

Tech trends’ influence Open source NG-Boilerplate, AngularJS, Bootstrap, AngularJS directives Online professional training like Cloud Console UI rewrite : Architectural change

Slide 14

AngularJS quick start recipe Learnt AngularJS at 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

Slide 15

Cloud Console REST API incremental 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

Slide 16

…… <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

Slide 17

Intuit Identity Manager incremental rewrite for faster onboarding Login management for all Intuit products Why do it? Reduce integration time with products from weeks to days Tech trends’ influence Moved to REST, as a future cloud strategy path Responsive UI design SOAP engineers learned REST from online professional training for a quick V1 Result SOAP to REST APIs in ~2 month UI rewrote as widgets and JavaScript SDK Cost Customer benefit in ~2 months; net changes in 1 year Rewrite release v1 Rewrite release v2 3

Slide 18

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 Community rewrite for cost optimization 4

Slide 19

Intuit’s QuickBooks Online iPhone/iPad app rewrite 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 a must-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

Slide 20

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

Slide 21

Parting thought @ananya1sen [email protected] Rewrites are getting less intimidating and so I can chase today’s tech trends!

Slide 22

References for data points outside Intuit Workflows of Refactoring, by Martin Fowler Innovation Debt