SlideShare a Scribd company logo
Software Engineering-L12
Sameera Gunathilaka
Lead Software Engineer
ERP Technical Consultant
IT1204 – Software Engineering Institute of Technology, University of Moratuwa 1
Software Forward
Engineering
• Forward engineering is a
process of constructing an
application with the help of the
general requirements of the
final implementation
• Building from a model into an
implementation language
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 2
Software Reverse Engineering
• Software Reverse Engineering is a process of recovering the design,
requirement specifications and functions of a product from an
analysis of its code
• A software which is needed to be upgrade or which is needed to be
shift to other operating system
• Reverse engineering is to recover the design and a specification from
implementation
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
3
Software Re-Engineering
• Software Re-Engineering is the
examination and alteration of a
system to reconstitute it in a
new form
• In Software Re-engineering, we
are improving the software to
make it more efficient and
effective.
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 4
Software Maintenance
• Software Maintenance is the process of modifying a software
product after it has been delivered to the customer.
• The main purpose of software maintenance is to modify and update
software application after delivery to correct faults and to improve
performance.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
5
Corrective Maintenance Adaptive Maintenance
Perfective Maintenance Preventive Maintenance
Software Refactoring
• The process of changing a software system in such a way that it does
not alter the external behaviour of the code yet improves its internal
structure
• Refactoring is intended to improve non-fuctional attributes of the
software.
• Code refactoring may help software developers discover and fix
hidden bugs
• Improve Code Readability
• Reduce complexity
• Improve source code maintainability
• Create expensive internal architecture
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 6
What’s Code
refactoring ?
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 7
Code
reorganization
Change the
structure not
the
behaviour
Cleans up “Code Smell”
Does NOT fix bugs
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
8
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 9
Code smell
• A code smell is a hint that something has gone wrong somewhere
in your code. Use the smell to track down the problem.
• Highly experienced and knowledgeable developers have a "feel"
for good design.
• Common Code Smells
• Duplicated Code
• Long method
• Long parameter list
• Switch Statements
• Improper Naming
• Comments
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 10
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
11
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
12
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
13
Why do we
refactor?
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 14
Helps up deliver more business value faster
Improve the design of our software
Minimize the technical debt
Keep development at speed
Make the code easer to understand
To help find bugs in the maintenance phase
When should
we Refactor?
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 15
Add new functionality
• Refactor existing code until you
understand it
• Refactor design to make it simple
To find bugs
• Refactor to understand the code
For code reviews
• Immediate effect of code review
• Allows for higher level suggestions
What is meant
by Code
Review?
Code Review is a systematic
examination, which can find
and remove the
vulnerabilities in the code
such as memory leaks and
buffer overflows, conversion
issues, standards, readability.
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 17
Common Code Review Approaches
• The Email Thread
• file is sent around to the appropriate colleagues via email
• Pair Programming
• working on the same code together and thereby checking each other’s work as
they go
• Over-the-Shoulder
• Once your code is ready, just find a qualified colleague to site down at your
workstation (or go to theirs) and review your code for you
• Tool-Assisted
• Software tools solve many of the limitations of the preceding approaches above,
tracking colleagues’ comments and proposed solutions to defects in a clear and
coherent sequence (similar to tracking changes in MS Word)
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
18
How do we Refactor?
•Manual Refactoring
•Code Smells
•Automated/Assisted Refactoring
•Refactoring by hands is time consuming
•Use IDE
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 19
Tools for Code Review
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
20
Refactoring Techniques - Composing Methods
• Extract Method
You have a code fragment that can be grouped together.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
21
Refactoring Techniques - Composing Methods
• Extract Variable
• You have an expression that’s hard to understand.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
22
Refactoring Techniques - Composing Methods
• Replace Temp with Query
• You place the result of an expression in a local variable for later use in your
code.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
23
Refactoring Techniques - Composing Methods
• Remove Assignments to Parameters
• Some value is assigned to a parameter inside method’s body.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
24
Refactoring Techniques -
Moving Features between Objects
• Move Method
• A method is used more in another class than in its own class.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
25
Refactoring Techniques -
Moving Features between Objects
• Extract Class
• When one class does the work of two, awkwardness results.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
26
Refactoring Techniques -
Moving Features between Objects
• Remove Middle Man
• A class has too many methods that simply delegate to other objects.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
27
Refactoring Techniques - Organizing Data
• Change Reference to Value
• You have a reference object that’s too small and infrequently changed to
justify managing its life cycle.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
28
Refactoring Techniques - Organizing Data
• Replace Array with Object
• You have an array that contains various types of data.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
29
Refactoring Techniques - Organizing Data
• Change Unidirectional Association to Bidirectional
• You have two classes that each need to use the features of the other, but the
association between them is only unidirectional.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
30
Refactoring Techniques - Organizing Data
• Replace Type Code with Subclasses
• You have a coded type that directly affects program behavior (values of this
field trigger various code in conditionals).
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
31
Refactoring Techniques – Simplifying
conditional expressions
• Consolidate Duplicate Conditional Fragments
• Identical code can be found in all branches of a conditional.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
32
Refactoring Techniques – Simplifying
conditional expressions
• Replace Nested Conditional with Guard Clauses
• You have a group of nested conditionals and it’s hard to determine the normal
flow of code execution.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
33
IT1204 – Software Engineering Institute of Technology,
University of Moratuwa 34
Refactoring Techniques – Dealing with
Generalization
• Pull Up Field
• Two classes have the same field.
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
35
Thank you
IT1204 – Software Engineering
Institute of Technology, University of Moratuwa
36

