migration and testing (evo 2008)
DESCRIPTION
I used this set of slides for a lecture I gave at the University of Bern on Dec 4, 2008.TRANSCRIPT
![Page 1: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/1.jpg)
Testing and Migration
Tudor Gîrbawww.tudorgirba.com
![Page 2: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/2.jpg)
restructuring
reve
rse
engin
eerin
gforward engineering
}
{
}
{
}
{
}
{}
{
}
{
}
{}
{
}
{
![Page 3: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/3.jpg)
restructuring }
{
}
{
}
{
}
{}
{
}
{
}
{}
{
}
{
![Page 4: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/4.jpg)
Testing and Migration
![Page 5: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/5.jpg)
Why test?
![Page 6: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/6.jpg)
![Page 7: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/7.jpg)
Many legacy systems don’t have tests
![Page 8: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/8.jpg)
Many legacy systems don’t have tests
Customers pay for features, not tests
![Page 9: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/9.jpg)
Many legacy systems don’t have tests
Customers pay for features, not tests
You can’t test everything anyway
![Page 10: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/10.jpg)
Many legacy systems don’t have tests
Customers pay for features, not tests
You can’t test everything anyway
Testing is akin to street-cleaning
![Page 11: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/11.jpg)
Many legacy systems don’t have tests
Customers pay for features, not tests
You can’t test everything anyway
Testing is akin to street-cleaning
Real programmers don’t need tests
![Page 12: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/12.jpg)
Write tests to enable evolution
![Page 13: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/13.jpg)
setUp
assert
tearDown
Use a testing framework
![Page 14: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/14.jpg)
Grow your test base incrementally
![Page 15: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/15.jpg)
Test the interface, not the implementation
![Page 16: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/16.jpg)
Record business rules as tests
![Page 17: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/17.jpg)
Write tests to understand
![Page 18: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/18.jpg)
setUp
assert
tearDown
Use a testing framework
![Page 19: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/19.jpg)
setUp
assert
tearDown
But, legacy is difficult to set up
![Page 20: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/20.jpg)
aModel aClass
add(aClass)
aStorage
store(aClass)
setModel(aModel)
![Page 21: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/21.jpg)
Ducasse etal 2006
aModel aClass
add(aClass)
aStorage
store(aClass)
setModel(aModel)
![Page 22: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/22.jpg)
Testing and Migration
![Page 23: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/23.jpg)
Migration is a restructuring thatchanges the underlying infrastructure
![Page 24: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/24.jpg)
1989
![Page 25: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/25.jpg)
![Page 26: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/26.jpg)
Big-bang migration often fails
![Page 27: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/27.jpg)
Big-bang migration often fails
Users hate change
![Page 28: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/28.jpg)
Big-bang migration often fails
Users hate change
You need constant feedback to stay on track
![Page 29: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/29.jpg)
Big-bang migration often fails
Users hate change
You need constant feedback to stay on track
Users just want to get their work done
![Page 30: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/30.jpg)
Big-bang migration often fails
Users hate change
You need constant feedback to stay on track
Users just want to get their work done
The legacy data must be available during the transition
![Page 31: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/31.jpg)
Involve the users
![Page 32: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/32.jpg)
Build confidence
![Page 33: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/33.jpg)
Conserve familiarity
![Page 34: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/34.jpg)
Migrateincrementally
![Page 35: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/35.jpg)
Prototype the target solution
![Page 36: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/36.jpg)
![Page 37: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/37.jpg)
![Page 38: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/38.jpg)
Throw-away vs. evolutionary prototypes
![Page 39: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/39.jpg)
Always have a running version
![Page 40: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/40.jpg)
Test after every change
![Page 41: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/41.jpg)
Use the profiler before optimizing
![Page 42: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/42.jpg)
Data needs to be preserved and available
![Page 43: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/43.jpg)
:Legacy System
:Legacy Storage
![Page 44: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/44.jpg)
:Legacy System :New System
:Legacy Storage :New Storage
![Page 45: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/45.jpg)
:Legacy System :New System
:Legacy Storage :New Storage
:Bridge
![Page 46: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/46.jpg)
:Legacy System :New System
:Legacy Storage :New Storage
:Bridge
![Page 47: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/47.jpg)
:Legacy System :New System
:Legacy Storage :New Storage
:Bridge
Make a bridge to the new town
![Page 48: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/48.jpg)
Present the right interface
![Page 49: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/49.jpg)
Public vs. published interface
![Page 50: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/50.jpg)
Componentservice()
![Page 51: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/51.jpg)
Componentservice()replacingService()
![Page 52: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/52.jpg)
Componentservice()replacingService()
Deprecate obsolete interfaces
![Page 53: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/53.jpg)
Componentservice()replacingService()
Deprecate obsolete interfaces
![Page 54: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/54.jpg)
Component replacingService()
![Page 55: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/55.jpg)
Componentservice()replacingService()
Is it a breaking or non-breaking change?
![Page 56: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/56.jpg)
Dig, Johnson 2006
Componentservice()replacingService()
80% of breaking API changes are due to refactorings
![Page 57: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/57.jpg)
Client, v1
Component, v1
![Page 58: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/58.jpg)
storechanges
Client, v1
Component, v1 Component, v2
![Page 59: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/59.jpg)
Dig etal 2007
storechanges
replaychanges
Client, v1
Component, v1 Component, v2
Client, v2
Denker etal 2007
![Page 60: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/60.jpg)
Don’t jump.Walk with little tested steps
![Page 61: Migration and Testing (EVO 2008)](https://reader034.vdocuments.us/reader034/viewer/2022052601/559499dc1a28abfe1e8b47e3/html5/thumbnails/61.jpg)
Tudor Gîrbawww.tudorgirba.com
creativecommons.org/licenses/by/3.0/