Sonar qube to impove code quality
Click here to load reader
-
Upload
mani-sarkar -
Category
Software
-
view
415 -
download
1
description
Transcript of Sonar qube to impove code quality
SonarQubetm
to improve code quality !
Introduction- quick show of hands about SonarQubetm (previously Sonar)- code-base in Java, maybe some Python & Javascript- Definition of code crinkliness: from the static analysis and code-coverage point of views- not an expert, still learning about SonarQube- still learning to write quality code- build this session as we go, learn and improve together- lots of room for improvement
http://bit.ly/1lk8NDW
Demo
- git logs- Sonar Dashboard widgets (for e.g. Quality metrics tab)
- show source code- show changesets and pull requests- strategy (continuously improving)
http://bit.ly/1lk8NDW
Strategy (method to madness)
- Most violated rules (Blockers, Critical, Major, Minor violations)- Unit test coverage: Emma, IntelliJ Code Coverage check- Integration test coverage- Performance / non-functional testing, GC analysis (Java/JVM platforms only, JMH benchmarking) - Package Tangle Index (complexity)- Complexity (method / function, class-level)- Apply SonarGraph
http://bit.ly/1lk8NDW
Strategy (haven’t applied, very but interesting)
- Squale - Technical Debt pyramid- LCOM- Toxicity Chart & Clouds- Apply PIT Mutation testing - Apply generative tests (QuickCheck)- Apply Mutability Detector library- Analyse using JitWatch (improve Jit compilation attempts)
http://bit.ly/1lk8NDW
Benefits- Learn Checkstyle, Findbugs & PMD rules as you go- Learn through repetition & build muscle memory- Measure the improvement (history, timeline)- Measure your progress- Build quality profiles & dashboards- Identify unused / dead code- Identify Hotspot (areas of concern, maybe ready for refactoring)- Pairing an entity that gives consistent results (when you don’t have a human-partner to pair with)- A powerful ally when tweaked and fine-tuned- A short-feedback loop
http://bit.ly/1lk8NDW
Resources● SonarQube resources● Installing SonarQube (formerly Sonar) on MacOsX Mountain Lion● Using SonarQube on MacOsX Mountain Lion● SonarGraph (http://www.hello2morrow.com/products/sonargraph)● Jitwatch: http://github.com/AdoptOpenJDK/jitwatch● Book: Sonar in Action (http://www.manning.com/papapetrou/)● QuickCheck (https://bitbucket.org/blob79/quickcheck)● PIT Mutation Testing (http://pitest.org/)● Mutability Detector (https://github.com/MutabilityDetector/)● Presentation on Sonar strategies (link to follow)
http://bit.ly/1lk8NDW
Q & A
Its your time to share your methods and help me improve my craft !
http://bit.ly/1lk8NDW
Thanks
- Chris Jeffrey, Brad & Rachel- LSCC- Socrates (UK & Germany)
http://bit.ly/1lk8NDW
Feedback
mani@theNeomatrix369
http://bit.ly/1lk8NDW