http://www.wakaleo.com john.smart@wakaleo.com Java Software Quality Tools and techniques



Similar documents
Software infrastructure for Java development projects

Upping the game. Improving your software development process

Java Power Tools. John Ferguson Smart. ULB Darmstadt 1 PI. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Software Construction

Improving Software Quality with the Continuous Integration Server Hudson. Dr. Ullrich Hafner Avaloq Evolution AG 8911

Continuous Integration Multi-Stage Builds for Quality Assurance

Continuous Delivery. Alejandro Ruiz

Build management & Continuous integration. with Maven & Hudson

Introduction to Programming Tools. Anjana & Shankar September,2010

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Nexus Professional Whitepaper. Repository Management: Stages of Adoption

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Jenkins: The Definitive Guide

SOA-14: Continuous Integration in SOA Projects Andreas Gies

TeamCity A Professional Solution for Delivering Quality Software, on Time

Leveraging Rational Team Concert's build capabilities for Continuous Integration

Continuous Integration

Maven or how to automate java builds, tests and version management with open source tools

SA4 Software Developer Survey Survey Specification v2.2

Delivering Quality Software with Continuous Integration

SMZ. SocialMedia. Z olutions

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

Continuous Integration: A case study

Software Continuous Integration & Delivery

Software Development Tools

SOFTWARE DEVELOPMENT BASICS SED

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Content. Development Tools 2(63)

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

Meister Going Beyond Maven

Open Source Tools. The Magazine for Professional Testers. December 2010

Professional Java Tools for Extreme Programming. Ant, XDoclet, JUnit, Cactus, and Maven

Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

Accelerate Software Delivery

How the Open Source tools and spirit enable better projects July 09 th 2009

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

SOA Solutions & Middleware Testing: White Paper

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited

Code Quality Assurance. Peter Kofler, Code Cop FH Technikum Wien, February 2010

Testing Tools Content (Manual with Selenium) Levels of Testing

WHITE PAPER. Getting started with Continuous Integration in software development. - Amruta Kumbhar, Madhavi Shailaja & Ravi Shankar Anupindi

Continuous Integration For Fusion Middleware

Beginners guide to continuous integration. Gilles QUERRET Riverside Software

Th3 - Open Source Tools for Test Management

GECKO Software. Introducing FACTORY SCHEMES. Adaptable software factory Patterns

Kevin Lee Technical Consultant As part of a normal software build and release process

Effective feedback from quality tools during development

