Test-Driven Development

TDD Agile

The course has a good balance of interactive lectures and hands–on exercises. The attendees are expected to pair–up and work on the lab exercises. The instructor will assist the attendees as they work on the exercises. The objective of the course is for the attendees to gain an in depth practical knowledge of the concepts so they can put them to immediate use on real projects.

INTENDED AUDIENCE

Programmers interested in honing their practical skills on test driving design, unit testing, behavior driven design, refactoring, effective mocking, and continuous integration.

PRE-REQUISITES

Good working knowledge of programming in one or more languages like Java, C#, Ruby, etc. The labs are focused on the concepts and can be worked on in most modern languages which have a reasonable unit testing tool.

TOPICS

Influence of TDD on Agility and sustainability

  • Reasons to do TDD
  • Cost of doing it
  • Cost of not doing it
  • Software systems, design, complexity, and how to cope
  • Importance of Automated tests
  • The two benefits of TDD rapid feedback and design influence
  • What's really needed to be effective at TDD?
  • Exercises

Test Driving your Design

  • Types of Tests: White box and black box testing
  • Type of unit tests – positive, negative, and exception tests
  • Performance tests
  • What is really a unit of code?
  • How to test drive a unit of code?
  • What is not unit testing?
  • Programming by Intention
  • Simple code that works
  • How to evolve design through unit tests?
  • Practices for Unit Testing
  • Tenets of Unit Testing
  • Detailed example of building a small App test driven
  • When to write unit tests?
  • When not to write unit tests?
  • TDD Patterns and test qualities
  • Exercises

Mocking Out Dependencies

  • What makes TDD hard?
  • How to deal with dependencies?
  • First, knock out before you mock out
  • What is a Mock object?
  • What is not a mock?
  • Common pitfalls programmers run into when using mocks
  • How to create mock objects?
  • Hand tossing mocks
  • Using a mocking framework
  • Exercises

Test Driving Code for Thread Safety

  • Challenges with Multithreaded code
  • Is it a lost cause?
  • Designing multithreaded code using test cases
  • Removing impediments and avoiding design pitfalls
  • Lets test drive a multithreaded code
  • Exercises

Functional Testing

  • Functional vs. Unit Testing
  • Automation tests and feedback loops
  • Reasons to do functional testing
  • Fit and FitNesse
  • Exercises

Behavior Driven Design

  • What is BDD?
  • Relationship between TDD and BDD
  • Tools for BDD
  • Tools for different languages
  • Driving UI automation tests
  • Exercises

Measuring Code Quality

  • Code quality metrics
  • Tools to measure code quality
  • Code Coverage
  • Detecting code duplication and design smells
  • Exercises

Refactoring your code

  • What is refactoring?
  • Why refactor?
  • What's needed for refactoring?
  • What to refactor?
  • Reconcile differences
  • Specific Refactoring recommendations
  • Method level, class level, data layer, abstraction
  • Tools that help with refactoring
  • Exercise

Continuous Integration

  • Why unit test?
  • What's hard about it?
  • What tests to run and how often?
  • Integrate early and frequently
  • Tools for Continuous Integration
  • Code Coverage and other metrics measurements
  • Exercises

Agile Design

  • Measuring Quality of an Abstraction
  • Coupling, Cohesion
  • Law of Demeter
  • Characteristics of a Poor design
  • Characteristics of a Good design
  • Fundamental and essential design principles
  • Exercise

The course ends with a 4–hours hands–on workshop that allows the attendees to take a problem and go through 30–minutes iterations of evolving the design. This workshop is intended to help the attendees learn the benefits of TDD and evolutionary design.

Computer Setup:

If you bring your own laptop, please have the following installed:

  • TortoiseSVN
  • Visual Studio
  • IntelliJ IDEA (Community Edition)

Tid

09:00 - 16:15

Emner

Influence of TDD on Agility and sustainability

Test Driving your Design

Mocking Out Dependencies

Test Driving Code for Thread Safety

Functional Testing

Behavior Driven Desig

Measuring Code Quality

Refactoring your code

Continuous Integration

Agile Design