RKCP Information Technology




JUnit
Home » Courses   » JUnit

Ant

jUnit Testing training teaches its participants unit testing, JUnit framework and how to set it up and use it with Java projects.

Overview

This training of JUnit provides an introduction to Java's most-popular automated unit testing framework.

Participants will learn about the unit testing JUnit framework and how to set it up and use it with Java projects. Participants will also be familiar with the test-driven development as a methodology of writing highly reliable Java code.


Objective

At the end of this JUnit testing training, the participants will be able to:

  • Know JUnit's role in Java testing
  • Setup, integrate, and start using JUnit
  • Learn the differences between JUnit 3 and JUnit 4
  • Design, organize, and develop JUnit tests in either syntax of JUnit 3 or JUnit 4.
  • Learn to use best practices in both testing and software development
  • Start improving the quality and effectiveness of their software and tests

Preferred Audience:

Java developers, quality-assurance engineers, and development managers.

Total Duration - 1 Day


Prerequisites

Great understanding of Java technology is needed to get the full benefit of this course. Prior experience in testing concepts (e.g. unit, integration, functional, load) is recommended.


Syllabus

Expand All
  • 1. On Testing
    • Why testing?
    • Test, Test, and Test Some More
    • Overview of JUnit's role in testing (automated, unit, isolated, etc.)
  • 2. Introducing JUnit
    • JUnit 101
    • JUnit 3 vs. JUnit 4 vs. TestNG
    • Getting started
    • Use of JUnit within Eclipse
    • Test methods: testMethod or @Test method
    • Assertions in TestCase
    • Testing for exceptions
    • Testing isolations
    • Creating and organizing test fixtures with setUp/tearDown and @Before/@After
    • 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)
  • 3.Why JUnit?
    • Testing using JUnit - Advantages
    • Testing using JUnit - Disadvantages
    • Exercise - Testing Simple Data Structures
  • 4. JUnit Extensions
    • Overview of JUnit Extensions: dbUnit, sqlUnit, httpUnit, htmlUnit, EasyMock, xmlUnit, etc.
    • Testing with Stubs
    • Testing with Mocks using EasyMock
  • 5. Test-Driven Development
    • Best Practices with JUnit and TDD
    • Designing Java code with testing in mind
    • Integration and functional testing with JUnit
    • Exercise - Testing Complex Data Structures