Test-Driven Development: Extensive Tutorial
Free

Test-Driven Development: Extensive Tutorial

By Grzegorz Gałęzowski
Free
Book Description

 

This ebook is an open-source extensive tutorial on Test-Driven Development.

Purchase options at Leanpub.

Table of Contents
  • Front Matter
    • Dedications
    • Thanks!
  • Part 1: Just the basics
    • Motivation – the first step to learning TDD
      • Let’s get it started!
    • The essential tools
      • Test framework
      • Mocking framework
      • Anonymous values generator
      • Summary
    • It’s not (only) a test
      • When a test becomes something more
      • Taking it to the software development land
      • A Specification rather than a test suite
      • The differences between executable and “traditional” specifications
    • Statement-first programming
      • What’s the point of writing a specification after the fact?
      • “Test-First” means seeing a failure
      • “Test-After” often ends up as “Test-Never”
      • “Test-After” often leads to design rework
      • Summary
    • Practicing what we have already learned
      • Let me tell you a story
      • Act 1: The Car
      • Act 2: The Customer’s Site
      • Act 3: Test-Driven Development
      • Epilogue
    • Sorting out the bits
    • How to start?
      • Start with a good name
      • Start by filling the GIVEN-WHEN-THEN structure with the obvious
      • Start from the end
      • Start by invoking a method if you have one
      • Summary
    • How is TDD about analysis and what does “GIVEN-WHEN-THEN” mean?
      • Is there really a commonality between analysis and TDD?
      • Gherkin
      • TODO list… again!
    • Developing a TDD style and Constrained Non-Determinism
      • A style?
      • Principle: Tests As Specification
      • First technique: Anonymous Input
      • Second technique: Derived Values
      • Third technique: Distinct Generated Values
      • Fourth technique: Constant Specification
      • Summary of the example
      • Constrained non-determinism
      • Summary
      • What is the scope of a unit-level Statement in TDD?
      • Specifying Boundaries and Conditions
    • Triangulation
  • Part 2: Test-Driven Development in Object-Oriented World
    • On Object Composability
    • Telling, not asking
    • The need for mock objects
    • Why do we need composability?
    • Web, messages and protocols
      • Alarms, again!
      • Summary
    • Composing a web of objects
      • A preview
    • Interfaces
      • Classes vs interfaces
      • Events/callbacks vs interfaces – few words on roles
      • Small interfaces
    • Protocols
      • Protocols exist
      • Protocol stability
      • Craft messages to reflect sender’s intention
      • Model interactions after the problem domain
      • Message recipients should be told what to do, instead of being asked for information
      • Most of the getters should be removed, return values should be avoided
      • Protocols should be small and abstract
      • Summary
    • Classes
      • Single Responsibility Principle
      • Static recipients
      • Summary
    • Object Composition as a Language
      • More readable composition root
      • Refactoring for readability
      • Composition as a language
      • The significance of higher-level language
      • Some advice
      • Summary
    • Value Objects
      • What is a value?
      • Example: money and names
    • Value object anatomy
      • Hidden data
      • Hidden constructor
      • String conversion methods
      • Equality members
      • The return of investment
      • Summary
    • THIS IS ALL I HAVE FOR NOW. WHAT FOLLOWS IS RAW, UNORDERED MATERIAL THAT’S NOT YET READY TO BE CONSUMED AS PART OF THIS TUTORIAL
    • Aspects of value objects design
      • Immutability
      • Implicit vs. explicit handling of variability (TODO check vs with or without a dot)
      • Special values
      • Value types and Tell Don’t Ask
      • Summary
    • An object-oriented approach summary
      • Where are we now?
      • So, tell me again, why are we here?
    • Mock Objects as a testing tool
      • A backing example
      • Specifying protocols
      • Using a mock destination
      • Mocks as yet another context
      • Summary
    • Further Reading
      • Motivation – the first step to learning TDD
      • The Essential Tools
      • Value Objects
  • Notes
The book hasn't received reviews yet.
You May Also Like
Also Available On
Categories
Curated Lists