More Related Content

What's hot

Software Mangineeringment
Software MangineeringmentSoftware Mangineeringment
Software Mangineeringment
Prof. Amir Tomer
 
Introduction Software engineering
Introduction   Software engineeringIntroduction   Software engineering
Introduction Software engineering
Jennifer O. Contreras Coloma
 
software engineering ethics
software engineering ethicssoftware engineering ethics
software engineering ethics
university of education,Lahore
 
software engineering
software engineeringsoftware engineering
software engineering
Tayfun Çelik
 
Software Engineering Code Of Ethics And Professional Practice
Software Engineering Code Of Ethics And Professional PracticeSoftware Engineering Code Of Ethics And Professional Practice
Software Engineering Code Of Ethics And Professional Practice
Saqib Raza
 
7 Engineering Profession
7 Engineering Profession7 Engineering Profession
7 Engineering Profession
Saqib Raza
 
0273710133 pp01v2
0273710133 pp01v20273710133 pp01v2
0273710133 pp01v2
Ravi Chandra
 
Software requirements engineering problems and challenges erp implementation ...
Software requirements engineering problems and challenges erp implementation ...Software requirements engineering problems and challenges erp implementation ...
Software requirements engineering problems and challenges erp implementation ...
Dr. Hamdan Al-Sabri
 
Emertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment systemEmertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Information Technologies Pvt Ltd
 
Requirements engineering challenges
Requirements engineering challengesRequirements engineering challenges
Requirements engineering challenges
sommerville-videos
 
L1 overview of software engineering
L1  overview of software engineeringL1  overview of software engineering
L1 overview of software engineering
Rushdi Shams
 
Ch12
Ch12Ch12
Ch12
Nimol KEO
 
Rajmohan_CV _Updated
Rajmohan_CV _UpdatedRajmohan_CV _Updated
Rajmohan_CV _Updated
Rajmohan A
 
Lean Implementation on IT Infrastructure Monitoring System
Lean Implementation on IT Infrastructure Monitoring SystemLean Implementation on IT Infrastructure Monitoring System
Lean Implementation on IT Infrastructure Monitoring System
Dio Pratama
 
03 requirement engineering_process
03 requirement engineering_process03 requirement engineering_process
03 requirement engineering_process
University of Computer Science and Technology
 
An overview of software requirements engineering
An overview of software requirements engineeringAn overview of software requirements engineering
An overview of software requirements engineering
Ian Sommerville
 
system level requirements gathering and analysis
system level requirements gathering and analysissystem level requirements gathering and analysis
system level requirements gathering and analysis
university of education,Lahore
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
Anton Fajardo
 
QA Basics and PM Overview
QA Basics and PM OverviewQA Basics and PM Overview
QA Basics and PM Overview
Ajay Mani Paudel
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
Bernardo A. Delicado
 

What's hot (20)

Software Mangineeringment
Software MangineeringmentSoftware Mangineeringment
Software Mangineeringment
 
