Bredex GmbH Logo
Skip navigation
  • Home
  • Current...
    • News
    • Blog
    • Events
      • Event list
      • Eclipse get-together
    • Publications
  • Company
    • History
    • Philosophy
    • Management
    • Customers
    • Partners
  • Services
    • Project-managment
    • Competence
      • Analysis
      • Architecture
      • Design
      • Impementation
      • Quality assurance
      • Aftercare
    • Project & Practice
  • GUIdancer / Jubula
    • Features & Benefits
      • Motivation
      • Benefits
      • Product information
      • Features
    • GUIdancer Shop
    • License & support prices
    • Questions & Support
    • Training & Consulting
    • FAQ
    • GUIdancer Demos
  • Seminars
    • Combined Seminars
    • Program
    • Information
      • Arrival & Accommodation
      • In-house training
      • Entry Conditions
      • Inquiry Form
      • Participants
  • Career
    • Company activities
    • Join the team
    • Student opportunities
      • Thesis topics
      • Student bursary
    • Apprenticeships
  • Contact
 
  • DE
  • EN

Current...

Skip navigation
  • News
  • Blog
  • Events
  • Publications
 

Tags

Top 10 Tags

  • Eclipse
  • Jubula
  • Software testing
  • GUIdancer
  • Eclipse Testing Day
  • automated tests
  • Jubula Tutorial
  • Eclipse Demo Camp
  • Eclipse Con
  • Release

All Tags (140)

  • acceptance test criteria
  • agile
  • Agile Acceptance Testing Days
  • agile process
  • agile team
  • Agile Testing Day
  • AJAX
  • ANT SignJar-task
  • Apache POI project
  • Applications that start other applications
  • ASQF
  • ASQF special interest group
  • AUT Configurations
  • automated acceptance testing
  • automated functional testing
  • Automated GUI Tests in functional levels
  • automated tests
  • avoide errors
  • Beta Version
  • better quality code
  • BIRT Report
  • brand JARs
  • Bugzilla
  • CeBIT
  • code coverage
  • Code obfuscation
  • component recognition
  • continuous integration process
  • CR+LF
  • Creating GUIdancer reports by command line
  • database
  • Data integrity
  • dealing with occasional dialogs
  • discover errors in the most important scenarios
  • driver-role
  • Eclipse
  • Eclipse-Plug-in Test Suite
  • Eclipse Community Awards
  • Eclipse Con
  • Eclipse Con Europe
  • Eclipse Demo Camp
  • Eclipse for Testers
  • Eclipse Indigo
  • Eclipse Packaging Project
  • Eclipse Stammtisch
  • Eclipse Testing Day
  • Errors
  • Event Handling
  • events
  • Excel
  • FloatBarrier
  • floating objects
  • Fokus!MBT
  • formula
  • formula evaluator
  • free open-source library
  • future day
  • Girls’ Day
  • GUIdancer
  • GUI library
  • integrity of the internal structure
  • JAR-signing
  • java
  • java beans
  • JAX
  • JDK jarsigner
  • Jubula
  • Jubula demonstration
  • Jubula Functional Testing Tool
  • Jubula Programming Competition
  • Jubula Tutorial
  • LATEX
  • LF
  • Linked External Resouces
  • manual testing
  • Metrics
  • Microsoft Office documents
  • ModelBus
  • Modelling
  • Mylyn
  • naming conventions
  • navigator-role
  • nightly automated acceptance tests
  • observation mode
  • organize yourself
  • pair programming
  • placeins
  • POI
  • QDox
  • RAP
  • readability
  • reasons
  • Recalculation
  • refactor
  • regression test
  • Release
  • Requirements to Test Cases
  • reusability
  • reuse Test Cases
  • searching for errors
  • Software testing
  • sprint
  • SQL
  • Standalone Application
  • stand up meeting
  • stories
  • story board
  • story points
  • Successful testing
  • Switching between applications
  • Take our Children to Work
  • Task List-View
  • Task Repositories-View
  • Tasks
  • team
  • Test automation
  • Test design
  • Test Executor
  • Testing Confessions
  • Testing interactively
  • Testing in unattended builds via autrun
  • testing solution
  • Test Job
  • test maintenance
  • Test results
  • Test Suite
  • Test Suite Browser
  • Test variables
  • The BOF
  • Trac
  • training
  • Tutorial for Usability in Eclipse Applications
  • unit testing
  • UX-Testing
  • VBA-Script
  • Version
  • web testing
  • Window Working Sets
  • working alone
  • Zukunftstag

Blog-Archiv

  • 2012 (11 entries)
  • 2011 (34 entries)
  • 2010 (19 entries)
  • 2009 (2 entries)
News

BREDEX GmbH at Eurostar 2012

15.05.2012 16:01

BREDEX GmbH will be presenting a talk at the 20th Eurostar Testing Conference from 5th-8th November 2012 in Amsterdam.

Eurostar Conference: 5th - 8th November 2012

Read more … BREDEX GmbH at Eurostar 2012

