SlideShare a Scribd company logo
Using xUnit as a Swiss-Army Testing Toolkit
(Does ‘Unit’ Size Matter?)
ACCU Conference 2011
Chris Oldwood
gort@cix.co.uk
Stream of Consciousness
• Developer Driven Testing
• The Essence of (x)Unit Testing
• Those Pesky Dependencies
• Code & Test Evolution in Practice
Stream of Consciousness
• Developer Driven Testing
• The Essence of (x)Unit Testing
• Those Pesky Dependencies
• Code & Test Evolution in Practice
Text Book Test
string[][] tests =
{
{ "3", "4", "+", "7" },
{ "9", "1", "-", "8" },
{ "2", "3", "*", "6" },
{ "9", "3", "/", "3" },
};
void run_tests()
{
var calculator = new Calculator();
foreach(var test in tests)
{
var lhs = test[0];
var rhs = test[1];
var op = test[2];
var result = calculator(lhs, rhs, op);
assert(result == test[3]);
}
}
Exercise Left for the Reader
External System 1 External System 2 External System 3
The System
42
ServicesDatabase
Unit
Integration
System Component
Stress
Lexicon of Testing
End-to-End
Regression
White Box
Black Box
Characterisation
Exploration
System
Integration
Component
Unit
Dependencies
Feedback
‘Unit’ Evolution
All Regression
Stream of Consciousness
• Developer Driven Testing
• The Essence of (x)Unit Testing
• Those Pesky Dependencies
• Code & Test Evolution in Practice
Test == Specification
public void Execute_Should_Elide_Agreement_When_No_Trades_Match()
{
var trades = new List<Trade> { new Trade("trade-id", "product-a") };
var agreement = new Agreement("product-b");
var task = new PreparationTask(trades, agreement);
var result = task.Execute(s_services);
Assert.That(task.Agreement, Is.Null);
}
Consistent Style
public void a_c_sharp_test()
{
var arrangement = new Arrangement();
var result = arrangement.action();
Assert.That(result, Is.EqualTo(expectation));
}
create procedure a_sql_test
as
declare arrangement varchar(100),
result varchar(100)
exec action @input = arrangement,
@output = result
exec AssertAreEqual @result, "expectation"
go
Minimises Dependencies
MyService
External Service DatabaseFile System
Mock External
Service
IExternalService IFileSystem IDatabase
Mock File
System
Mock Database
Promotes Arbitrary Code Execution
public void Prepare_Should_Elide_Agreement_When_No_Trades_Match()
{
var trades = new List<Trade> { new Trade("trade-id", "product-a") };
var agreement = new Agreement("product-b");
var task = new PreparationTask(trades, agreement);
var result = task.Execute(s_services);
Assert.That(task.Agreement, Is.Null);
}
LibraryEXE Stub
Test Runner LibraryTestsDebugger
Custom Test
Harness
Automated Testing
• Lowers the barrier to running tests
• Regression testing is implicit
• Build server watches your back
Stream of Consciousness
• Developer Driven Testing
• The Essence of (x)Unit Testing
• Those Pesky Dependencies
• Code & Test Evolution in Practice
Pesky Dependencies
External System 1 External System 2 External System 3
The System
Service 2
Service 1
File-System
Database
xUnit Abuse
• Fight the Shadow Cache
• Invoke TearDown from SetUp
• Test/build failure isn’t absolute
File-System (Reading)
• Source Control directory
• Build server directory
• Resource files
File-System (Writing)
• TEMP directory
• Output directory
Database
• Per-user / per-branch workspace
• Only need schema not data (Integration)
• Can reuse existing unit test database
• Use same code revision for compatibility
• Use transactions to avoid residual effects
• Fake tables with CSV files
Database Asserts
public void AddCustomer_Should_Persist_The_Customer()
{
const id = 1234;
const name = "name";
var customer = new Customer(. . .);
using (var connection = AcquireConnection())
{
CustomerDataMapper.AddCustomer(customer, connection);
Assert.That(RowExists("dbo.Customer",
" CustomerId = {0}"
+ " AND CustomerName = '{1}'",
id, name),
Is.True);
}
}
Database SetUp/TearDown
[TestFixture, TestCategory.DatabaseTest]
public class SomeEntityTests : DatabaseTestBase
{
[TestFixtureSetUp]
public void FixtureSetUp
{
using(var connection = AcquireConnection())
{
connection.Execute("insert into thingy_table values(1, 2, 3)");
connection.Execute("test.InsertThingy(1, 2, 3)");
}
}
[TestFixtureTearDown]
public void FixtureTearDown
{
using(var connection = AcquireConnection())
{
connection.Execute("delete from thingy_table");
connection.Execute("test.DeleteAllThingys");
}
}
}
Helper Base Class
public class DatabaseTestBase
{
public ISqlConnection AcquireConnection()
{
return . . .
}
. . .
public bool RowExists(string table, string where, string params[])
{
string filter = String.Format(where, params);
string sql = String.Format(
"select count(*) as [Count] from {0} where {1}"
, table, filter);
using (var connection = AcquireConnection())
{
var reader = connection.ExecuteQuery(sql);
return (reader.GetInt("Count") == 1);
}
}
. . .
}
External Systems
• Verify API behaviour
• Test internal façade
• Reliability varies (DEV vs PROD)
Stream of Consciousness
• Developer Driven Testing
• The Essence of (x)Unit Testing
• Those Pesky Dependencies
• Code & Test Evolution in Practice
System Architecture
Market Data Trade Data Analytics
The System
42
ServicesDatabase
Initial System Test
Market
Data Service
Trade
Data Service
Analytics Service
Calculator
Test Runner
System Tests
[Test, TestCategory.SystemTest]
public void Calculate_Answer()
{
. . .
var result = c.calculate();
Assert.Equal(result, 42);
}
Addressing External Risks
External Market
Data Service API
External Trade
Data Service API
External Market
Data Service Tests
External Trade
Data Service Tests
Test Runner
Internal Service Design
External Service
API
External Service
Tests
Internal Service
External
Service Facade
Internal Service
Tests
Mock
External Services
Performance
Test Runner
Mock Service
Data Access Layer
Database
Public Interface
Database Unit
Tests
Data Access
Layer
Data Access
Layer Tests
Database API
Mock Database
API
Mock Data
Access Layer
Database
Public Interface
External Analytics
Service
External Market
Data Service API
External Market
Data Service API
System Evolution
Mock Market
Data Service
Mock Trade
Data Service
Mock Analytics
Service
Calculator
Test Runner
Unit / Integration
/ System Tests
[Test, TestCategory.SystemTest]
public void Calc_Answer_For_ABC_Plc()
{
. . .
var result = c.calculate();
Assert.Equal(result, 41.75);
}
Mock Data
Access Layer
Market
Data Service
Trade
Data Service
Analytics Service
Data Access
Layer
“The Oldwood Thing”
http://chrisoldwood.blogspot.com
Chris Oldwood
gort@cix.co.uk

