Test Driven Development (TDD) in Java - Unit Testing and Refactoring
This course presents a number of modern practices for developing code based on an iterative and incremental development lifecycle. Agility and predictability are two qualities often missing from software development. A test-driven approach, in which design is grown and code delivered incrementally according to functionality or risk, forms the basis of the construction phase of an iterative and incremental development.
Book your virtual training
- Date
- Venue
- Cost
- More info
- Date and time to suit you
- VenueWe will train your team
wherever they are based - CostContact us for price
- Fill in the form and we'll be in touch
within a working day.
The use of unit testing provides confidence in existing code and supports the ability to refactor code as development unfolds.The course is intended as a practical course: the best way to appreciate how test-driven development works and what it feels like is to do it in practice, making sense of the principles it embodies. In this form the course is based on lecture material, demonstration, discussion and hands-on labs.
The course is suitable for software developers experienced in Java and familiar with objectoriented principles and practices.
- Appreciate the benefits of a continuous and iterative approach to design and delivery
- Recognise the purpose and practice of refactoring in keeping a system supple and adaptable
- Know how to build up a set of unit tests in JUnit
- Understand the consequences of dependency management on testing and code quality
TDD and Agility offer a wealth of benefits to your organisation, it can cut development costs for example. Shorten the development Time to Market and increase the programmer’s productivity. As well as encouraging the writing of quality code.
TDD has many benefits but it can be hard to learn alone. This course will help you write effective, organized and neat code that works. It will teach you how to shorten the development feedback time and provide proof that your software code works as intended.
- Traditional versus agile development processes
- Iterative and incremental development
- Informal and continuous design
- The role of refactoring
- Refactoring versus other code changes
- Extreme Programming
- Test-Driven Development
- Traditional view and reality of testing
- Driving development through testing
- Testing early, often and automatically
- Testing versus debugging
- White-box versus black-box testing
- Functional versus operational testing
- Test plans versus test code
- Use of Assert
- Testing at the interface
- Testing the simplest things first
- Testing incrementally
- Testing correctness of failure
- JUnit and the xUnit family
- Test cases, test suites and test runners
- Essential structure of the framework
- Assertion methods
- Testing correctness of exceptions
- Defining common fixture code
- JUnit pattern usage
- Extensions to JUnit
- Red, green, refactor
- None to one to many
- Faking it
- Telling the truth
- Isolated and short tests
- Refactor common fixture code
- Declare, prepare, assert
- Test by method, state or scenario
- Custom assertions
- Compile-time constraints
- Running all tests
- Renaming variables, methods, classes and packages
- Restructuring class hierarchies by extracting interfaces, superclasses and subclasses
- Partitioning classes by extracting classes and methods
- Changing private representation
- Unmanaged dependencies
- Test-driven decoupling
- Layering
- Reorganising packages
- Eliminating cyclic dependencies
- Mock objects
- Eliminating Singletons, statics and other globals
- Testing I/O
Any previous exposure to JUnit or agile development concepts is beneficial but not essential.