agile refactoring and integration techniques.pdf

shreyassoni7 10 views 32 slides Apr 30, 2024
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

agile development


Slide Content

Acropolis Institute of Technology &
Research, Indore
www.acropolis.in

CS703 Agile Software
Development
By: Prof.Pirmohammad

[email protected]

Agile Software Development
[email protected] 3




UNIT - V

Agile Software Development
[email protected] 4




Agile Software Design and
Development

Agile Practices
[email protected] 5
1.Release frequently
2.Design for ideas
3.Test
4.Code for future
5.Communicate agilely

Release Frequently
[email protected] 6
Release monthly and you will...

1.Assure about integration and deployment issues early
2.Your project is always ready to submit
3.Use automated installer

Be Productive
1.Time boxed forces you to implement only the MOST important
2.Reachable goal boosts

Release Frequently
[email protected] 7



Get Feedback
1.Evaluate trade-offs , actively
2.Design is gradually more accurate direction

Design for ideas
[email protected] 8

1.Design idea will be evolving during development
2.(Especially when using unfamiliar technology)
3.If you design it too specifically(method details , data
types , parameters)
4.And even document it
5.You will surely REDO it again or else GET STUCK with your
bad design

Design for ideas
[email protected] 9
Suggestion 1
✔Design in paper or whiteboard
✔Take a photo for sharing
Suggestion 2
CRC design method
oClass name
oResponsibility
❖ What is supposed to do?
oCollaborator
❖What other objects it works with?

Design for ideas
[email protected] 10


Suggestion 3
✔Make it easy for test



Suggestion 4
✔As simple as possible

Test
[email protected] 11


1.Test it programmatically
2.Fewer bugs & faster debug-know problems early and specifically
3.Comfortable Refectory-No need to check if it still really work
4.Simple design
o Test before : design will be never over complicated
oTest After : method that hard to test is need to simplify

Test
[email protected] 12


oGood documentation - Good test covers use cases
oUnit testing framework (NUnit for ..NET, Junit for java, HttpUnit
for testing web)
oUse Mock when method touches another class

Code for future
[email protected] 13
1.Your code is used many many more times than it is written
2. Make code EASY to read , test and debug
Easy to Read
❖Reader get what code does without reading comment
❑Expressive naming
❖Comment why code does it
❖use enum
❖don't quick hack
❑insert +1 or -1 and it just works!
❖don't concern performance too much
❑<<1 instead of *2

Easy to Test
[email protected] 14


▪Quer - command separation
omake query code has no side effect
•-small class
•-one method one purpose

Easy to Debug
[email protected] 15

▪Always handle or throw all exception
oNo empty catch block
▪Provide useful error messages
oCategorize them
✔Program defects
✔Environment problems
✔User Error

Communicate agilely
[email protected] 16



1.Document that dictate all of what to do
2.Need more dynamic communication techniques
3.Complete but flexible

What is Refactoring?
[email protected] 17
oIt is a valuable weapon which benefit you to keep excellent hold
on your code & so the project (software/application).
oIt is a scientific process of taking existing code and improves it
while it makes code more readable, understandable, and clean.
oIt becomes very handy to add new features, build large
applications and spot & fix bugs.
oIt is a law of nature for fully successful iterative projects. You
don’t decide to refactor, you refactor because you want to do
something else and refactoring helps you to do that. When you
refactor existing code of a project (software/app etc) by altering
its internal structure but you are not changing its external
behavior.

What is Refactoring?
[email protected] 18

oRefactoring even take a bad design of a project and rework it into
a good one. You are not changing observable behavior of the
project you improves the internal structure by Refactoring.
oIt is a activity which is a solution to your problems, its performed
when modifying the existing code of a project to incorporate new
features or to enhance.

Types of Refactoring
[email protected] 19

Code Refactoring:

oSimply known as Refactoring, this is the refactoring of source code, it include (Rename
method, Encapsulated field, Extract class, Introduce assertion, and Pushdown method). It
changes structure of a program, but the functionality is the same.

Database Refactoring:
oA simple change to a database schema that improves its design while re-tuning both its
behavioral and into semantics such as (Rename column, Split table, Move method, Replace
LOB with table, Introduce column constraint)

User Interface Refactoring:

oA simple change to the UI retains its semantics such as (Align entry field, Apply common
button size, Apply font, Indicate format, Reword in active voice and Increase color contrast) It
delivers consistency for all users -both within your organization and your customers
organization.

Reasons why Refactoring is Important
[email protected] 20

✔To improve the design of software/application.
✔To make software easier to understand.
✔To find bugs
✔To make program run faster.
✔To fix existing legacy database
✔To support revolutionary development
✔To provide greater consistency for user.