More Related Content

KEY
SQLite 周りのテストをしよう
PDF
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
PDF
Indexing and Query Optimizer (Mongo Austin)
PPT
Fast querying indexing for performance (4)
PPTX
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
PDF
Application-Specific Models and Pointcuts using a Logic Meta Language
PDF
No SQL Unit - Devoxx 2012
PDF
4java Basic Syntax
SQLite 周りのテストをしよう
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Indexing and Query Optimizer (Mongo Austin)
Fast querying indexing for performance (4)
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
Application-Specific Models and Pointcuts using a Logic Meta Language
No SQL Unit - Devoxx 2012
4java Basic Syntax

What's hot (20)

PDF
Error based blind sqli
PDF
Fighting security trolls_with_high-quality_mindsets
PDF
Hidden Treasures of the Python Standard Library
PPTX
Django and working with large database tables
PDF
Python and cassandra
PPTX
Indexing and Query Optimizer (Aaron Staple)
DOCX
Parameterization is nothing but giving multiple input
PDF
Java OOP Programming language (Part 4) - Collection
PDF
How to Create Database component -Enterprise Application Using C# Lab
PDF
Apache Cassandra & Data Modeling
ODP
Mongo indexes
PPTX
Giving Clarity to LINQ Queries by Extending Expressions R2
PPTX
MongoDB and Indexes - MUG Denver - 20160329
PDF
Android Architecture components
PPT
Jdbc oracle
PPTX
Presentation Android Architecture Components
PDF
4 gouping object
PDF
Creating, Updating and Deleting Document in MongoDB
PDF
Java OOP Programming language (Part 8) - Java Database JDBC
PDF
Data Love Conference - Window Functions for Database Analytics
Error based blind sqli
Fighting security trolls_with_high-quality_mindsets
Hidden Treasures of the Python Standard Library
Django and working with large database tables
Python and cassandra
Indexing and Query Optimizer (Aaron Staple)
Parameterization is nothing but giving multiple input
Java OOP Programming language (Part 4) - Collection
How to Create Database component -Enterprise Application Using C# Lab
Apache Cassandra & Data Modeling
Mongo indexes
Giving Clarity to LINQ Queries by Extending Expressions R2
MongoDB and Indexes - MUG Denver - 20160329
Android Architecture components
Jdbc oracle
Presentation Android Architecture Components
4 gouping object
Creating, Updating and Deleting Document in MongoDB
Java OOP Programming language (Part 8) - Java Database JDBC
Data Love Conference - Window Functions for Database Analytics
Ad

