Why Code Quality Matters
• Your code is your asset
• Increase
robustness, maintainability, security, performance, scal
ability, extensibility, etc.
• Keeps your cost down as you grow
Prevention is the best medicine!
3
Challenges with Code Quality
• Often talked about in theory but not actually practiced
• Hard to measure or prove
• Difficult to plan and prioritize
4
Sonar – Quality Management Platform
http://www.sonarsource.org/
• Open source and extensible
• Manages code quality with
• Views of all projects at a glace, drill down to source
code, differential, hotspots
• Coding Rules
• Unit Tests
• Standard Metrics
• Time Machine
• Integration with tools such as
PMD, Findbugs, Checkstyle, JSLint, Clover, Cobetura, Huds
on (many plugins available)
7
Static Code Analysis (SCA)
• Applies rules to find potential bugs, anti-patterns, and
code style violations
• Catches problems as early as possible in the
development process
• A well-established industry practice for validating the
quality of source code
• Can be automated and tracked by tools like Sonar
14
SCA – Blackboard Learn Supporting Process
Developer check-in
1. Run Blackboard’s custom pre-commit Sonar analysis
tool against files in changelists
2. Review results
• Fix blocker/critical violations
• Use granular suppression and document detailed reason for
no-fix
3. Repeat until at a minimum all Blocker/Critical
violations are addressed
16
SCA – Blackboard Learn Supporting Process
Nightly automation process
1. Execute Sonar analysis
2. Send violation email to the responsible engineers
3. Report all violations to engineering managers
4. Open JIRA tickets as necessary
17
SCA – Go check it out!
• Sonar
http://www.sonarsource.org/
• Blackboard LearnTM custom PMD rules and Sonar Java
profile
http://tinyurl.com/bbquality
19
Code Quality for the Community
• A resource to assist Building BlockTM developers in
avoiding common performance, security and other
pitfalls.
• Product Development and Business Development
working together
• Will be built as a new section on edugarage.
• Self-service
• Tool recommendations
20
Code Quality Community Resources
• Custom Rule Sets
• Wiki
• Sample Code
• Recommended Tools
• Coming Soon:
• Plan to add an Anti-Pattern Repository
• Some method of allowing Community members to submit
anti-patterns back to Blackboard.
21
How Can I Help?
• Add your anti-patterns
• Add your lessons learned
• Add your system tuning tweaks
• Add your optimized sample code
• Join TechBUG and present your Code Quality
modifications and gotchas to your peers.
• Let us know what other areas you see that improvement
needs to be made
23