SlideShare a Scribd company logo
Implementing Quality
on Java projects

Vincent Massol
Committer XWiki
XWiki SAS
!

@vmassol
27 au 29 mars 2013
Vincent Massol

• Speaker Bio	

•

CTO XWiki SAS	


•
•

XWiki (community-driven open source project)	

Past: Maven, Apache Cargo, Apache Cactus, Pattern Testing	


•
•
•

LesCastCodeurs podcast	

Creator of OSSGTP open source group in Paris	

3 books: JUnit in Action, Maven: A Developer’s Notebook, BBWM	


• Your Projects	


• Other Credentials:
What is Quality?
The XWiki project in summary
•
•
•
•
•
•
•

9 years old	

28 active
committers	

7 committers
do 80% of
work	

700K NCLOC	

11 commits/day	

16 mails/day	

65% TPC
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)
Quality Tip #1
!

API Stability

27 au 29 mars 2013
The Problem

Class Not Found or Method Not
Found
API Stability - Deprecations
/**!
* ...!
* @deprecated since 2.4M1 use {@link #transform(!
*
Block, TransformationContext)}!
*/!
@Deprecated!
void transform(XDOM dom, Syntax syntax)!
throws TransformationException;!
!
!
API Stability - CLIRR (1/2)
<plugin>!
<groupId>org.codehaus.mojo</groupId>!
<artifactId>clirr-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>!
...
API Stability - CLIRR (2/2)

Example from XWiki 5.0M1 Release notes
API Stability - Internal Package
Javadoc
<plugin>!
<groupId>org.apache.maven.plugins</groupId>!
<artifactId>maven-javadoc-plugin!
<configuration>!
<excludePackageNames>*.internal.*!
</excludePackageNames>

CLIRR
<plugin>!
<groupId>org.codehaus.mojo</groupId>!
<artifactId>clirr-maven-plugin</artifactId>!
<excludes>!
<exclude>**/internal/**</exclude>!
<exclude>**/test/**</exclude>
API Stability - Legacy Module
Aspect Weaving
<plugin>!
<groupId>org.codehaus.mojo</groupId>!
<artifactId>aspectj-maven-plugin</...>!
...!
<configuration>!
<weaveDependencies>!
<weaveDependency>!
<groupId>org.xwiki.rendering</...>!
<artifactId>xwiki-rendering-api</...>!
...

+ “Legacy” Profile
API Stability - Young APIs
/**!
* ...!
* @since 5.0M1!
*/!
@Unstable(<optional explanation>)!
public EntityReference createEntityReference(String name,...)!
{!
...!
}

+ max duration for keeping the annotation!
API Stability - Next steps

• Annotation or package for SPI?	

• Better define when to use the @Unstable annotation	

• Not possible to add a new method to an existing Interface	

•

Java 8 and Virtual Extension/Defender methods

interface TestInterface {!
  public void testMe();!
  public void newMethod() default {!
    System.out.println("Default from interface");!
  }!
}
Quality Tip #2
!

JAR Hell

27 au 29 mars 2013
The Problem

Class Not Found or Method Not
Found or not working feature
No duplicate classes @ runtime
<plugin>!
<groupId>com.ning.maven.plugins</groupId>!
<artifactId>maven-duplicate-finder-plugin</artifactId>!
<executions>!
<execution>!
<phase>verify</phase>!
<goals>!
<goal>check</goal>!
</goals>!
<configuration>!
<failBuildInCaseOfConflict>true</...>!
<exceptions>!
...
Surprising results...

• Commons Beanutils bundles some classes from Commons Collections,
•
•
•

apparently to avoid drawing a dependency to it...	