We ( have extensive experience in enterprise and system architectures, system engineering, project management, and

Continuous Integration

Effektiver Tool-Einsatz

Continuous Integration

Development Testing for Agile Environments

Automating the Nengo build process

Keywords Continuous Integration, Engineering Pipeline, SonarQube, Test Orchestration.

"Build and Test in the Cloud "

QA & Test Management. Overview.

<Insert Picture Here> What's New in NetBeans IDE 7.2

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Software Development In the Cloud Cloud management and ALM

How To Write Unit Tests In A Continuous Integration

Introduction to Automated Testing

DESIGN OF AUTOMATION SCRIPTS EXECUTION APPLICATION FOR SELENIUM WEBDRIVER AND TestNG FRAMEWORK

Continuous Delivery. Ariel Alonso, IPC

Aaron Evans Software Quality Assurance, Test Automation, SDET, Web Developer

Maven the Beautiful City. Healthy, Viable, and Productive Build Infrastructures

Viewpoint. Choosing the right automation tool and framework is critical to project success. - Harsh Bajaj, Technical Test Lead ECSIVS, Infosys

Continuous Integration

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

CONTINUOUS INTEGRATION

E-vote 2011 Version: 1.0 Testing and Approval Date: 26/10/2009. E-vote SSA-U Appendix 5 Testing and Approval Project: E-vote 2011

Continuous Integration: Put it at the heart of your development

A Practical Guide to implementing Agile QA process on Scrum Projects

Continuous Prevention Testing

GLOBAL CONSULTING SERVICES TOOLS FOR WEBMETHODS Software AG. All rights reserved. For internal use only

Performance Management from black-art to process

Automated performance testing using Maven & JMeter. George Barnett, Atlassian Software

<Insert Picture Here> Introducing Hudson. Winston Prakash. Click to edit Master subtitle style

Modulo II Qualidade de Software com Maven

SOFTWARE TESTING TRAINING COURSES CONTENTS

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

Delivery. Continuous. Jez Humble and David Farley. AAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis San Francisco

Boosting Agile Methodology with webmethods BPMS

Agile ALM. Lightweight tools and Agile strategies MANNING MICHAEL HUTTERMANN. Shelter Island

Paul Barham Program Manager - Java. David Staheli (dastahel@microsoft.com) Software Development Manager - Java

LECTURES NOTES Organisational Aspects of Software Development

Automation and Virtualization, the pillars of Continuous Testing

Lab work Software Testing

Transcription:

Wakaleo Consulting O p t i m i z i n g y o u r s o f t w a r e d e v e l o p m e n t http://www.wakaleo.com john.smart@wakaleo.com Java Software Quality Tools and techniques 1

Introduction Agenda tools to improve software quality Goals of a software development team Automated Testing Continuous Integration Code Quality Metrics Technical Documentation

Introduction Goals of a software development team: Build software to a specified set of requirements: Within scope Within time Within budget

Introduction Goals of a software development team: Build the best possible application for the end user. Within time and budget constraints defined by the project sponsor.

Introduction How do we achieve this? Build higher quality software Build more flexible software Build more useful software

Introduction Traditional development processes Room for improvement? Poorly tested applications? Applications that are difficult and expensive to change? Lots of bugs at delivery time? Inconsistent coding standards and programming habits? Code that is hard to maintain and to update Technical documentation out of date?

Introduction How can we improve? Enforce good testing practices Monitor developer test quality and coverage Automate the build process Monitor and review code quality metrics Automatic technical documentation

Wakaleo Consulting O p t i m i z i n g y o u r s o f t w a r e d e v e l o p m e n t http://www.wakaleo.com john.smart@wakaleo.com Enforce Good Testing Practices 8

Good Testing Practices Several types of developer tests Unit Tests Integration Tests Graphical User Interface (Web) Tests All can be automated to varying degrees

Good Testing Practices Unit Tests A cornerstone of modern software development Unit tests can help you Ensure that code behaves as expected Make your code more flexible and easier to maintain Detect regressions Document your code

Introduction to Unit Testing Traditional developer testing Run against the entire application Unit testing Run against classes or small components Run manually in a debugger Testing is ad-hoc and not reproducible Testing needs human intervention Tests can be run automatically Tests can be reused Testing can be automated

Good Testing Practices Unit Tests The costs of writing unit tests More code to write and maintain More time required to write the code, initially...

Good Testing Practices Unit Tests The benefits of writing unit tests More reliable code with less bugs More flexible code Code that is easier to maintain Automatic regression tests

Good Testing Practices Unit Tests A good unit test should: Test individual classes or small components Test code in isolation Run quickly Leave the system in a predictable state Be reproducible Be automated

Good Testing Practices Unit Testing tools JUnit 3.x De facto standard in Java testing Well known and well used Junit 4 A newer, more modern version of JUnit TestNG A more recent and very innovative unit testing library Less widely used than JUnit

Good Testing Practices Running Unit Tests in Eclipse Test result summary The Green Bar of Success

Good Testing Practices Running Unit Tests in Eclipse Test result summary A failed test There are test failures Test failure details

Testing web applications Testing web interfaces Often neglected by developers and left to the testers Traditionally difficult to automate Involves much human judgement

Testing web applications Why automate web interface testing Automatic smoke tests Automatic regression tests

Testing web applications Web Interface Testing technologies Using Mock Objects Spring MVC, StrutsTestCase, JSFUnit Good for the controller layer Doesn't test the HTML screens themselves Writing tests to run against a web application HTTPUnit, Cactus, Jmeter, TestMaker,... Run tests from within a real web browser Selenium

Testing web applications Testing web applications with Selenium Selenium is a browser-based testing tool You can Record test scripts in a browser Replay them manually or automatically

Testing web applications Testing web applications with Selenium Replay test scripts Manage multiple test scripts Display latest test results Record test scripts Display and edit test script History of executed instructions

Testing web applications Testing web applications with Selenium

Test Coverage Test Coverage Test Coverage indicates how much application code is executed by your unit tests It is especially useful for identifying code that has not been tested.

Test Coverage Test Coverage Tools Automated Test Coverage Integrated into the build process Runs for every build Team-wide reporting Tools like Cobertura

Test Coverage Test Coverage - Cobertura A package with low test coverage

Test Coverage Test Coverage - Cobertura Untested classes Poorly tested classes

Test Coverage Test Coverage - Cobertura This code was never executed This code was executed twice

Test Coverage Test Coverage Tools Test coverage in your IDE Faster feedback for developers ECLEmma - Test Coverage in Eclipse Crap4j also provides test coverage metrics

Test Coverage EclEmma - Test Coverage in Eclipse

Good Testing practices Crap4j - Test Coverage in Eclipse

Test Coverage Why use EclEmma/Crap4j and Cobertura EclEmma and Crap4j allows IDE integration Fast feedback for the developer More convenient for the developer than using an HTML report Cobertura allows project-level coverage reporting Project-wide coverage statistics Results can be published and reviewed Can be used to enforce minimum coverage levels

Wakaleo Consulting O p t i m i z i n g y o u r s o f t w a r e d e v e l o p m e n t http://www.wakaleo.com john.smart@wakaleo.com Continuous Integration 33

Continuous Integration What is Continuous Integration? Automatically integrating and compiling source code from different developers on a central build server A core best practice of modern software development

Continuous Integration What do you need? The principal components of a Continuous Integration service: Automated Build Process eg. Ant, Maven, Makefile... Automated Test Process eg. Junit, TestNG Source Code Repository eg. CVS, Subversion, StarTeam,... A Continuous Build Tool eg. CruiseControl, Continuum, Hudson...

Continuous Integration How does it work? Detect code changes Build Test Inspect Document Deploy to integration Developer Workstation Developer Workstation Integration server Automated deployment process Continuous Build Server Code changes Version Control Server Manual deployment process Developer Workstation Test server Notifications UAT server Production server

Continuous Integration What problem does it solve? The traditional software process involves: Coding Ad-hoc testing Commit changes shortly before the start of the testing phase Difficult integration process

Continuous Integration What problem does it solve? Infrequent commits Difficult integration process Repository Lots of bugs Infrequent releases Test server Testing only at the end

Continuous Integration What problem does it solve? This is a flawed process Testing may not be done efficiently Integration is long and difficult Poor visibility on development progress Functional tests are done too late Raised issues are harder to fix The client gets a sub-optimal product

Continuous Integration How does it solve this problem? Regular Regularcommits commits Less bugs Faster fixes Repository Automatic builds Automated tests Automatic reporting Dedicated build server Regular releases Test server More regular testing Automated deployment

Continuous Integration What problem does it solve? Continuous Integration an industry best practice Smoother integration Automatic regression testing Regular working releases Earlier functional testing Faster and easier bug fixes Better visibility

Continuous Integration What tools are available Open Source tools CruiseControl, Hudson, Continuum, LuntBuild... Commercial Tools TeamCity, Bamboo, Pulse,...

Continuous Integration A Continuous Build Server - Hudson An overview of all your build jobs

Continuous Integration The Hudson Dashboard An overview of all your build jobs Build successful Build unstable Build failed Build in progress Quick status for each project

Continuous Integration The Hudson Dashboard An overview of all your build jobs Build stable Build unstable Quick status for each project

Continuous Integration The Hudson Dashboard An overview of all your build jobs Display detailed build results

Continuous Integration The Hudson Dashboard An overview of all your build jobs Real-time build progress indicators

Continuous Integration Displaying Build Results View the details of any particular build job Test Results

Continuous Integration Displaying Build Results View the details of any particular build Change history

Continuous Integration Displaying Build Results View the details of any particular build job View workspace

Continuous Integration Displaying Build Results View the details of any particular build job Build History

Continuous Integration Displaying Build Results View the details of a particular build Build History The artifact for this build The changes that caused this build

Continuous Integration Displaying Build Results View the details of a particular build in real time!

Wakaleo Consulting O p t i m i z i n g y o u r s o f t w a r e d e v e l o p m e n t http://www.wakaleo.com john.smart@wakaleo.com Code Quality 54

Code Quality Why enforce coding standards? Better quality code Code is easier to maintain Detect potential bugs Train staff

Code Quality Manual code reviews are good, but... Slow and time-consuming Tend not to be done systematically Automatic code audits Automatically enforce organisation coding standards Detect bad coding practices and potential bugs Facilitate developer training

Code Quality Quality Metrics Tools Several complementary tools Checkstyle coding standards PMD best practices FindBugs potential bugs Crap4j overly complex and poorly tested classes

Code Quality Checkstyle - Enforce coding standards Formatting and indentation Naming conventions Javadocs etc...

Code Quality Checkstyle - Enforce coding standards Eclipse plugin

Code Quality Checkstyle - Enforce coding standards Hudson reports

Code Quality Checkstyle - Enforce coding standards Maven reports

Code Quality PMD Best practices Empty try/catch/finally blocks Incorrect null pointer checks Excessive method length or complexity etc... Some overlap with Checkstyle

Code Quality PMD Best practices Eclipse plugin

Code Quality PMD Best practices Hudson reports

Code Quality PMD Best practices Maven reports

Code Quality FindBugs Potential defects Potential NullPointerExceptions Infinite loops etc...

Code Quality FindBugs Potential defects Eclipse plugin

Code Quality FindBugs Potential defects Hudson reports

Code Quality FindBugs Potential defects Maven reports

Code Quality Crap4j Complex and untested code Uses code coverage and code complexity metrics Eclipse plugin

Wakaleo Consulting O p t i m i z i n g y o u r s o f t w a r e d e v e l o p m e n t http://www.wakaleo.com john.smart@wakaleo.com Automated Documentation 71

Automated Documentation Automatically-generated documentation: Complete Always up-to-date Cheap to produce BUT Lacks higher vision

Automated Documentation Human-written documentation use a project Wiki Architecture vision High-level design Collaborative

Automated Documentation Automatically-generated UML/Javadoc UmlGraph

Automated Documentation Automatically-generated database models SchemaSpy

Conclusion Optimal development practices So how does your team measure up? Unit testing practices? Automated web testing Code Coverage Metrics Continuous Integration? Continuous Quality? Automated Technical Documentation?

To learn more... Wellington 28 April-1 May, 2008 Auckland 11-14 August, 2008

Thank you Questions?