Viewers also liked (6)

PPTX
Introduction to Unit Testing
PPTX
Le Tour de xUnit
PPTX
ASP.NET Core 2.0 - .NET São Paulo - Outubro-2017
PDF
xUnit Test Patterns - Chapter19
PPTX
Mini training - Moving to xUnit.net
PPTX
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Introduction to Unit Testing
Le Tour de xUnit
ASP.NET Core 2.0 - .NET São Paulo - Outubro-2017
xUnit Test Patterns - Chapter19
Mini training - Moving to xUnit.net
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Ad

Similar to Using xUnit as a Swiss-Aarmy Testing Toolkit (20)

PPTX
Advances in Unit Testing: Theory and Practice
PDF
Solr @ Etsy - Apache Lucene Eurocon
PPTX
Testing basics for developers
PPT
2012 JDays Bad Tests Good Tests
PPTX
Java Language fundamental
PPTX
Stress test data pipeline
PPT
xUnit Style Database Testing
PDF
33rd Degree 2013, Bad Tests, Good Tests
PDF
Unit Testing
PPTX
What is new in Java 8
ODP
Good Practices On Test Automation
PPTX
Static analysis: Around Java in 60 minutes
PDF
Terraform introduction
PPTX
Appium TestNG Framework and Multi-Device Automation Execution
PPTX
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
PPTX
Typed? Dynamic? Both! Cross-platform DSLs in C#
PPTX
JDBC ResultSet power point presentation by klu
DOC
Selenium Webdriver with data driven framework
PDF
MongoDB World 2019: Life In Stitch-es
Advances in Unit Testing: Theory and Practice
Solr @ Etsy - Apache Lucene Eurocon
Testing basics for developers
2012 JDays Bad Tests Good Tests
Java Language fundamental
Stress test data pipeline
xUnit Style Database Testing
33rd Degree 2013, Bad Tests, Good Tests
Unit Testing
What is new in Java 8
Good Practices On Test Automation
Static analysis: Around Java in 60 minutes
Terraform introduction
Appium TestNG Framework and Multi-Device Automation Execution
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
Typed? Dynamic? Both! Cross-platform DSLs in C#
JDBC ResultSet power point presentation by klu
Selenium Webdriver with data driven framework
MongoDB World 2019: Life In Stitch-es

More from Chris Oldwood (15)

