legacy: a retrospective - open west 2016

Post on 19-Jan-2017

138 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

LegacyA Retrospective

@jessicamauerhan | #OpenWest| https://joind.in/talk/091b9

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

@jessicamauerhan

2

Senior Test Engineer

Grovo Learning, Inc

jessicamauerhan@gmail.com

jmauerhan.wordpress.com

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

What is a Retrospectiv

e?

★ What worked well?★ What didn't work

well?★ What would we do

differently next time?

3

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

★ Content Production★ Learning

Management System

★ E-Commerce★ Business to Business

(B2B)

Project Summary

4

LMS + E-Commerce

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Problematic History😠 Broken Admin Panel😠 No Documentation of Basic Processes😠 Frontend Site Worked, Progress Stalled😠 Complex Logic not Documented

5

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Business Goals★ Add Missing Admin Panel Functionality★ Add New Features Without Breaking Existing

Features★ Avoid Downtime

6

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Technical Goals★ Maintainable Code★ Quality Code★ Documentation★ Rapid Development★ Easy Deployment★ Zero Regressions Per Release

7

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Disclaimer!

8

Maintaining and Iterating on Legacy Code is usually

faster, easier and cheaper than a full rewrite

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

How Did We Do It?

9

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Version Control

★Easily compare changes★Revert breaking changes to

stable point★Allows developers to work

on multiple tasks concurrently without confusion

★Works best with short-lived branches, and small changesets

10

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Continuous Integration

& Deployment

★CI: Quickly merge changes into master upon passing tests

★CD: Automatically deploy changes to master upon merge

★Encourages small changesets and rapid development

★Tests are your gatekeeper

11

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Automated Testing

★Unit Tests: Foundation of Test Suite

★Legacy Code = Not Unit Testable

★Solution: Behavior Tests

12

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Testing Pyramid

13

MaintenanceCoverageFragility DurationCost Number of Tests

Unit Tests

Behavior Tests

System Tests(performance)

GUITests

Unit

Behavior

System

GUI

Manual QA

Testing Ice Cream Cone

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

The Vicious Cycle of the Testing Ice Cream Cone

14

Unit

Behavior

System

GUI

Manual QA

Non Testable

Code

More Expensive

Tests

Developers Don't

Run Tests

More Bugs

Developers Don't

Write Unit Tests

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Automated Testing

★Unit Tests: Foundation of Test Suite

★Legacy Code = Not Unit Testable

★Short-Term Solution: Behavior Tests

★Long-Term Solution: Write Unit Testable Code & Unit Tests

15

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Writing Features for Existing CodeWrite FeatureRun Test

Test Passes - Double CheckTest Fails

Described Feature WrongMistake in Test CodeFeature is Broken

16

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Style Guide★Reduces clutter in diffs★Reduces head-butting &

petty arguments★Just pick one!

17

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Quality Rules

★Keep New Code from becoming Legacy Code

★Be Specific★Feedback needs to be

immediate - How?

18

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Quality Enforcement

★Automate All The Things! (Add it to your CI)

★Quality Checks Run Locally★Bypass in emergency

19

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Code Review

★Always Be Code-Reviewing!★Small PRs★Look for:

○ Readability○ Business Logic○ Security & Performance

Problems

20

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Continuing Education

★ Conferences, User Groups, Community

★Weekly Training & Teaching Sessions In-Office

21

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Third Party Tools &

Libraries

★Don't Write Code That Doesn't Contain Business Logic

★Cheaper to Research Third-Party Tools vs. Write It Yourself

○ Does it suit our needs?○ Is it maintained?○ Is it tested?○ Can we contribute?

★Contribute Back!22

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9 23

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Restful API

24

★Client-Facing and Internal Use

★Iterate Front-End Changes to Introduce Unit-Testable Code

★Behavior Tests Covered Front-End Changes

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Restful API25

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

50%Salesforce reportedly generates 50 percent of its revenues through APIs

26

https://techcrunch.com/2016/05/21/the-rise-of-apis/

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

60%eBay nearly 60 percent

27

https://techcrunch.com/2016/05/21/the-rise-of-apis/

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

90%Expedia a whopping 90 percent

28

https://techcrunch.com/2016/05/21/the-rise-of-apis/

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Make Your API a First

Class Citizen 29

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

What Worked?

❖ Version Control

❖ Automated Testing

❖ Style Guide

❖ Code Quality & Enforcement

❖ Code Review

❖ Education

❖ Use of Third Party Tools & Libraries

30

What Didn't Work?

❖ Continuous Integration & Deployment

❖ Automated Testing

❖ Neglected Our API

❖ Third Party Tools

➢ Didn't Research Enough

➢ Didn't Contribute Back

➢ Didn't Update

What We Would Do...

❖ Focus on the API First

❖ Microservices

❖ Focus on Unit Testing

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Current Project Status

It's stable!

★New Admin was launched after about 9 months

★Had a few bugs, took about 3 more months to be stable

★Next 2 years: ~0 regressions

★Very limited downtime

31

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

Technical Goals

Happy Developers!

★Maintainable Code: Check

★Quality Code: Check

★Documentation: Check

★Rapid Development: Oh Yeah

★Easy Deployment: So Easy!

★Zero Regressions: Close Enough!

32

@jessicamauerhan | #OpenWest | https://joind.in/talk/091b9

LegacyA Retrospective

@jessicamauerhan | #OpenWest| https://joind.in/talk/091b9

top related