Java Unit Testing

Course

Online

Price on request

Description

  • Type

    Course

  • Methodology

    Online

The course provides a thorough introduction to the JUnit testing framework. It covers the concepts underlying unit testing, and the way these concepts are realised in the JUnit framework.

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

Subjects

  • Testing
  • IT
  • Java

Course programme

Overview of JUnit

  • Basic concepts
  • JUnit 3 vs. JUnit 4 vs. TestNG
  • Starting with JUnit
  • Using JUnit within Eclipse
  • Structuring Unit Tests
  • Using JUnit Asserts
  • JUnit Test Composition
  • Custom Asserts in JUnit
  • JUnit Exceptions and exception testing
  • Naming
  • The JUnit Test Skeleton

What to test for - Right BICEP

  • Right results
  • Boundary Conditions - CORRECT
    • Conformance
    • Ordering
    • Range
    • Reference
    • Existence
    • Cardinality
    • Time
  • Inverse Relationships - checking for
  • Cross checking
  • Error conditions - forcing of
  • Preformance characteristics - met

Structuring tests, automating tests, reporting results

  • Composing Test Cases into Test Suites
  • Combining Test Suites
  • Organizing Tests and Test Suites
  • Executing Tests
  • Showing Test Results
  • Integration with Ant
  • Reporting (XML and HTML)

JUnit Extensions

  • Overview of JUnit Extensions: dbUnit, sqlUnit, httpUnit, htmlUnit, EasyMock, xmlUnit, etc.
  • Testing with Stubs
  • Mock Objects
  • Testing a Servlet
  • Testing with Mocks using EasyMock

Test-Driven Development (TDD)

  • Best Practices with JUnit and TDD
  • Designing Java code with testing in mind
  • Integration and functional testing using JUnit

Characteristics of Good Tests

  • Automatic
  • Thorough
  • Repeatable
  • Independent
  • Professional
  • Quality controlling tests

Testing and Design

  • Designing for testability
  • Refactoring for Testing
  • Defining and verifying Class Invariants
  • Test Driven Design Strategies
  • Testing for Invalid Parameters

Testing and Project Planning and Management

  • Where to place the test code
  • Testing etiquette
  • Frequency of testing
  • Testing when working with legacy code
  • Testing and Code Reviews

Java Unit Testing

Price on request