Platinum Sponsor LARGE SCALE REFACTORING Volodymyr Fedak.

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

The most cost effective, easy to start, digital signage service for funeral homes The web forever changed how people consume, share, discover and connect.
Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
I Can Slack Off, My Code’s Compiling Comic and title care of XKCD.com.
Alternate Software Development Methodologies
Software Construction
NAUG NAUG Knowledge Evening – th February 2007.
Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.
Redesigning the Organization with Information Systems Soetam Rizky.
1 Software Maintenance and Evolution CSSE 575: Session 1, Part 1 Course Introduction Steve Chenoweth Office Phone: (812) Cell: (937)
1 Steve Chenoweth Tuesday, 10/04/11 Week 5, Day 2 Right – Typical tool for reading out error codes logged by your car’s computer, to help analyze its problems.
Requirements Analysis Lecture #3 David Andrews
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
SE 450 Software Processes & Product Metrics 1 Defect Removal.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
System Implementation
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Evaluating Architectures Quality control: rarely fun, but always necessary
Introduction to Software Testing
Agile Testing with Testing Anywhere The road to automation need not be long.
Design, Implementation and Maintenance
Michael Solomon Tugboat Software Managing the Software Development Process.
TDD OVERVIEW OF TEST DRIVEN DEVELOPMENT by Paul M. code of the damned. com.
Introduction to Continuous Integration Mike Roberts.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Quality Management ISO 9001 For TM. What is Quality Quality is the degree to which product or service possesses a desired combination of attributes C:
“Behind the Scenes” of the Enterprise Development Reference Architecture (EDRA) Jonathan Wanagel Microsoft patterns & practices
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Test Organization and Management
System Analysis and Design
Teaching material for a course in Software Project Management & Software Engineering – part II.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Software Engineering Management Lecture 1 The Software Process.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
OOI CI LCA REVIEW August 2010 Ocean Observatories Initiative OOI Cyberinfrastructure Architecture Overview Michael Meisinger Life Cycle Architecture Review.
Monthly Publishing System (MPS) Developer Workshop 25 August, 2015.
Lecture 7: Requirements Engineering
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
An Introduction to Software Engineering. Communication Systems.
Assessing the influence on processes when evolving the software architecture By Larsson S, Wall A, Wallin P Parul Patel.
How to Improve the Safety of Signalling Systems with a Shortened Construction Period in Engineering Construction Projects Gao Guoliang Safety Assurance.
CS551 - Lecture 5 1 CS551 Lecture 5: Quality Attributes Yugi Lee FH #555 (816)
LESSON 3. Properties of Well-Engineered Software The attributes or properties of a software product are characteristics displayed by the product once.
AP-1 4. Agile Processes. AP-2 Agile Processes Focus on creating a working system Different attitude on measuring progress XP Scrum.
Test-Driven Development Eduard Miric ă. The problem.
WATERFALL DEVELOPMENT MODEL. Waterfall model is LINEAR development lifecycle. This means each phase must be completed before moving onto the next!!! WHAT.
SOFTWARE ENGINEERING. Objectives Have a basic understanding of the origins of Software development, in particular the problems faced in the Software Crisis.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Testing Spring Applications Unit Testing.
Software Engineering Principles Practical Advice and Steps for Managing Your Project.
Agenda: Overview of Agile testing Difference between Agile and traditional Methodology Agile Development Methodologies Extreme Programming Test Driven.
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
Parasoft : Improving Productivity in IT Organizations David McCaw.
Week # 4 Quality Assurance Software Quality Engineering 1.
Introduction to Software Engineering Muhammad Nasir Agile Software Development(2)
Benjamin Day Get Good at DevOps: Feature Flag Deployments with ASP.NET, WebAPI, & JavaScript.
Rome 31 January -1 February Team Development in CRM Shan McArthur CEO / CTO Adxstudio, CRM MVP.
INTRODUCTION CSE 470 : Software Engineering. Goals of Software Engineering To produce software that is absolutely correct. To produce software with minimum.
Agile Center of Excellence. Richard K Cheng Agile is just a high level concept.
Continuous Delivery and Quality Monitoring
Information Systems Development
Chapter 18 Maintaining Information Systems
CSE 403 Software Engineering
Dilbert Scott Adams.
What do you need to know about XP?
Introduction to Software Testing
ABHISHEK SHARMA ARVIND SRINIVASA BABU HEMANT PRASAD 08-OCT-2018
CHAPTER 10 METHODOLOGIES FOR CUSTOM SOFTWARE DEVELOPMENT
Refactoring.
Applying Use Cases (Chapters 25,26)
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Platinum Sponsor LARGE SCALE REFACTORING Volodymyr Fedak

Who Am I Solution Architect at SoftServe with 9+ years experience in IT Ongoing project: Significant efforts are dedicated to the following quality attributes: testability, extensibility, maintainability A lot of efforts are spent on evolving legacy projects