PPTX
The __far* Side
PPTX
Monolithic Delivery
PPTX
A Test of Strength
PPT
In The Toolbox - LIVE!
PPT
Test-Driven SQL
PPT
Waltzing with Branches [ACCU]
PPT
Continuous Delivery
PPT
Becoming a Bitter Programmer
PPT
Waltzing with Branches [Agile o/t Beach]
PPT
Robust Software
PPT
Version Control - Patterns and Practices
PPT
Requiem (For Windows XP)
PPT
(Re)Reading the Classics
PPT
Recycle Bin 101
PPT
The Art of Code
The __far* Side
Monolithic Delivery
A Test of Strength
In The Toolbox - LIVE!
Test-Driven SQL
Waltzing with Branches [ACCU]
Continuous Delivery
Becoming a Bitter Programmer
Waltzing with Branches [Agile o/t Beach]
Robust Software
Version Control - Patterns and Practices
Requiem (For Windows XP)
(Re)Reading the Classics
Recycle Bin 101
The Art of Code

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPT
Introduction Database Management System for Course Database
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Digital Strategies for Manufacturing Companies
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Introduction to Artificial Intelligence
CHAPTER 2 - PM Management and IT Context
How to Migrate SBCGlobal Email to Yahoo Easily
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Reimagine Home Health with the Power of Agentic AI​
Introduction Database Management System for Course Database
Which alternative to Crystal Reports is best for small or large businesses.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Computer Software and OS of computer science of grade 11.pptx
PTS Company Brochure 2025 (1).pdf.......
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Digital Strategies for Manufacturing Companies
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Designing Intelligence for the Shop Floor.pdf
Softaken Excel to vCard Converter Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
L1 - Introduction to python Backend.pptx
Introduction to Artificial Intelligence