Register now for the Braunschweig Demo Camp

09.05.2012 10:20

The Eclipse Demo Camp in Braunschweig will take place on 28th June starting at 5pm.

Eventbrite - Eclipse Juno Demo Camp Braunschweig

Read more … Register now for the Braunschweig Demo Camp

Eclipse Strategic Member
You are here: Bredex GmbH » Current... » Blog » Blog Article

Blog Article

Automated testing topics : Code Coverage monitoring for automated tests

06.02.2012 13:24 by Alexandra Schladebeck

Recently, I wrote a first blog entry in a new series of “automated testing topics” on using BIRT reports in GUIdancer. In this entry I’m going to continue, as promised, with the sometimes rather tricky aspect of code coverage.

Identifying coverage and risk

I’m sure that we’re not the only team who, once having established a good base of automated regression tests, wanted to know something about their effectiveness. How much do they cover? Where are our risks? Do new tests actually test new areas of the software? How does our safety net look when more code / more tests are added?

It seemed like a fair assumption that the simplest way of getting this kind of information automatically would be to add code coverage monitoring to our tests. As it seemed like something that could interest other Jubula / GUIdancer users, we also added it to the tool, and about a year ago, it became a standard feature of GUIdancer.

Using the JaCoCo integration in GUIdancer

The code coverage feature in GUIdancer uses JaCoCo (a Java Code Coverage library available under the Eclipse Public License). Code coverage monitoring can be added to an Application Under Test (AUT) in the AUT Configuration dialog for Swing and RCP AUTs.

AUT Configuration for code coverage

Once code coverage has been activated, a few extra settings should be defined to declare:

  1. the installation directory for the AUT,
  2. the place where the source code for the AUT is (so that the code coverage report can be viewed line-for-line)
  3. a package pattern so that only your own code (and not every single library you use) is monitored

Once that’s done, you can run your test and get a nice shiny code coverage value and report that can be viewed in the Reporting Perspective:

Code coverage report for a test run

The philosophical part…

So now you’ve got your report. It’s got some green lines, some red lines and some numbers. And if you’re in a similar situation to our team, you quickly have someone asking about these numbers and wanting to know what they mean. (I’m going to try not to joke about managers in *every* blog entry, but I think we all know who will be asking these kinds of questions Wink).

One of the first things I read about code coverage was this blog entry. Having now had some experience in various projects, it has become my favorite way of explaining to customers that the numbers gathered by code coverage are not the aim of the exercise. The absolute values delivered by a monitoring report can’t be used as a guide to quality, nor should they be formulated as an aim for the team.

It’s not about the absolute numbers

What code coverage numbers or percentages tell us is only what lines, methods, classes or decisions have been executed. It tells us nothing about whether they were executed correctly, or whether the test that caused these things to be executed was a good one. It can be far too easy to attach too much importance to a simple number removed from its context – and this can drive the wrong kind of behavior in our processes.

So what is it good for?

It’s nice to have nice shiny percentages for code coverage, but it’s not the absolute values of the individual percentages that we should be looking at. Instead, there are two other things we should be looking at.

The trend of the lines

The first thing of interest is to move away from individual numbers and look at the trend, most especially the development over time of amount of tests : code coverage : amount of code. The graph generated by GUIdancer shows the first two numbers as lines over time. The report below shows how code coverage can increase with the addition of tests.

Progression of code coverage and expected test steps

Using graphs such as this, we can see whether a new test added increases the coverage or not. If so, then if we assume no large additions or subtractions from the amount of code, we can reason that the test has executed other lines than executed by previous tests. If the code coverage value does not increase, it could mean that new code has been added, thus reducing the overall percent of the code coverage. Looking at the detailed report would tell us whether new code was executed or not (more on this in the next section). Even if the amount of code had remained the same, and therefore new lines of code weren't actually executed, that doesn't necessarily mean that the new test isn’t performing an important use case or workflow through the application, just that the lines executed have remained the same.

What is being missed

Another use of code coverage over and above isolated values is the ability to look at what is not being tested. Don’t look at the green; look at the red. The red areas tell us what parts of the software we’re missing. We can look at e.g. class or method names and decide whether we can design tests that should cover these areas.

Detailed code coverage analysis

When a new test is added we can check whether it covers the areas we thought it would. Instead of just looking at a simple number, we should look at the details.

New questions

As it turns out, the questions about effectiveness and risk can’t really be answered by code coverage. What it can answer though, is "where are we not performing any testing?", "where are we performing too little testing?" and "what effects have my last changes (more/less code, more/less tests) had on the trend?". Based on the answers to these questions, we can design new tests. Code coverage can certainly help us to get better quality software, but perhaps not in the way that is often imagined.

Stay tuned…

The next blog entry in this series will be on Mylyn Integration for task-based working to reduce the amount of context-switching we have to do when automating tests. Until then, happy testing!

  • code coverage
  • Eclipse
  • GUIdancer
  • Jubula
  • Test automation

Go back

Site notice | Sitemap
© 2012 BREDEX GmbH