Вы находитесь на странице: 1из 46

Quality

Titel Assurance
Onderwerp
JTech / Juan Pablo de Castro / Java Developer
20/03/2019
Verantwoordelijke afdeing, personen.
Datum
Introduction

 Senior Java Developer (10+ years experience)


 Worked on a large scale of projects
- Frontend & Backend
 Current Client (De Nederlandse Bank DNB)
 Hobby’s
- Play Games, Watch Movies/Series, Walks, etc..
 Father of two

2
Overview & Objective

 What is Quality Assurance (QA)?


 Maven plugin support for QA
 Sonarqube
 QA best practices

3
What is Quality Assurance?
What is Quality Assurance?

 Software quality assurance (SQA) consists of a


means of monitoring the software engineering
processes and methods used to ensure quality. The
methods by which this is accomplished are many and
varied, and may include ensuring conformance to one
or more standards, such as ISO 9000 - Wikipedia

5
Maven plugin support for QA
Maven plugin support

 JaCoCo
 Checkstyle
 PMD
 Findbugs/Spotbugs

7
JaCoCo
Maven plugin support

JaCoCo

 Main focus: Provide code coverage analysis for JVM


based environments
 Features
- Support for different JVM languages
- Supports several report formats (HTML, XML, CSV)
- Supports different build tools: Maven, Ant, Gradle

9
Maven plugin support

JaCoCo – versions

10
Maven plugin support

JaCoCo – usage

11
Maven plugin support

JaCoCo – usage

[ERROR] Failed to execute goal org.jacoco:jacoco-


maven-plugin:0.7.7.201606060606:check
(jacoco-check) on project myapp: Coverage
checks have not been met.

12
Maven plugin support

JaCoCo – reports

13
Maven plugin support

JaCoCo – reports

14
Maven plugin support

JaCoCo – documentation

15
Checkstyle
Maven plugin support

Checkstyle

 Primary goal is to enforce code conventions


 Features:
- Can find code layout & formatting issues
- http://checkstyle.sourceforge.net/checks.html
 Predefined rules available
- Sun code conventions: sun_checks.xml (default)
- Google Java Style: google_checks.xml

17
Maven plugin support

Checkstyle - versions

18
Maven plugin support

Checkstyle - usage

Maven checkstyle plugin v3.0.0


comes with default checkstyle
version 6.18, but can be modified
to the latest version 8.18

19
Maven plugin support

Checkstyle - usage

20
Maven plugin support

Checkstyle - documentation

21
PMD
Maven plugin support

PMD

 Primary goal is to find common programming flaws


- Dead code: Unused variables, parameters, private methods
- Unnecessary object creation
- Complex classes/methods
 Comes with a rich set of rules that are configurable
 Comes with CPD (Copy-Paste detector)
 Supports 6 other languages (Ecma Script, XML, XSL..)

23
Maven plugin support

PMD - versions

24
Maven plugin support

PMD - usage

25
Maven plugin support

PMD - documentation

26
Findbugs/Spotbugs
Maven plugin support

Findbugs/Spotbugs

 Focus lies in detecting potential bugs and/or


performance issues
 Helps teams avoid shipping avoidable issues in code
 Stimulates teams to write better code from the start
 The current version reports 400 warnings in nine
categories (Correctness, Dodgy code, Performance,
Security, etc.)

28
Maven plugin support

Findbugs/Spotbugs - versions

29
Maven plugin support

Findbugs/Spotbugs - versions

30
Maven plugin support

Findbugs/Spotbugs - usage

31
Maven plugin support

Findbugs/Spotbugs - documentation

32
Sonarqube
Sonarqube

Features

 Continuous Inspection
- Display overall health, leaks, quality gates, visualize history
 Detect tricky issues
- Detect bugs, code smells, security vulnerabilities
 Multi-Language support (25+ languages)
 DevOps Integration (CI engines, Pass/Fail, Promotion)
 Centralize Quality (Show all projects, shared rulesets..)

34
Sonarqube

Dashboards – All Projects

35
Sonarqube

Dashboards – Project specific

36
Sonarqube

Code Analysis

37
Sonarqube

Quality Gates

38
Sonarqube

Line Coverage Trends

39
Sonarqube

Plans & Pricing

40
Sonarqube

Versions – Community Edition

41
Sonarqube

Versions – LTS

42
Sonarqube

 There is even a cloud solution for public repos


- https://sonarcloud.io

43
QA best practices
QA best practices

 Follow a coding style guide


 Give descriptive names for methods & variables
 Do not overdesign
 Do not reinvent a wheel, use third-party frameworks
 Create Unit tests
 Make use of tooling to automate the process of QA

45
Thank you for your
attention!

46

Вам также может понравиться