Using xUnit as a Swiss-Aarmy Testing Toolkit

  • 1. Using xUnit as a Swiss-Army Testing Toolkit (Does ‘Unit’ Size Matter?) ACCU Conference 2011 Chris Oldwood gort@cix.co.uk
  • 2. Stream of Consciousness • Developer Driven Testing • The Essence of (x)Unit Testing • Those Pesky Dependencies • Code & Test Evolution in Practice
  • 3. Stream of Consciousness • Developer Driven Testing • The Essence of (x)Unit Testing • Those Pesky Dependencies • Code & Test Evolution in Practice
  • 4. Text Book Test string[][] tests = { { "3", "4", "+", "7" }, { "9", "1", "-", "8" }, { "2", "3", "*", "6" }, { "9", "3", "/", "3" }, }; void run_tests() { var calculator = new Calculator(); foreach(var test in tests) { var lhs = test[0]; var rhs = test[1]; var op = test[2]; var result = calculator(lhs, rhs, op); assert(result == test[3]); } }
  • 5. Exercise Left for the Reader External System 1 External System 2 External System 3 The System 42 ServicesDatabase
  • 6. Unit Integration System Component Stress Lexicon of Testing End-to-End Regression White Box Black Box Characterisation Exploration
  • 8. Stream of Consciousness • Developer Driven Testing • The Essence of (x)Unit Testing • Those Pesky Dependencies • Code & Test Evolution in Practice
  • 9. Test == Specification public void Execute_Should_Elide_Agreement_When_No_Trades_Match() { var trades = new List<Trade> { new Trade("trade-id", "product-a") }; var agreement = new Agreement("product-b"); var task = new PreparationTask(trades, agreement); var result = task.Execute(s_services); Assert.That(task.Agreement, Is.Null); }
  • 10. Consistent Style public void a_c_sharp_test() { var arrangement = new Arrangement(); var result = arrangement.action(); Assert.That(result, Is.EqualTo(expectation)); } create procedure a_sql_test as declare arrangement varchar(100), result varchar(100) exec action @input = arrangement, @output = result exec AssertAreEqual @result, "expectation" go
  • 11. Minimises Dependencies MyService External Service DatabaseFile System Mock External Service IExternalService IFileSystem IDatabase Mock File System Mock Database
  • 12. Promotes Arbitrary Code Execution public void Prepare_Should_Elide_Agreement_When_No_Trades_Match() { var trades = new List<Trade> { new Trade("trade-id", "product-a") }; var agreement = new Agreement("product-b"); var task = new PreparationTask(trades, agreement); var result = task.Execute(s_services); Assert.That(task.Agreement, Is.Null); } LibraryEXE Stub Test Runner LibraryTestsDebugger Custom Test Harness
  • 13. Automated Testing • Lowers the barrier to running tests • Regression testing is implicit • Build server watches your back
  • 14. Stream of Consciousness • Developer Driven Testing • The Essence of (x)Unit Testing • Those Pesky Dependencies • Code & Test Evolution in Practice
  • 15. Pesky Dependencies External System 1 External System 2 External System 3 The System Service 2 Service 1 File-System Database
  • 16. xUnit Abuse • Fight the Shadow Cache • Invoke TearDown from SetUp • Test/build failure isn’t absolute
  • 17. File-System (Reading) • Source Control directory • Build server directory • Resource files
  • 18. File-System (Writing) • TEMP directory • Output directory
  • 19. Database • Per-user / per-branch workspace • Only need schema not data (Integration) • Can reuse existing unit test database • Use same code revision for compatibility • Use transactions to avoid residual effects • Fake tables with CSV files
  • 20. Database Asserts public void AddCustomer_Should_Persist_The_Customer() { const id = 1234; const name = "name"; var customer = new Customer(. . .); using (var connection = AcquireConnection()) { CustomerDataMapper.AddCustomer(customer, connection); Assert.That(RowExists("dbo.Customer", " CustomerId = {0}" + " AND CustomerName = '{1}'", id, name), Is.True); } }
  • 21. Database SetUp/TearDown [TestFixture, TestCategory.DatabaseTest] public class SomeEntityTests : DatabaseTestBase { [TestFixtureSetUp] public void FixtureSetUp { using(var connection = AcquireConnection()) { connection.Execute("insert into thingy_table values(1, 2, 3)"); connection.Execute("test.InsertThingy(1, 2, 3)"); } } [TestFixtureTearDown] public void FixtureTearDown { using(var connection = AcquireConnection()) { connection.Execute("delete from thingy_table"); connection.Execute("test.DeleteAllThingys"); } } }
  • 22. Helper Base Class public class DatabaseTestBase { public ISqlConnection AcquireConnection() { return . . . } . . . public bool RowExists(string table, string where, string params[]) { string filter = String.Format(where, params); string sql = String.Format( "select count(*) as [Count] from {0} where {1}" , table, filter); using (var connection = AcquireConnection()) { var reader = connection.ExecuteQuery(sql); return (reader.GetInt("Count") == 1); } } . . . }
  • 23. External Systems • Verify API behaviour • Test internal façade • Reliability varies (DEV vs PROD)
  • 24. Stream of Consciousness • Developer Driven Testing • The Essence of (x)Unit Testing • Those Pesky Dependencies • Code & Test Evolution in Practice
  • 25. System Architecture Market Data Trade Data Analytics The System 42 ServicesDatabase
  • 26. Initial System Test Market Data Service Trade Data Service Analytics Service Calculator Test Runner System Tests [Test, TestCategory.SystemTest] public void Calculate_Answer() { . . . var result = c.calculate(); Assert.Equal(result, 42); }
  • 27. Addressing External Risks External Market Data Service API External Trade Data Service API External Market Data Service Tests External Trade Data Service Tests Test Runner
  • 28. Internal Service Design External Service API External Service Tests Internal Service External Service Facade Internal Service Tests Mock External Services Performance Test Runner Mock Service
  • 29. Data Access Layer Database Public Interface Database Unit Tests Data Access Layer Data Access Layer Tests Database API Mock Database API Mock Data Access Layer
  • 30. Database Public Interface External Analytics Service External Market Data Service API External Market Data Service API System Evolution Mock Market Data Service Mock Trade Data Service Mock Analytics Service Calculator Test Runner Unit / Integration / System Tests [Test, TestCategory.SystemTest] public void Calc_Answer_For_ABC_Plc() { . . . var result = c.calculate(); Assert.Equal(result, 41.75); } Mock Data Access Layer Market Data Service Trade Data Service Analytics Service Data Access Layer

