Test driven development (TDD) which is also known as test first programming or test infected programming refers to the practice of software developers where they write code test cases before the actual application code is written. This practice enhances the code and design quality of the software, reduces bugs and improves the overall software development efficiency.
JUnit is a Java library that facilitates TDD in Java. It is the de facto standard. It has many extensions and has also been ported to many different programming languages. This training program focuses on TDD with JUnit
At the end of the training, participants will be able to
- Describe the benefits of test driven development and practice the same.
- Design, organize and develop good unit tests with JUnit.
- Use JUnit 3 and 4 syntax to code JUnit test cases.
- Use JUnit with different development environments (Eclipse, Ant, Maven).
- Follow best practices in using JUnit to improve the development efficiency and software quality.
- Java developers
- You should be familiar with Java programming language. Expert knowledge is not needed.
Kamal Wickramanayake (Profile)
Introduction to Test Driven Development
- What is test driven development (or test infected programming)?
- What is unit testing?
- Comparing unit testing and debugging
- Who should write these tests?
- Qualities expected from a regression testing framework
Introduction to JUnit
- Possible code testing mechanisms
- JUnit as a regression testing framework for Java
- How to represent a test in JUnit?
- TestCase class and different assertions
- Running a test
- Using different source directories for tests and application code
- Implementing multiple tests within a TestCase
- Test fixture
- Test code skeleton auto generation
Special Test Scenarios
- Testing for exceptions
- Difference between errors and failures
- Testing code that spawns new threads
- Issues with singletons
Development Environments, Test Runners and Reports
- Using JUnit with Eclipse, Ant and Maven
- Generating test reports (XML, HTML)
JUnit Best Practices
- Garbage collection of tests and working with large code bases
- Bug fixing assisted by unit tests
- Code refactoring assisted by unit tests
- Improving class modularity and testability
- What to test and what not to test?
- Overview of some other useful JUnit extensions
- What is in-container testing?
- Costs Vs benefits of writing unit tests