Introduction Software engineering
Introduction   Software engineeringIntroduction   Software engineering
Introduction Software engineering
 
software engineering ethics
software engineering ethicssoftware engineering ethics
software engineering ethics
 
software engineering
software engineeringsoftware engineering
software engineering
 
Software Engineering Code Of Ethics And Professional Practice
Software Engineering Code Of Ethics And Professional PracticeSoftware Engineering Code Of Ethics And Professional Practice
Software Engineering Code Of Ethics And Professional Practice
 
7 Engineering Profession
7 Engineering Profession7 Engineering Profession
7 Engineering Profession
 
0273710133 pp01v2
0273710133 pp01v20273710133 pp01v2
0273710133 pp01v2
 
Software requirements engineering problems and challenges erp implementation ...
Software requirements engineering problems and challenges erp implementation ...Software requirements engineering problems and challenges erp implementation ...
Software requirements engineering problems and challenges erp implementation ...
 
Emertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment systemEmertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment system
 
Requirements engineering challenges
Requirements engineering challengesRequirements engineering challenges
Requirements engineering challenges
 
L1 overview of software engineering
L1  overview of software engineeringL1  overview of software engineering
L1 overview of software engineering
 
Ch12
Ch12Ch12
Ch12
 
Rajmohan_CV _Updated
Rajmohan_CV _UpdatedRajmohan_CV _Updated
Rajmohan_CV _Updated
 
Lean Implementation on IT Infrastructure Monitoring System
Lean Implementation on IT Infrastructure Monitoring SystemLean Implementation on IT Infrastructure Monitoring System
Lean Implementation on IT Infrastructure Monitoring System
 
03 requirement engineering_process
03 requirement engineering_process03 requirement engineering_process
03 requirement engineering_process
 
An overview of software requirements engineering
An overview of software requirements engineeringAn overview of software requirements engineering
An overview of software requirements engineering
 
system level requirements gathering and analysis
system level requirements gathering and analysissystem level requirements gathering and analysis
system level requirements gathering and analysis
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
 
QA Basics and PM Overview
QA Basics and PM OverviewQA Basics and PM Overview
QA Basics and PM Overview
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
 

Similar to IT1204 - Software Engineering - L12

IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9
BakerTilly US
 
IT1204 – Software Engineering L6
IT1204 – Software Engineering L6                                           IT1204 – Software Engineering L6
IT1204 – Software Engineering L6
BakerTilly US
 
IT1204 - Software engineering - L5
IT1204 - Software engineering - L5IT1204 - Software engineering - L5
IT1204 - Software engineering - L5
BakerTilly US
 
IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10
BakerTilly US
 
e-Business - SE trends
e-Business - SE trendse-Business - SE trends
e-Business - SE trends
Vladimir Kotov
 
Machine Learning in Software Engineering
Machine Learning in Software EngineeringMachine Learning in Software Engineering
Machine Learning in Software Engineering
Alaa Hamouda
 
SOFTWARE ENGINEERING
SOFTWARE ENGINEERINGSOFTWARE ENGINEERING
SOFTWARE ENGINEERING
Mahalakshmi Seenaswamy
 
Seminar on Project Management by Rj
Seminar on Project Management by RjSeminar on Project Management by Rj
Seminar on Project Management by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Software Engineering.ppt
Software Engineering.pptSoftware Engineering.ppt
Software Engineering.ppt
HODCOMPUTER10
 
An introduction to software engineering
An introduction to software engineeringAn introduction to software engineering
An introduction to software engineering
SHREEHARI WADAWADAGI
 
IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8
BakerTilly US
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
Maven Logix
 
Lecture 1 - Requirement Engineering.pptx
Lecture 1 - Requirement Engineering.pptxLecture 1 - Requirement Engineering.pptx
Lecture 1 - Requirement Engineering.pptx
AbdulRaheem254960
 
Scope of software engineering
Scope of software engineeringScope of software engineering
Scope of software engineering
Muhammad Naveed Zafar
 
1 introduction
1 introduction1 introduction
1 introduction
Ayesha Bhatti
 
1 introduction (1)
1 introduction (1)1 introduction (1)
1 introduction (1)
Ayesha Bhatti
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
nikhil sreeni
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
UnknownPerson201264
 