Refactoring benefits your software to
[email protected] 21

✔Makes code more readable.
✔Cleanup code and makes it tidier.
✔Removes redundant, unused code and comments.
✔Improves performance.
✔Makes some things more generic.
✔Keeps code DRY ( Don’t Repeat Yourself)
✔Combines and dispose “Like” or “Similar” code.
✔Splitting out long functions into more manageable bite.
✔Create re-usable code.
✔Better class and function cohesion.

Refactoring Techniques
[email protected] 22

Composing Methods
Much of refactoring is devoted to correctly composing methods. In
most cases, excessively long methods are the root of all evil. The
vagaries of code inside these methods conceal the execution logic
and make the method extremely hard to understand—and even
harder to change.
The refactoring techniques in this group streamline methods, remove
code duplication, and pave the way for future improvements.

Refactoring Techniques
[email protected] 23

Moving Features between Objects
Even if you have distributed functionality among different classes in a
less-than-perfect way, there is still hope.

These refactoring techniques show how to safely move functionality
between classes, create new classes, and hide implementation
details from public access.

Refactoring Techniques
[email protected] 24

Organizing Data
These refactoring techniques help with data handling, replacing
primitives with rich class functionality. Another important result is
untangling of class associations, which makes classes more portable
and reusable.
Simplifying Conditional Expressions
Conditionals tend to get more and more complicated in their logic
over time, and there are yet more techniques to combat this as well.

Refactoring Techniques
[email protected] 25

Simplifying Method Calls
These techniques make method calls simpler and easier to
understand. This, in turn, simplifies the interfaces for interaction
between classes.
Dealing with Generalization
Abstraction has its own group of refactoring techniques, primarily
associated with moving functionality along the class inheritance
hierarchy, creating new classes and interfaces, and replacing
inheritance with delegation and vice versa.

Continuous integration
[email protected] 26

What is continuous integration?
Continuous integration is an agile and DevOps best practice of routinely
integrating code changes into the main branch of a repository, and testing
the changes, as early and often as possible. Ideally, developers will
integrate their code daily, if not multiple times a day.
Benefits of continuous integration
Investing in CI results in fast feedback on code changes. Fast as in "within
minutes" fast. A team that relies primarily on manual testing may get
feedback in a couple hours, but in reality, comprehensive test feedback
comes a day–or several days–after the code gets changed. And by that
time more changes have occurred, making bug-fixing an archeological
expedition with developers digging through several layers of code to get at
the root of the problem.

Continuous integration
[email protected] 27

What is continuous integration?
Continuous integration is an agile and DevOps best practice of routinely
integrating code changes into the main branch of a repository, and testing
the changes, as early and often as possible. Ideally, developers will
integrate their code daily, if not multiple times a day.
Benefits of continuous integration
Investing in CI results in fast feedback on code changes. Fast as in "within
minutes" fast. A team that relies primarily on manual testing may get
feedback in a couple hours, but in reality, comprehensive test feedback
comes a day–or several days–after the code gets changed. And by that
time more changes have occurred, making bug-fixing an archeological
expedition with developers digging through several layers of code to get at
the root of the problem.

Continuous integration
[email protected] 28

Protect quality with continuous builds and test automation
Continuous builds: Building the project as soon as a change is made.
Ideally, the delta between each build is a single change-set.

Test automation: Programmatic validation of the software to ensure
quality. Tests can initiate actions in the software from the UI (more
on that in a moment), or from within the backend services layer.

Testing in CI
[email protected] 29

Unit Tests
Unit tests run very close to core components in the code. They are the first
line of defense in ensuring quality.

Benefits: Easy to write, run fast, closely model the architecture of the code
base.

Drawbacks: Unit tests only validate core components of software; they
don't reflect user workflows which often involve several components
working together.

Since a unit test explains how the code should work, developers can
review unit tests to get current on that area of the code.

Testing in CI
[email protected] 30

API tests
Good software is modular, which allows for clearer separation of
work across several applications. APIs are the end points where
different modules communicate with one another, and API tests
validate them by making calls from one module to another.

Benefits: Generally easy to write, run fast, and can easily model how
applications will interact with one another.

Drawbacks: In simple areas of the code, API tests can mimic some
unit tests.

Testing in CI
[email protected] 31

Functional tests
Functional tests work over larger areas of the code base and model
user workflows. In web applications, for example, HTTPUnit and
Selenium directly interact with the user interface to test the product.

Benefits: More likely to find bugs because they mimic user actions
and test the interoperability of multiple components.

Drawbacks: Slower than unit tests, and sometimes report false
negatives because of network latency or a momentary outage
somewhere in the technology stack.

[email protected] 32

For other additional information on Agile software development
Refer to

https://www.agilealliance.org/
Tags