Editor's Notes

  • #2: -It’s all about testing units as they get bigger and bigger
  • #3: -Questions at the end
  • #5: -Simple black box testing with test cases is unrealistic (for me) -Simple scalar inputs - No I/O or threads -What about exceptions?
  • #6: -Users at periphery– so User Acceptance Tests only a small part -The vast majority of tests are internal and of a technical nature -Crosses subsystems and internal/external systems – lots of I/O, threads etc.
  • #7: -Different interpretations of what a Unit is -This talk is developer focused, i.e. biased towards white box testing
  • #8: -Layers of testing just like layers of code -More layers means more dependencies &amp; slower feedback -New tests become regression tests if kept
  • #10: -Naming is most important aspect and gets harder as you acquire layers -Example test for a workaround (i.e. not in specification) -Most tests are non-trivial and require non-trivial inputs
  • #11: -xUnit brings familiarity across the technology stack -One size doesn’t fit all but it can fit many cases
  • #12: -Our old friend Mr Coupling -Programming to an interface (quite literally in modern languages, but not in C/C++)
  • #13: -All testable logic in libraries, executables just bootstrapping stubs -Faster debug time as it is often easier to reproduce the problem as it requires less setup -Debug service as in-proc process -Script + command line vs Test configuration (cf Resharper)
  • #16: -Inside vs outside your control (dealing with failed builds)
  • #17: -Memory is transient – automatic cleanup -Shadow cache can help and hinder -Need to use SetUp &amp; TearDown to ensure no persistent effects after failure -Sometimes tests are inconclusive (external service down)
  • #18: -FS often considered a dependency acceptable in unit testing -Should you mock the file-system? Yes. -VCS folder is part of source code (ie isolated), relative paths tend to be stable -Build server is fixed common point but needs manual versioning -Resource files (.zip within .rc, unpack to TEMP etc)
  • #19: -ASSERTS? Test for presence (simple) or compare contents (harder) -TEMP known directory, but for multiple builds need to isolate branches (e.g. use PID) -Output needs configuring but is isolated &amp; also transient
  • #20: -Desktop vs RDBMS (Lite editions) -Not testing procedures (integration) - testing interaction with procedures -Assume underlying DB is already unit tested -Build on top of unit test database -Use transactions to help avoid residual effects - control the connection pool and therefore the transaction lifetime
  • #21: -For entities - row exists, n rows exist -Do you check all attributes or just entity ID? -Beware of caching inside frameworks like Hibernate if using reader to test writing by round-tripping entities -As &amp;apos;dbo&amp;apos; you should have complete access and can circumvent permissions to access the underlying tables when required
  • #22: -Fixture SetUp/TearDown for static data (e.g. currencies) to satisfy foreign key constraints -Write separate helper functions (in SQL?) to add remove common data (using other schema?) -Use existing database API where possible to make tests less brittle
  • #23: -In T-SQL use RaiseError to throw an exception
  • #24: -Verifying the external API contract to detect changes (write tests instead of prototyping) -Helps to test your façade -Highly unreliable (failed automated builds causes noise) -Your UAT output can be someone else’s DEV input -Writing? (publish to bus/share)
  • #25: -Current system evolution from .exe stub to many components
  • #26: -Explain very briefly the overall architecture -Highlight where we want to provide tests -Key area of Risk –&amp;gt; the external services
  • #27: -Start with in-process services to enable end-to-end testing from the start -Services initially just stubs with interfaces to allow mocking
  • #29: -External service façade provides a mocking point, especially when external API is all concrete types -External service API tested -Internal service can be component tested with mock service -Internal service can be independently integration tested -Mocks became production components -Hubert’s colour schemes -&amp;gt; every blue box should have a purple or green box feeding it
  • #31: -Stubs replaced with mocks to facilitate system evolution and integration testing -Once real data can be provided through the services a realistic system test can be coded -File-system used to provide fixed set of test data for one counterparty -Mix &amp; match different mocks and fakes for different tests
  • #32: -Questions?