Failing for the Right Reason - a Fresh Look on TDD
28th March 2023
-
Locked
Michael Milewski
Senior Developer - Zepto
Selena Small
Team Lead and Senior Developer
![Failing for the Right Reason - a Fresh Look on TDD image](https://embed-ssl.wistia.com/deliveries/338d5991135d7c660d53c9f35d095d29.jpg?image_crop_resized=1280x720)
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
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
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
This open-source tool is the #1 Automation Test Reporting Tool loved by the community and the developing team plans to share their knowledge via a learning course.
Stay tuned!
Explore MoT
![TestBash Brighton 2024](https://www.ministryoftesting.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbk15IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--815abcdd8f535ab728e65b8c665daf7c18ddfd5b/TestBash%20Brighton%202024_16%209.jpg)
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](https://www.ministryoftesting.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBc29DIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--12bd26b0325c6df0e89e56aff00487797293587f/Dojo_Courses_-_Daniel_Knott_-_Mobile_Dojo.png)
Begin your testing journey in mobile by learning the different aspects of testing mobile
Topics
Tags
-
testbash-spring
-
test-strategies