Greate Introduction to Software Engineering @ Track IT Academy
Greate Introduction to Software Engineering @ Track IT AcademyGreate Introduction to Software Engineering @ Track IT Academy
Greate Introduction to Software Engineering @ Track IT Academy
Mohamed Shahpoup
 
IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7
BakerTilly US
 

Similar to IT1204 - Software Engineering - L12 (20)

IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9
 
IT1204 – Software Engineering L6
IT1204 – Software Engineering L6                                           IT1204 – Software Engineering L6
IT1204 – Software Engineering L6
 
IT1204 - Software engineering - L5
IT1204 - Software engineering - L5IT1204 - Software engineering - L5
IT1204 - Software engineering - L5
 
IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10
 
e-Business - SE trends
e-Business - SE trendse-Business - SE trends
e-Business - SE trends
 
Machine Learning in Software Engineering
Machine Learning in Software EngineeringMachine Learning in Software Engineering
Machine Learning in Software Engineering
 
SOFTWARE ENGINEERING
SOFTWARE ENGINEERINGSOFTWARE ENGINEERING
SOFTWARE ENGINEERING
 
Seminar on Project Management by Rj
Seminar on Project Management by RjSeminar on Project Management by Rj
Seminar on Project Management by Rj
 
Software Engineering.ppt
Software Engineering.pptSoftware Engineering.ppt
Software Engineering.ppt
 
An introduction to software engineering
An introduction to software engineeringAn introduction to software engineering
An introduction to software engineering
 
IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
Lecture 1 - Requirement Engineering.pptx
Lecture 1 - Requirement Engineering.pptxLecture 1 - Requirement Engineering.pptx
Lecture 1 - Requirement Engineering.pptx
 
Scope of software engineering
Scope of software engineeringScope of software engineering
Scope of software engineering
 
1 introduction
1 introduction1 introduction
1 introduction
 
1 introduction (1)
1 introduction (1)1 introduction (1)
1 introduction (1)
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Greate Introduction to Software Engineering @ Track IT Academy
Greate Introduction to Software Engineering @ Track IT AcademyGreate Introduction to Software Engineering @ Track IT Academy
Greate Introduction to Software Engineering @ Track IT Academy
 
IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7
 

More from BakerTilly US

IT1206- Object Oriented Analysis and Design- L10
IT1206- Object Oriented Analysis and Design- L10IT1206- Object Oriented Analysis and Design- L10
IT1206- Object Oriented Analysis and Design- L10
BakerTilly US
 
IT1206 Object Oriented Analysis and Design-L8
IT1206   Object Oriented Analysis and Design-L8IT1206   Object Oriented Analysis and Design-L8
IT1206 Object Oriented Analysis and Design-L8
BakerTilly US
 
IT1206 Object Oriented Analysis And Design-L6
IT1206   Object Oriented Analysis And Design-L6IT1206   Object Oriented Analysis And Design-L6
IT1206 Object Oriented Analysis And Design-L6
BakerTilly US
 
IT1206 Object Oriented Analysis and Design-L5
IT1206   Object Oriented Analysis and Design-L5IT1206   Object Oriented Analysis and Design-L5
IT1206 Object Oriented Analysis and Design-L5
BakerTilly US
 
IT1206 Object Oriented Analysis and Design-L4
IT1206   Object Oriented Analysis and Design-L4IT1206   Object Oriented Analysis and Design-L4
IT1206 Object Oriented Analysis and Design-L4
BakerTilly US
 
IT1206 Object Oriented Analysis and Design- L3
IT1206   Object Oriented Analysis and Design- L3IT1206   Object Oriented Analysis and Design- L3
IT1206 Object Oriented Analysis and Design- L3
BakerTilly US
 
IT1206- Object Oriented Analysis And Design-L1
IT1206- Object Oriented Analysis And Design-L1IT1206- Object Oriented Analysis And Design-L1
IT1206- Object Oriented Analysis And Design-L1
BakerTilly US
 
Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management
BakerTilly US
 

More from BakerTilly US (8)

IT1206- Object Oriented Analysis and Design- L10
IT1206- Object Oriented Analysis and Design- L10IT1206- Object Oriented Analysis and Design- L10
IT1206- Object Oriented Analysis and Design- L10
 
