You are on page 1of 16

UNIT 5

DEVELOPING
9 Practices under Developing

1. Incremental Requirements
2. Customer Test
3. TDD
4. Refactoring
5. Simple Design
6. Incremental Design
7. Spike Solution
8. Performance Optimization
9. Exploratory testing
1.Incremental Requirement

Work Incrementally-parallel working

Rough Expectation

Customer review

Living req documents

Questions:
Our customers don’t know what the team should build. What
1.

should we do?
What if the customer review finds too many problems for us to
2.

deal with?
2.Customer Test


Focus on business rules-3 D’s – Describe demonstrate Develop

Ask customer to lead
Questions:
1. When do programmers run the customer test?
2. should we expand the customer tests when we think of a new scenario?
3. What about acceptance testing?
3.TDD


Why TDD Works?-T C R

How to Use TDD?
 Step 1: Think
 Step 2: Red Bar
 Step 3: Green Bar
 Step 4: Refactor

Testing tools- Junit for Java , Nunit for .Net

Perform unit test, Integration test and End-to-End test –UI,
Bussiness layer & DB
TDD Cont....

Questions:
1) what do I need to test when using TDD?
2) How do I test private methods?
A. Refactor your code – Move private method into their own class and
provide interface
“Replace method with method object”
TDD Example
Code for checking password that should be between 5-
10 characters
No need of an instance just call isValid() method
Output: Test passed
Refactor the code
4.Refactoring

Refactoring is the process of changing the design of code without


changing its behavior
Reflective Design- CODE SMELLS
Divergent Change and Shot Gun Surgery
Data Class and WannaBee Static Class
Coddling Nulls-Fail Fast Strategy
Time Dependencies and Half baked Object
Analyzing Existing Code
How to Refactor
Questions:
1.)How often should we refactor?

2) Isn’t refactoring rework? Shouldn’t we design


our code correctly from the beginning?
Refactoring Example in eclipse
5. Simple Design

According to kent Beck simple design is a code that passes its test and
meet 4 guidelines:

1) The system must communicate everything you want to communicate.


2) The system must contain no duplicate code.
3) The system should have the fewest possible classes.
4) The system should have the fewest possible methods.
Simple Design

YAGNI
Once and only once
Self-Documenting code – Maintain simplicity in design
 Isolate third party components
Questions :
What if we know we are going to need a feature? Should we put in a
design hook ?
What if ignoring a feature will make it harder to implement in the future?
THANK ‘U’

You might also like