Why do we change code? Why refactor? Refactoring strategies Case study Summary Agenda

Four Reasons to Change Software Adding a feature Fixing a bug Improving the design Optimizing resource usage

Any fool can write code that a computer can understand. Good programmers write code that humans can understand

What is not refactoring Refactoring is not debugging Refactoring is not performanceRefactoring is not adding a feature

"Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior." What is refactoring?

Refactoring is an continuous process

Restructuring of existing code that has visible influence to the overall system quality attributes. What is large scale refactoring?

Why do we change code? Why refactor? Refactoring strategies Case study Summary Agenda

Success projects statistics

Legacy projects: technical perspective

Legacy projects team policies and practices They minimize the number of changes that they make to the code base Sometimes this is a team policy: "If it's not broken, don't fix it” Developers What? Create another method for that? No, I'll just put the lines of code right here in the method, where I can see them and the rest of the code. It involves less editing, and it's safer

After such policy

Refactoring helps Make the code easier to understand Make it easier to maintain codebaseRefactoring reduces your risk—can lead to lightweight pragmatic design Improve code quality. You Can’t be Agile if your code sucks!

Refactoring principles Don’t write code that’s really not needed, Code you don’t write, don’t have to be maintained! Avoid Clever Code—Keep it SimpleKeep code DRYRely on automated tests

Refactoring principles Checkin Frequently, take small steps Make sense in seconds, not in minutes, hours, weeks,... Make code self documented

Why do we change code? Why to refactor workable code? Refactoring strategies Case study Summary Agenda

Refactoring Catalog

Mikado method A change We need to change this

Mikado method A change When we changed this

Prereq Mikado method A change So it’s time to note all prerequisites

Prereq Mikado method A change So it’s time to note all prerequisites

Prereq Mikado method A change So it’s time to note all prerequisites

Prereq Mikado method A change When we tried refactor this

Prereq Mikado method A change We’ve got new errors

Prereq Mikado method A change Noted new prerequisites

Prereq Mikado method A change And reverted again

Prereq Mikado method A change Until we could do prerequisites without errors

Prereq Mikado method A change

Prereq Mikado method A change Working the way back to original change

Prereq Mikado method A change Now the change is easy to implement

Benefits of such approach Codebase every time is in good state You won’t have such situation that time is go on and everything is broken You always keep focus on target

Refactoring strategies Big Bang - Define the structure for the final state and push code to its ultimate home Divide and conquer - Try to separate the big ball of mud into two pieces. Repeat until done... Strangling

Why people like big bang? Strangling is very expensive, It’s cute but not for us We don’t have tight schedule for this refactoring, let’s safely make a changes in branch We have to do a lot of changes we can’t divide problem into piecesIt’s a risky

Why do we need to refactor code ? Did you face with such term as “Risky change” ?

What information is hidden? From practical standpoint big bang never happens successfully

Why do we change code? Why to refactor workable code? Refactoring strategies Case study Summary Agenda

Case study What refactor strategy should be used ? Big Bang - Define the structure for the final state and push code to its ultimate home Divide and conquer - Try to separate the big ball of mud into two pieces. Repeat until done... Strangling

We used mixed Divide and conquer - Try to separate the big ball of mud into two pieces. Repeat until done... Strangling

Refactoring taxonomy Guarantee that we have reliable mechanism to check that everything works Create infrastructure to switch implementations Utilize dependency injectionFinish refactoring (divide and conquer)

Guarantee that we have reliable mechanism to check that everything works Unit tests: create necessary coverage and verifications for authentication/authorization flows Initiated integration testsUI automation tests check that everything is verifiedDon’t forget about concurrent scenarios

Create infrastructure: gather old structure Application Security Old code structure Session context

Create infrastructure: Create new structure Application Security OldSecurity New Adapter 35% of deal

Utilize Dependency Injection Switch (web.xml) Security Old (application context) Security New (application context Adapter API Interfaces only Security New classes (implemented in v2 package) Spring managed context Security Old classes (Current implementation) Servlet session context Application Code Old Application boundaries New application boundaries Adapter classes

Finish refactoring: make new Security workable Switch (web.xml) Security New (application context Adapter API Interfaces only Security New classes (implemented in v2 package) Spring managed context Application Code New application boundaries

Finish refactoring drop old code Switch (web.xml) Security Old (application context) Adapter API Interfaces only Security Old classes (Current implementation) Servlet session context Application Code Old Application boundaries Adapter classes

Summary Please don’t believe in risk Write code that doesn’t require further refactoring In case you need to refactor a large project please think 10 times before doing this.

Write code to have your house in good state

Useful Links Refactoring Large Software Systems Michael C. Feathers Working efficiently with legacy code Michael C. Feathers Working efficiently with legacy code Refactoring legacy applications Large scale refactoring

Questions