IT1206 Object Oriented Analysis and Design-L8
IT1206   Object Oriented Analysis and Design-L8IT1206   Object Oriented Analysis and Design-L8
IT1206 Object Oriented Analysis and Design-L8
 
IT1206 Object Oriented Analysis And Design-L6
IT1206   Object Oriented Analysis And Design-L6IT1206   Object Oriented Analysis And Design-L6
IT1206 Object Oriented Analysis And Design-L6
 
IT1206 Object Oriented Analysis and Design-L5
IT1206   Object Oriented Analysis and Design-L5IT1206   Object Oriented Analysis and Design-L5
IT1206 Object Oriented Analysis and Design-L5
 
IT1206 Object Oriented Analysis and Design-L4
IT1206   Object Oriented Analysis and Design-L4IT1206   Object Oriented Analysis and Design-L4
IT1206 Object Oriented Analysis and Design-L4
 
IT1206 Object Oriented Analysis and Design- L3
IT1206   Object Oriented Analysis and Design- L3IT1206   Object Oriented Analysis and Design- L3
IT1206 Object Oriented Analysis and Design- L3
 
IT1206- Object Oriented Analysis And Design-L1
IT1206- Object Oriented Analysis And Design-L1IT1206- Object Oriented Analysis And Design-L1
IT1206- Object Oriented Analysis And Design-L1
 
Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management
 

Recently uploaded

Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
michniczscribd
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
Ortus Solutions, Corp
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
WebConnect Pvt Ltd
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
ICS
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Ortus Solutions, Corp
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
kalichargn70th171
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
OnePlan Solutions
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
dhavalvaghelanectarb
 

Recently uploaded (20)

bgiolcb
bgiolcbbgiolcb
bgiolcb
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
 

