Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example...
Transcript of Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example...
![Page 1: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/1.jpg)
Continuous Inspection
Jason Gorman
@jasongorman
![Page 2: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/2.jpg)
About Me
• Training & coaching in Test-driven Development, Refactoring, OO Design Principles & Advanced Techniques for developers
• Programming since 1982
• Founder of the original Software Craftsmanship conference
• Apprentice Will Price studying Comp Sci at Uni of Bristol
• Patron of Bletchley Park Trust
• Available for Weddings and Bar Mitzvahs
![Page 3: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/3.jpg)
The 5 C’s of Continuous Delivery
Clean Code
![Page 4: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/4.jpg)
Sustainable Pace
![Page 5: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/5.jpg)
What is Continuous Inspection?
Very frequent inspection of software to provide early warning of maintainability and other code quality issues
![Page 6: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/6.jpg)
3 Approaches to Code Inspections
![Page 7: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/7.jpg)
Code Reviews
![Page 8: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/8.jpg)
Pair Programming
![Page 9: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/9.jpg)
Automated Inspections…because an extensive code review every 10-15 minutes is robot’s work
![Page 10: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/10.jpg)
Example Automated Continuous Inspection Process
Change Code
[before check-in]
Run automated inspection
Check-in
Confirm changes
pass inspection on build server
Success
run inspections with updates from VCS
Fix code quality issues raised
If critical issues raised, build fails
![Page 11: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/11.jpg)
The Continuous Inspection Automation Process
RequirementAcceptance
Tests (examples)
Implement quality gate
Integration into
Continuous Delivery
cycle
Feedback
![Page 12: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/12.jpg)
Quality Gates
Soft Gate
• Quality issues raised do not break the build, but may prompt further review by peers
Hard Gate
• Breaks the build• Can be overridden after
team review
![Page 13: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/13.jpg)
Example Code Quality Requirement
As a developer, I need to know about any methods that have more than one dependency on features of another class so I can move them to where they belong and reduce coupling
Feature Envy
![Page 14: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/14.jpg)
Example Examples
This is feature envy
This is NOT feature envy
This is NOT feature envy
![Page 15: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/15.jpg)
Choose Your Weapon
• Cecil• Gendarme
![Page 16: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/16.jpg)
Implementing Your Quality Gate
exploratory testing team discussion
![Page 17: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/17.jpg)
Examples We Didn’t Think Of
![Page 18: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/18.jpg)
When Are We Done?
![Page 19: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/19.jpg)
Integrating Your Quality Gate
![Page 20: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/20.jpg)
Example FxCop Build Pipeline
If any tests fail, build fails
If new errors, build fails
If new warnings, build held for review
custom rule set
![Page 21: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/21.jpg)
Continuous Inspection Patterns
![Page 22: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/22.jpg)
Our House, Our Rules
Beware of reusing someone else’s ruleset
Involve all developers
![Page 23: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/23.jpg)
Code Analysis Code Is Code
Apply the same care to the analysis code and Continuous Inspection “plumbing” that you apply to production code
![Page 24: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/24.jpg)
Differential Inspections
Apply Continuous Inspection to new/changed code
![Page 25: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/25.jpg)
Clean Code Check-in
Run code rules against changes before committing them
![Page 26: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/26.jpg)
Call To Action
Report problems that developers know how to fix
![Page 27: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/27.jpg)
Rising Tide
On legacy code, fail builds if quality gets worse. Raise the bar if quality improves.
![Page 28: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/28.jpg)
Adopt By Stealth
Be ready to run before making it visible
![Page 29: Continuous Inspection - codemanshipcodemanship.co.uk/files/ContinuousInspection.pdf · Example Automated Continuous Inspection Process Change Code [before check-in] Run automated](https://reader034.fdocuments.us/reader034/viewer/2022050501/5f93d295a1c10d3ed34c6b1c/html5/thumbnails/29.jpg)
www.codemanship.com