Failing for the Right Reason - a Fresh Look on TDD

  • Locked
Michael Milewski's profile
Michael Milewski

Senior Developer - Zepto

Selena Small's profile
Selena Small

Team Lead and Senior Developer

Failing for the Right Reason - a Fresh Look on TDD image
Talk Description
Real code, live demo. Get into the nitty-gritty of using tests to drive out code! Ever had difficulty writing tests? Don’t know how to identify the unit under test? Find it hard to write tests BEFORE implementation? Join us as we take you on a journey through multilayer outside-in BDD


You have a great idea for a web app but you have no idea how it’s all going to fit together. Learn how to drive your design from the business level interactions that a user might make, right through to the smallest units of the domain with multi-layer outside-in behavioural driven design (BDD).


This talk is a hands-on style tutorial which will enable developers to get started on their projects or improve the testing strategies within their own organisations. We’re going to run through building a simple web app written with a Rails API and React frontend and tested using RSpec, Capybara, Selenium webdriver, and Jest.


The multi-layer, outside in BDD development style is based on many years and companies worth of refinement to the techniques from the perspectives of two developers who came from polar opposite backgrounds - One with over 20 years of commercial experience and a vast background in TDD, and one relatively new to software.


Participants will be taken through the various layers:


  • “Lifecycle Flow” is the outermost layer of this BDD approach and follows along a flow of activity between 1 or more actors, usually driving a browser along many screens of a web style applications leading to one of a number of possible flow-on effects. These flows usually represent a business process.
  • “Page/Component Mechanics” are tests still run from a browser but focusing on a particular page or component on a number of places within the app and exercise specific behaviours that may come about from various states the application may find itself in.
  • “Frontend Component Tests” are used to test the usually javascript frontend framework implementation of the web page implementation. They allow for faster unit-level testing of the various states the frontend can be in.
  • “External Integration Tests” are a boundary that is fulfilled with a mock at most other layers of testing. This layer is performed separately to better control the effect of third-party services.
  • “API Acceptance Tests” define a boundary of the backend system and are an integration test of the backend unit as a whole.
  • “Controller Unit Tests” are written as unit tests as opposed to more standard RSpec integration tests. This is due to the API acceptance being a better place to drive out the integration and means tests at this layer would only change with API changes.
  • “Domain Concept Tests” often a number of model classes in rails represent a join domain concept and it is worth testing their interaction.
  • “Domain Unit Tests” are mostly done against the grain of RSpec and are unit tests and not integrated with the DB.

For each of these layers, a summary will be given:


  • how to define the unit under test and why
  • the kind of things that should and should not be tested and could break under this level
  • example test code
What you’ll learn

By the end of this talk, you'll be able to:

  • What Unit is under test
  • What to test at which level
  • Which failures are expected to happen where
  • A code repository with all these concepts
Michael Milewski's profile'

Michael Milewski

Senior Developer - Zepto

Michael Milewskil is a developer keen on the people side of things. He loves pairing, and in particular with people new to writing software. He especially likes driving software out with tests and directing the evolution of the design. In his spare time he does a bit of paddle boarding, camping and watching any one of his 4 kids excel above anything he ever managed to achieve.
Selena Small's profile'

Selena Small

Team Lead and Senior Developer

Selena is a full-stack lead engineer at Fresho in Melbourne Australia who is particularly passionate about TDD. As a self-taught coder with a background in management, she is well-equipped to mentor others. In her spare time, she is a nak muay ying, professional kickboxer.
Suggested Content
To Boldly Go: Taking The Enterprise On A Journey To Structured Exploratory Testing - Aaron Hodder
A Balancing Act: Finding A Place For Exploratory Testing
Testing Ask Me Anything on Test Strategies
Prioritizing Your Tests by Considering Impact and Value!
Let's Test the Pokemon API with REST and GraphQL
Test Management Evolution: Collaboration and the End of QA Friction
Explore MoT
TestBash Brighton 2024
Thu, 12 Sep 2024, 9:00 AM
We’re shaking things up and bringing TestBash back to Brighton on September 12th and 13th, 2024.
Beginner's Guide To Mobile Testing
Begin your testing journey in mobile by learning the different aspects of testing mobile

Tags

  • testbash-spring
  • test-strategies