7 Clean Architecture Patterns Practices Principles m7 Slides
7 Clean Architecture Patterns Practices Principles m7 Slides
7 Clean Architecture Patterns Practices Principles m7 Slides
Matthew Renze
SOFTWARE CONSULTANT
@matthewrenze www.matthewrenze.com
Overview Test-Driven Development
Test Automation Pyramid
Pros and Cons
Demo
The Current State of Testing
Red
Refactor Green
Test-Driven Development
Red
1. Create a failing test
2. Get the test to pass
3. Improve the code Refactor Green
Test-Driven Development
Unit tests
Functional tests Automated tests
Integration tests
Acceptance tests Semi-automated
Component tests
Smoke tests tests
Service tests
Exploratory tests Manual tests
UI tests
Test Automation Pyramid
Manual
Tests
UI
Tests
Service Tests
Unit Tests
Test Automation Pyramid
Manual
Tests
UI
Number of tests
Tests
Cost
Service Tests
Unit Tests
Acceptance Tests
Manual
Tests
Verify functionality
Language of the business UI
Tests
Criteria for completeness
Acceptance
Full tests are problematic Service Tests
Tests
Unit Tests
Acceptance Tests
Presentation
Cross-Cutting
Acceptance Tests
Eliminate user interface
Mock Services
Application
Eliminate database
Domain
Concerns
Eliminate dependencies
In-memory Mock
Persistence Infrastructure
Database Services
Acceptance Tests
Mock Services
Application
Smoke test instead
Domain
Minimize manual tests
In-memory Mock
Exploratory test instead Database Services
Why Create Testable Architecture?
Manual
Tests
Pros
UI
Easier to test Tests
Improves design
Service Tests
Eliminates fear
Unit Tests
Why Create Testable Architecture?
Pros Cons
Easier to test Higher up-front cost
Improves design TDD requires discipline
Eliminates fear Requires team buy-in
Setup
Show SaleTests (Top)
Show SaleTests (Tests)
Show CreateSaleCommandTests (Top)
Show CreateSaleCommandTests (SetUp)
Show CreateSaleCommandTests (Add)
Show CreateSaleCommandTests (Save)
Show CreateSaleCommandTests (Notify)
Show CreateSaleCommandTests (End)
Show CreateASale Feature Tests
Show CreateASale Steps
Wrap Up
Summary Test-Driven Development
Test Automation Pyramid
Pros and Cons
Demo
Test Automation Pyramid
Manual
Tests
UI
Tests
Service Tests
Unit Tests
Unit Tests
Manual
Tests
Unit Tests
Service Tests
Manual
Tests
Verify functionality
Set of services UI
Tests
Covers service code
Tested in isolation Service Tests
Unit Tests
UI Tests
Manual
Tests
Very brittle
Service Tests
Should be minimal
Unit Tests
Manual Testing
Manual
Tests
Test by hand
UI
Most expensive Tests
Unit Tests
Test Automation Pyramid
Manual
Tests
UI
Tests
Cost
Service Tests
Unit Tests
Acceptance Tests
Manual
Tests
Verify functionality
Language of the business UI
Tests
Criteria for completeness
Full tests are problematic Service Tests
Unit Tests
Acceptance Tests
Cross-Cutting Concerns
Eliminate database
Mock Services
Application
Eliminate dependencies
Domain
Minimize coded UI tests
Persistence Infrastructure
Minimize manual tests
In-memory Mock
Database Services