About this course
This course teaches Java developers how to build reliable software using automated testing and test-driven development (TDD). Participants learn how to write unit and integration tests with JUnit, isolate components using Mockito, and automate browser testing with Selenium. The course covers practical techniques and tools for improving code quality, maintainability and test coverage in modern Java applications.Intended audience
The Automated Testing for Java Developers course is useful if:- You are a programmer or developer and you need to understand, use and write automated tests.
- You are an analyst or system architect and you need to understand test-driven development.
- You are a project or programme manager, and you need to improve the code quality through automated testing and test-driven development development.
Prerequisites
You must already be comfortable with the fundamentals of the Java language, or have attended our Java Programming course.
Course details
Price: R6,900 excluding VAT per delegate.
Included:
- Electronic course material.
- Attendance certificate (PDF).
Duration: 2 days.
Delivery: Virtual classroom
See how virtual training works.
Note: this course is presented on request only.
See the course schedule for upcoming dates.
Booking information
Email your booking to info@incusdata.com. A purchase order, or completed enrolment form is sufficient.
We will confirm the booking and issue an invoice.
Course contents
Overview of Automated Testing
- Types of testing: unit, integration, functional and system testing.
- The role of automated testing in modern software development.
- Benefits of unit testing and automated tests.
- Characteristics of effective unit tests.
- Planning and structuring unit tests.
- Continuous testing and integration.
JUnit Fundamentals
- JUnit framework overview.
- JUnit 5 architecture and key components.
- Creating and running JUnit tests.
- Assertions and test results.
- Test lifecycle and fixtures.
- Basic annotations: @Test, @BeforeEach, @AfterEach, @BeforeAll, @AfterAll, @Disabled.
- Organising and structuring test classes.
Developing JUnit Tests
- Writing clear and maintainable test methods.
- Testing exceptions and error conditions.
- Parameterized tests.
- Test organisation and naming conventions.
- Using assertion libraries such as Hamcrest or AssertJ.
- Running tests using IDEs and build tools.
Mocking and Test Isolation
- Why mocking is used in automated testing.
- Test doubles: dummy objects, fakes, stubs and mocks.
- Testing classes in isolation.
- Using Mockito to create mock objects.
- Stubbing behaviour and verifying interactions.
Test-Driven Development
- Principles of test-driven development (TDD).
- The red-green-refactor cycle.
- Designing testable code.
- Refactoring safely with automated tests.
Automated Web Testing with Selenium
- Selenium WebDriver architecture.
- Writing Selenium tests in Java.
- Browser automation and navigation.
- Locating and interacting with web page elements.
- Waiting strategies and handling dynamic pages.
- Running Selenium tests and analysing results.
Testing in the Development Lifecycle
- Integrating tests with build tools.
- Continuous integration and automated test execution.
- Improving test coverage and reliability.
- Maintaining automated test suites.