Easing the pain of legacy tests
description
Transcript of Easing the pain of legacy tests
![Page 1: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/1.jpg)
Chris GeorgeWebsite: www.mostly-testing.co.uk
@ChrisG0911
Easing the pain of legacy tests
![Page 2: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/2.jpg)
![Page 3: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/3.jpg)
Once upon a time…
![Page 4: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/4.jpg)
Flagship product
Over 250,000 lines of code
Over 10,000 automated tests
Tests run in virtual machines
Multiple SQL Server versions
Continuous Integration
![Page 5: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/5.jpg)
The real story…
![Page 6: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/6.jpg)
Many attempts to fix over the years
== rising complexity== increasing instability
![Page 7: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/7.jpg)
Myths, Preconceptions and Folklore
![Page 8: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/8.jpg)
Don’t jump into the code…
![Page 9: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/9.jpg)
Start with quick wins
![Page 10: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/10.jpg)
Tests should clear up after themselves…
![Page 11: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/11.jpg)
Exponential comparison…
# objects # Comparisons Approx time10 100 1 second100 10,000 1.7 mins1000 1,000,000 2.7 hours!
![Page 12: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/12.jpg)
By the end of the week -
By the end of week 2 - only 1 failure!
95% passing
![Page 13: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/13.jpg)
Discuss the problem/failure
Pattern #1
![Page 14: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/14.jpg)
Pair & Review
Pattern #2
![Page 15: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/15.jpg)
Pattern #3
Find and fix the quick wins
![Page 16: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/16.jpg)
Pattern #4
De-mystify
![Page 17: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/17.jpg)
Make best use of the skills on your team
Treat test code the same as product code
Don’t believe everything you hear
Most problems are not hard
Lessons learnt
![Page 18: Easing the pain of legacy tests](https://reader036.fdocuments.in/reader036/viewer/2022062305/5681613a550346895dd099e7/html5/thumbnails/18.jpg)
</talk>Any Questions?
Chris GeorgeWebsite: www.mostly-testing.co.uk
@ChrisG0911