IT1204 - Software Engineering - L12

  • 1. Software Engineering-L12 Sameera Gunathilaka Lead Software Engineer ERP Technical Consultant IT1204 – Software Engineering Institute of Technology, University of Moratuwa 1
  • 2. Software Forward Engineering • Forward engineering is a process of constructing an application with the help of the general requirements of the final implementation • Building from a model into an implementation language IT1204 – Software Engineering Institute of Technology, University of Moratuwa 2
  • 3. Software Reverse Engineering • Software Reverse Engineering is a process of recovering the design, requirement specifications and functions of a product from an analysis of its code • A software which is needed to be upgrade or which is needed to be shift to other operating system • Reverse engineering is to recover the design and a specification from implementation IT1204 – Software Engineering Institute of Technology, University of Moratuwa 3
  • 4. Software Re-Engineering • Software Re-Engineering is the examination and alteration of a system to reconstitute it in a new form • In Software Re-engineering, we are improving the software to make it more efficient and effective. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 4
  • 5. Software Maintenance • Software Maintenance is the process of modifying a software product after it has been delivered to the customer. • The main purpose of software maintenance is to modify and update software application after delivery to correct faults and to improve performance. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 5 Corrective Maintenance Adaptive Maintenance Perfective Maintenance Preventive Maintenance
  • 6. Software Refactoring • The process of changing a software system in such a way that it does not alter the external behaviour of the code yet improves its internal structure • Refactoring is intended to improve non-fuctional attributes of the software. • Code refactoring may help software developers discover and fix hidden bugs • Improve Code Readability • Reduce complexity • Improve source code maintainability • Create expensive internal architecture IT1204 – Software Engineering Institute of Technology, University of Moratuwa 6
  • 7. What’s Code refactoring ? IT1204 – Software Engineering Institute of Technology, University of Moratuwa 7 Code reorganization Change the structure not the behaviour Cleans up “Code Smell” Does NOT fix bugs
  • 8. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 8
  • 9. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 9
  • 10. Code smell • A code smell is a hint that something has gone wrong somewhere in your code. Use the smell to track down the problem. • Highly experienced and knowledgeable developers have a "feel" for good design. • Common Code Smells • Duplicated Code • Long method • Long parameter list • Switch Statements • Improper Naming • Comments IT1204 – Software Engineering Institute of Technology, University of Moratuwa 10
  • 11. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 11
  • 12. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 12
  • 13. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 13
  • 14. Why do we refactor? IT1204 – Software Engineering Institute of Technology, University of Moratuwa 14 Helps up deliver more business value faster Improve the design of our software Minimize the technical debt Keep development at speed Make the code easer to understand To help find bugs in the maintenance phase
  • 15. When should we Refactor? IT1204 – Software Engineering Institute of Technology, University of Moratuwa 15 Add new functionality • Refactor existing code until you understand it • Refactor design to make it simple To find bugs • Refactor to understand the code For code reviews • Immediate effect of code review • Allows for higher level suggestions
  • 16. What is meant by Code Review? Code Review is a systematic examination, which can find and remove the vulnerabilities in the code such as memory leaks and buffer overflows, conversion issues, standards, readability.
  • 17. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 17
  • 18. Common Code Review Approaches • The Email Thread • file is sent around to the appropriate colleagues via email • Pair Programming • working on the same code together and thereby checking each other’s work as they go • Over-the-Shoulder • Once your code is ready, just find a qualified colleague to site down at your workstation (or go to theirs) and review your code for you • Tool-Assisted • Software tools solve many of the limitations of the preceding approaches above, tracking colleagues’ comments and proposed solutions to defects in a clear and coherent sequence (similar to tracking changes in MS Word) IT1204 – Software Engineering Institute of Technology, University of Moratuwa 18
  • 19. How do we Refactor? •Manual Refactoring •Code Smells •Automated/Assisted Refactoring •Refactoring by hands is time consuming •Use IDE IT1204 – Software Engineering Institute of Technology, University of Moratuwa 19
  • 20. Tools for Code Review IT1204 – Software Engineering Institute of Technology, University of Moratuwa 20
  • 21. Refactoring Techniques - Composing Methods • Extract Method You have a code fragment that can be grouped together. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 21
  • 22. Refactoring Techniques - Composing Methods • Extract Variable • You have an expression that’s hard to understand. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 22
  • 23. Refactoring Techniques - Composing Methods • Replace Temp with Query • You place the result of an expression in a local variable for later use in your code. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 23
  • 24. Refactoring Techniques - Composing Methods • Remove Assignments to Parameters • Some value is assigned to a parameter inside method’s body. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 24
  • 25. Refactoring Techniques - Moving Features between Objects • Move Method • A method is used more in another class than in its own class. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 25
  • 26. Refactoring Techniques - Moving Features between Objects • Extract Class • When one class does the work of two, awkwardness results. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 26
  • 27. Refactoring Techniques - Moving Features between Objects • Remove Middle Man • A class has too many methods that simply delegate to other objects. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 27
  • 28. Refactoring Techniques - Organizing Data • Change Reference to Value • You have a reference object that’s too small and infrequently changed to justify managing its life cycle. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 28
  • 29. Refactoring Techniques - Organizing Data • Replace Array with Object • You have an array that contains various types of data. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 29
  • 30. Refactoring Techniques - Organizing Data • Change Unidirectional Association to Bidirectional • You have two classes that each need to use the features of the other, but the association between them is only unidirectional. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 30
  • 31. Refactoring Techniques - Organizing Data • Replace Type Code with Subclasses • You have a coded type that directly affects program behavior (values of this field trigger various code in conditionals). IT1204 – Software Engineering Institute of Technology, University of Moratuwa 31
  • 32. Refactoring Techniques – Simplifying conditional expressions • Consolidate Duplicate Conditional Fragments • Identical code can be found in all branches of a conditional. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 32
  • 33. Refactoring Techniques – Simplifying conditional expressions • Replace Nested Conditional with Guard Clauses • You have a group of nested conditionals and it’s hard to determine the normal flow of code execution. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 33
  • 34. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 34
  • 35. Refactoring Techniques – Dealing with Generalization • Pull Up Field • Two classes have the same field. IT1204 – Software Engineering Institute of Technology, University of Moratuwa 35
  • 36. Thank you IT1204 – Software Engineering Institute of Technology, University of Moratuwa 36

Editor's Notes

  1. Correct faults. Improve the design. Implement enhancements. Interface with other systems. Accommodate programs so that different hardware, software, system features, and telecommunications facilities can be used. Migrate legacy software. Retire software.
  2. Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. 
  3. Directed Association(unary Association) vs Composition
  4. https://sourcemaking.com/refactoring/refactorings