Your SlideShare is downloading. ×
Implementing Quality on Java projects (Short version)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Implementing Quality on Java projects (Short version)

242
views

Published on

Gives 3 hands on tips on how to improve a specific aspect of Quality on Java projects

Gives 3 hands on tips on how to improve a specific aspect of Quality on Java projects

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
242
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Implementing Quality in Java
  • 2. Vincent Massol ● Speaker Bio ● CTO XWiki SAS ● Your Projects ● XWiki (community-driven open source project) ● Past: Maven, Apache Cargo, Apache Cactus, Pattern Testing ● Other Credentials: ● LesCastCodeurs podcast ● Creator of OSSGTP open source group in Paris ● 3 books: JUnit in Action, Maven: A Developer’s Notebook, BBWM
  • 3. What is quality ?
  • 4. The XWiki project
  • 5. Examples of Quality actions ● Coding rules (Checkstyle, ...) ● Test coverage ● Track bugs ● Don’t use Commons Lang 2.x ● Use SLF4J and don’t draw Log4J/JCL in dependencies ● Automated build ● Automated unit tests ● Stable automated functional tests ● Ensure API stability ● Code reviews ● License header checks ● Release with Java 6 ● Ensure javadoc exist ● Prevent JAR hell ● Release often (every 2 weeks) ● Collaborative design ● Test on supported environments (DB & Browsers)
  • 6. Quality Tip #1 API Stability
  • 7. Using CLIRR <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>clirr-maven-pluginclirr-maven-plugin</artifactId> <configuration> <ignored> <difference> <differenceType>7006</differenceType> <className>org/xwiki/.../MetaDataBlock</className> <method>org.xwiki....block.Block clone()</method> <to>org.xwiki.rendering.block.MetaDataBlock</to> <justification>XDOM#clone() doesn't clone the meta data</justification> </difference> ...
  • 8. CLIRR Report
  • 9. Internal Package + AspectJ
  • 10. Quality Tip #2 Test Coverage
  • 11. Test Coverage Strategy ● When devs add code (and thus tests), increase the TPC percentage ● Put the Jacoco check in “Quality” Maven Profile ● Have a CI job to execute that profile regularly ● About 15% overhead compared to build without checks ● “Cheat mode”: Add easier-to-write test
  • 12. Use Jacoco to fail the build <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-pluginjacoco-maven-plugin</artifactId> <executions> <execution><id>jacoco-prepare</id> <goals><goal>prepare-agentprepare-agent</goal></goals> </execution> <execution><id>jacoco-check</id> <goals><goal>checkcheck</goal></goals> </execution> </executions> <configuration> <check> <instructionRatio>${xwiki.jacoco.instructionRatio}${xwiki.jacoco.instructionRatio}</...> </check>}
  • 13. Quality Tip #3 Bug Fixing Day
  • 14. BFD Strategy ● Every Thursday ● Goal is to close the max number of bugs ● Triaging:Can be closed with Won’t fix, Duplicate, Cannot Reproduce, etc ● Close low hanging fruits in priority ● Started with last 365 days and currently with last 1500 days (we need to catch up with 80 bugs!)
  • 15. Results
  • 16. Conclusion ● Slowly add new quality check over time ● Everyone must be on board ● Favor Active Quality (i.e. make the build fail) over Passive checks ● Be ready to adapt/remove checks if found not useful enough ● Quality brings some risks: ● Potentially less committers for your project (especially open source) ● Project seen as “less fun”
  • 17. Be proud of your Quality ! “I have offended God and mankind because my work didn't reach the quality it should have.” Leonardo daVinci, on his death bed