Xalan bundles a lot of other projects (org/apache/xml/**, org/apache/
bcel/**, JLex/**, java_cup/**, org/apache/regexp/**). In addition, it even
has these jars in its source tree without any indication about their
versions...	

stax-api, geronimo-stax-api_1.0_spec and xml-apis all draw
javax.xml.stream.* classes	

xmlbeans and xml-apis draw incompatible versions of org.w3c.dom.*
classes

14 exceptions in total!
Maven: dependency version issue
<dependencies>!
<dependency>!
Will run logback 0.9.9
<groupId>org.slf4j</groupId>!
with slf4J-api 1.4.0
instead of 1.5.0!
<artifactId>slf4j-api</artifactId>!
<version>1.4.0</version>!
</dependency>!
<dependency>!
<groupId>ch.qos.logback</groupId>!
<artifactId>logback-classic</artifactId>!
<version>0.9.9</version>!
<!-- Depends on org.slf4j:slf4j-api:1.5.0 -->!
</dependency>!
</dependencies>
Maven: ensure correct version
<plugin>!
<groupId>org.apache.maven.plugins</groupId>!
<artifactId>maven-enforcer-plugin</artifactId>!
<executions>!
<execution>!
<id>enforce-version-compatibility</id>!
<phase>verify</phase>!
<goals>!
<goal>enforce</goal>!
</goals>!
<configuration>!
<rules>!
<requireUpperBoundDeps/>!
</rules>
Quality Tip #3
!

Test Coverage

27 au 29 mars 2013
The Problem

More bugs reported, overall quality
goes down and harder to debug
software
Use Jacoco to fail the build
<plugin>!
<groupId>org.jacoco</groupId>!
<artifactId>jacoco-maven-plugin</artifactId>!
<executions>!
<execution><id>jacoco-prepare</id>!
<goals><goal>prepare-agent</goal></goals>!
</execution>!
<execution><id>jacoco-check</id>!
<goals><goal>check</goal></goals>!
</execution>!
</executions>!
<configuration>!
<check>!
<instructionRatio>${xwiki.jacoco.instructionRatio}</...>!
</check>}
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
Quizz Time!
Step 1: Building on my local machine gives the following:
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:check (jacoco-check)
[INFO] All coverage checks have been met.

Step 2: Building on the CI machine gave:
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:check (jacoco-check) !
[WARNING] Insufficient code coverage for INSTRUCTION: 75.52% < 75.53%

Non determinism! Why?
Quizz Answer
... because the JVM is non deterministic!
private Map componentEntries = new ConcurrentHashMap();!
...!
for (Map.Entry entry : componentEntries.entrySet())!
{!
if (entry.getValue().instance == component) {!
 
key = entry.getKey();!
    oldDescriptor = entry.getValue().descriptor;!
    break;!
  }!
}
Quality Tip #4
!

Functional Testing Stability
(with Jenkins)

27 au 29 mars 2013
The Problem

Too many false positives leading to
developers not paying attention to CI
emails anymore... leading to failing
software
False positives examples

• The JVM has crashed	

• VNC is down (we run Selenium tests)	

• Browser crash (we run Selenium tests)	

• Git connection issue	

• Machine slowness (if XWiki cannot start under 2 minutes then it
•
•

means the machine has some problems)	

Nexus is down (we deploy our artifacts to a Nexus repository)	

Connection issue (Read time out)
Step 1: Groovy PostBuild Plugin (1/2)
def messages = [!
[".*A fatal error has been detected by the Java Runtime Environment.*",!
"JVM Crash", "A JVM crash happened!"],!
[".*Error: cannot open display: :1.0.*",!
"VNC not running", "VNC connection issue!"],!
...!
]

def shouldSendEmail = true!
messages.each { message ->!
if (manager.logContains(message.get(0))) {!
manager.addWarningBadge(message.get(1))!
manager.createSummary("warning.gif").appendText(...)!
manager.buildUnstable()!
shouldSendEmail = false!
}!
}
Step 1: Groovy PostBuild Plugin (2/2)

... continued from previous slide...!
!

if (!shouldSendEmail) {!
def pa = new ParametersAction([!
new BooleanParameterValue("noEmail", true)!
])!
manager.build.addAction(pa)!
}
Step 2: Mail Ext Plugin
Pre-send Script
import hudson.model.*!
!

build.actions.each { action ->!
if (action instanceof ParametersAction) {!
if (action.getParameter("noEmail")) {!
cancel = true!
}!
}!
}
Results

+ use the Scriptler plugin to automate configuration for all jobs
Quality Tip #5
!

Bug Fixing Day

27 au 29 mars 2013
The Problem
Bugs increasing, even simple to fix	

ones, devs focusing too much on new
features (i.e. scope creep) vs fixing
what exists

Bugs created vs closed
Bug Fixing Day

• 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 then with last 547 days
and currently with last 1500 days (we need to
catch up with 22 bugs!)	

Today is BFD#40 (and I’m missing it!)
Results (1/2)

As many bugs closed over past 4 years than created!
Results (2/2)
Conclusion

27 au 29 mars 2013
Parting words

• 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”
Be proud of your Quality!
“I have offended God and
mankind because my work didn't
reach the quality it should have.”
Leonardo da Vinci, on his death bed

More Related Content

What's hot

Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and AndroidTomáš Kypta
 
Quality of Bug Reports in Open Source
Quality of Bug Reports in Open SourceQuality of Bug Reports in Open Source
Quality of Bug Reports in Open SourceThomas Zimmermann
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Alan Richardson
 
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Paco van Beckhoven
 
Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Alan Richardson
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven developmentStephen Fuqua
 
DotNet unit testing training
DotNet unit testing trainingDotNet unit testing training
DotNet unit testing trainingTom Tang
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyAlexandr Skachkov
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsClare Macrae
 
Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021Paco van Beckhoven
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep DiveAlan Richardson
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JSMichael Haberman
 
Using java8 for unit testing while being backward compatible
Using java8 for unit testing while being backward compatibleUsing java8 for unit testing while being backward compatible
Using java8 for unit testing while being backward compatibleNikola Petrov
 
Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"Fwdays
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with SiestaGrgur Grisogono
 

What's hot (20)

Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)
 
Unit testing and Android
Unit testing and AndroidUnit testing and Android
Unit testing and Android
 
Quality of Bug Reports in Open Source
Quality of Bug Reports in Open SourceQuality of Bug Reports in Open Source
Quality of Bug Reports in Open Source
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014
 
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
 
Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven development
 
DotNet unit testing training
DotNet unit testing trainingDotNet unit testing training
DotNet unit testing training
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 Proxy
 
Testacular
TestacularTestacular
Testacular
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
 
Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep Dive
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Using java8 for unit testing while being backward compatible
Using java8 for unit testing while being backward compatibleUsing java8 for unit testing while being backward compatible
Using java8 for unit testing while being backward compatible
 
Test Dependencies and the Future of Build Acceleration
Test Dependencies and the Future of Build AccelerationTest Dependencies and the Future of Build Acceleration
Test Dependencies and the Future of Build Acceleration
 
Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta
 

Viewers also liked

A Skills-based Approach to OpenVMS Modernization
A Skills-based Approach to OpenVMS ModernizationA Skills-based Approach to OpenVMS Modernization
A Skills-based Approach to OpenVMS Modernizationecubemarketing
 
10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Development10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Developmentecubemarketing
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkinsecubemarketing
 
NXTware remote for open vms introduction
NXTware remote for open vms introductionNXTware remote for open vms introduction
NXTware remote for open vms introductionecubemarketing
 
Why NXTware Remote for Jenkins
Why NXTware Remote for JenkinsWhy NXTware Remote for Jenkins
Why NXTware Remote for Jenkinsecubemarketing
 
Nxtware remote skills_slides
Nxtware remote skills_slidesNxtware remote skills_slides
Nxtware remote skills_slidesecubemarketing
 
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...ecubemarketing
 

Viewers also liked (9)

A Skills-based Approach to OpenVMS Modernization
A Skills-based Approach to OpenVMS ModernizationA Skills-based Approach to OpenVMS Modernization
A Skills-based Approach to OpenVMS Modernization
 
10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Development10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Development
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 
NXTware remote for open vms introduction
NXTware remote for open vms introductionNXTware remote for open vms introduction
NXTware remote for open vms introduction
 
OpenVMS Today
OpenVMS TodayOpenVMS Today
OpenVMS Today
 
Why NXTware Remote for Jenkins
Why NXTware Remote for JenkinsWhy NXTware Remote for Jenkins
Why NXTware Remote for Jenkins
 
Nxtware remote skills_slides
Nxtware remote skills_slidesNxtware remote skills_slides
Nxtware remote skills_slides
 
Veggie market rei
Veggie market reiVeggie market rei
Veggie market rei
 
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...
Middleware Migration Case Study: Moving from RISC Unix and Entera to Linux an...
 

Similar to Implementing Quality on a Java Project

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projectsVincent Massol
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projectsVincent Massol
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsLuís Bastião Silva
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 
Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Yves Hoppe
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Vincent Massol
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projectsVincent Massol
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewSteve Lange
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)Thierry Gayet
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applicationsBabak Naffas
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeAleksandar Bozinovski
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialAnup Singh
 
Building unit tests correctly with visual studio 2013
Building unit tests correctly with visual studio 2013Building unit tests correctly with visual studio 2013
Building unit tests correctly with visual studio 2013Dror Helper
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!Ortus Solutions, Corp
 

Similar to Implementing Quality on a Java Project (20)

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Building XWiki
Building XWikiBuilding XWiki
Building XWiki
 
Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)Implementing Quality on Java projects (Short version)
Implementing Quality on Java projects (Short version)
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projects
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
 
Advanced Java Testing
Advanced Java TestingAdvanced Java Testing
Advanced Java Testing
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applications
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable Code
 
Unit Tests with Microsoft Fakes
Unit Tests with Microsoft FakesUnit Tests with Microsoft Fakes
Unit Tests with Microsoft Fakes
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
 
Building unit tests correctly with visual studio 2013
Building unit tests correctly with visual studio 2013Building unit tests correctly with visual studio 2013
Building unit tests correctly with visual studio 2013
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
 

More from Vincent Massol

XWiki Testing with TestContainers
XWiki Testing with TestContainersXWiki Testing with TestContainers
XWiki Testing with TestContainersVincent Massol
 
XWiki: The best wiki for developers
XWiki: The best wiki for developersXWiki: The best wiki for developers
XWiki: The best wiki for developersVincent Massol
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Vincent Massol
 
Configuration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersConfiguration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersVincent Massol
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projectsVincent Massol
 
What's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xWhat's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xVincent Massol
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality DashboardVincent Massol
 
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointVincent Massol
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality DashboardVincent Massol
 
XWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeXWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeVincent Massol
 
Leading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectLeading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectVincent Massol
 
XWiki Status - July 2015
XWiki Status - July 2015XWiki Status - July 2015
XWiki Status - July 2015Vincent Massol
 
XWiki SAS development practices
XWiki SAS development practicesXWiki SAS development practices
XWiki SAS development practicesVincent Massol
 
XWiki SAS: An open source company
XWiki SAS: An open source companyXWiki SAS: An open source company
XWiki SAS: An open source companyVincent Massol
 
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014Vincent Massol
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014Vincent Massol
 
Combining open source ethics with private interests
Combining open source ethics with private interestsCombining open source ethics with private interests
Combining open source ethics with private interestsVincent Massol
 
Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Vincent Massol
 

More from Vincent Massol (20)

XWiki Testing with TestContainers
XWiki Testing with TestContainersXWiki Testing with TestContainers
XWiki Testing with TestContainers
 
XWiki: The best wiki for developers
XWiki: The best wiki for developersXWiki: The best wiki for developers
XWiki: The best wiki for developers
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019
 
Configuration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainersConfiguration Testing with Docker & TestContainers
Configuration Testing with Docker & TestContainers
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
What's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.xWhat's new in XWiki 9.x and 10.x
What's new in XWiki 9.x and 10.x
 
QDashboard 1.2
QDashboard 1.2QDashboard 1.2
QDashboard 1.2
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality Dashboard
 
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
 
Creating your own project's Quality Dashboard
Creating your own project's Quality DashboardCreating your own project's Quality Dashboard
Creating your own project's Quality Dashboard
 
XWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army KnifeXWiki: The web's Swiss Army Knife
XWiki: The web's Swiss Army Knife
 
Leading a Community-Driven Open Source Project
Leading a Community-Driven Open Source ProjectLeading a Community-Driven Open Source Project
Leading a Community-Driven Open Source Project
 
Developing XWiki
Developing XWikiDeveloping XWiki
Developing XWiki
 
XWiki Status - July 2015
XWiki Status - July 2015XWiki Status - July 2015
XWiki Status - July 2015
 
XWiki SAS development practices
XWiki SAS development practicesXWiki SAS development practices
XWiki SAS development practices
 
XWiki SAS: An open source company
XWiki SAS: An open source companyXWiki SAS: An open source company
XWiki SAS: An open source company
 
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
XWiki: A web dev runtime for writing web apps @ FOSDEM 2014
 
XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014XWiki Rendering @ FOSDEM 2014
XWiki Rendering @ FOSDEM 2014
 
Combining open source ethics with private interests
Combining open source ethics with private interestsCombining open source ethics with private interests
Combining open source ethics with private interests
 
Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013Evolutions XWiki 2012/2013
Evolutions XWiki 2012/2013
 

Recently uploaded

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 

Recently uploaded (20)

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 

Implementing Quality on a Java Project

  • 1. Implementing Quality on Java projects Vincent Massol Committer XWiki XWiki SAS ! @vmassol 27 au 29 mars 2013
  • 2. Vincent Massol • Speaker Bio • CTO XWiki SAS • • XWiki (community-driven open source project) Past: Maven, Apache Cargo, Apache Cactus, Pattern Testing • • • LesCastCodeurs podcast Creator of OSSGTP open source group in Paris 3 books: JUnit in Action, Maven: A Developer’s Notebook, BBWM • Your Projects • Other Credentials:
  • 4. The XWiki project in summary • • • • • • • 9 years old 28 active committers 7 committers do 80% of work 700K NCLOC 11 commits/day 16 mails/day 65% TPC
  • 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 27 au 29 mars 2013
  • 7. The Problem Class Not Found or Method Not Found
  • 8. API Stability - Deprecations /**! * ...! * @deprecated since 2.4M1 use {@link #transform(! * Block, TransformationContext)}! */! @Deprecated! void transform(XDOM dom, Syntax syntax)! throws TransformationException;! ! !
  • 9. API Stability - CLIRR (1/2) <plugin>! <groupId>org.codehaus.mojo</groupId>! <artifactId>clirr-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>! ...
  • 10. API Stability - CLIRR (2/2) Example from XWiki 5.0M1 Release notes
  • 11. API Stability - Internal Package Javadoc <plugin>! <groupId>org.apache.maven.plugins</groupId>! <artifactId>maven-javadoc-plugin! <configuration>! <excludePackageNames>*.internal.*! </excludePackageNames> CLIRR <plugin>! <groupId>org.codehaus.mojo</groupId>! <artifactId>clirr-maven-plugin</artifactId>! <excludes>! <exclude>**/internal/**</exclude>! <exclude>**/test/**</exclude>
  • 12. API Stability - Legacy Module Aspect Weaving <plugin>! <groupId>org.codehaus.mojo</groupId>! <artifactId>aspectj-maven-plugin</...>! ...! <configuration>! <weaveDependencies>! <weaveDependency>! <groupId>org.xwiki.rendering</...>! <artifactId>xwiki-rendering-api</...>! ... + “Legacy” Profile
  • 13. API Stability - Young APIs /**! * ...! * @since 5.0M1! */! @Unstable(<optional explanation>)! public EntityReference createEntityReference(String name,...)! {! ...! } + max duration for keeping the annotation!
  • 14. API Stability - Next steps • Annotation or package for SPI? • Better define when to use the @Unstable annotation • Not possible to add a new method to an existing Interface • Java 8 and Virtual Extension/Defender methods interface TestInterface {!   public void testMe();!   public void newMethod() default {!     System.out.println("Default from interface");!   }! }
  • 15. Quality Tip #2 ! JAR Hell 27 au 29 mars 2013
  • 16. The Problem Class Not Found or Method Not Found or not working feature
  • 17. No duplicate classes @ runtime <plugin>! <groupId>com.ning.maven.plugins</groupId>! <artifactId>maven-duplicate-finder-plugin</artifactId>! <executions>! <execution>! <phase>verify</phase>! <goals>! <goal>check</goal>! </goals>! <configuration>! <failBuildInCaseOfConflict>true</...>! <exceptions>! ...
  • 18. Surprising results... • Commons Beanutils bundles some classes from Commons Collections, • • • apparently to avoid drawing a dependency to it... Xalan bundles a lot of other projects (org/apache/xml/**, org/apache/ bcel/**, JLex/**, java_cup/**, org/apache/regexp/**). In addition, it even has these jars in its source tree without any indication about their versions... stax-api, geronimo-stax-api_1.0_spec and xml-apis all draw javax.xml.stream.* classes xmlbeans and xml-apis draw incompatible versions of org.w3c.dom.* classes 14 exceptions in total!
  • 19. Maven: dependency version issue <dependencies>! <dependency>! Will run logback 0.9.9 <groupId>org.slf4j</groupId>! with slf4J-api 1.4.0 instead of 1.5.0! <artifactId>slf4j-api</artifactId>! <version>1.4.0</version>! </dependency>! <dependency>! <groupId>ch.qos.logback</groupId>! <artifactId>logback-classic</artifactId>! <version>0.9.9</version>! <!-- Depends on org.slf4j:slf4j-api:1.5.0 -->! </dependency>! </dependencies>
  • 20. Maven: ensure correct version <plugin>! <groupId>org.apache.maven.plugins</groupId>! <artifactId>maven-enforcer-plugin</artifactId>! <executions>! <execution>! <id>enforce-version-compatibility</id>! <phase>verify</phase>! <goals>! <goal>enforce</goal>! </goals>! <configuration>! <rules>! <requireUpperBoundDeps/>! </rules>
  • 21. Quality Tip #3 ! Test Coverage 27 au 29 mars 2013
  • 22. The Problem More bugs reported, overall quality goes down and harder to debug software
  • 23. Use Jacoco to fail the build <plugin>! <groupId>org.jacoco</groupId>! <artifactId>jacoco-maven-plugin</artifactId>! <executions>! <execution><id>jacoco-prepare</id>! <goals><goal>prepare-agent</goal></goals>! </execution>! <execution><id>jacoco-check</id>! <goals><goal>check</goal></goals>! </execution>! </executions>! <configuration>! <check>! <instructionRatio>${xwiki.jacoco.instructionRatio}</...>! </check>}
  • 24. 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
  • 25. Quizz Time! Step 1: Building on my local machine gives the following: [INFO] --- jacoco-maven-plugin:0.6.2.201302030002:check (jacoco-check) [INFO] All coverage checks have been met. Step 2: Building on the CI machine gave: [INFO] --- jacoco-maven-plugin:0.6.2.201302030002:check (jacoco-check) ! [WARNING] Insufficient code coverage for INSTRUCTION: 75.52% < 75.53% Non determinism! Why?
  • 26. Quizz Answer ... because the JVM is non deterministic! private Map componentEntries = new ConcurrentHashMap();! ...! for (Map.Entry entry : componentEntries.entrySet())! {! if (entry.getValue().instance == component) {!   key = entry.getKey();!     oldDescriptor = entry.getValue().descriptor;!     break;!   }! }
  • 27. Quality Tip #4 ! Functional Testing Stability (with Jenkins) 27 au 29 mars 2013
  • 28. The Problem Too many false positives leading to developers not paying attention to CI emails anymore... leading to failing software
  • 29. False positives examples • The JVM has crashed • VNC is down (we run Selenium tests) • Browser crash (we run Selenium tests) • Git connection issue • Machine slowness (if XWiki cannot start under 2 minutes then it • • means the machine has some problems) Nexus is down (we deploy our artifacts to a Nexus repository) Connection issue (Read time out)
  • 30. Step 1: Groovy PostBuild Plugin (1/2) def messages = [! [".*A fatal error has been detected by the Java Runtime Environment.*",! "JVM Crash", "A JVM crash happened!"],! [".*Error: cannot open display: :1.0.*",! "VNC not running", "VNC connection issue!"],! ...! ]
 def shouldSendEmail = true! messages.each { message ->! if (manager.logContains(message.get(0))) {! manager.addWarningBadge(message.get(1))! manager.createSummary("warning.gif").appendText(...)! manager.buildUnstable()! shouldSendEmail = false! }! }
  • 31. Step 1: Groovy PostBuild Plugin (2/2) ... continued from previous slide...! ! if (!shouldSendEmail) {! def pa = new ParametersAction([! new BooleanParameterValue("noEmail", true)! ])! manager.build.addAction(pa)! }
  • 32. Step 2: Mail Ext Plugin Pre-send Script import hudson.model.*! ! build.actions.each { action ->! if (action instanceof ParametersAction) {! if (action.getParameter("noEmail")) {! cancel = true! }! }! }
  • 33. Results + use the Scriptler plugin to automate configuration for all jobs
  • 34. Quality Tip #5 ! Bug Fixing Day 27 au 29 mars 2013
  • 35. The Problem Bugs increasing, even simple to fix ones, devs focusing too much on new features (i.e. scope creep) vs fixing what exists Bugs created vs closed
  • 36. Bug Fixing Day • 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 then with last 547 days and currently with last 1500 days (we need to catch up with 22 bugs!) Today is BFD#40 (and I’m missing it!)
  • 37. Results (1/2) As many bugs closed over past 4 years than created!
  • 39. Conclusion 27 au 29 mars 2013
  • 40. Parting words • 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”
  • 41. Be proud of your Quality! “I have offended God and mankind because my work didn't reach the quality it should have.” Leonardo da Vinci, on his death bed