SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
7 Years of Test 
Automation 
! 
@mikeb2701
Assumptions 
• Testing is important 
• Automating testing is important
Types of tests 
• Static Analysis 
• Unit Testing 
• Integration Testing 
• Acceptance Testing! 
• Performance Testing 
• Testing in Live 
• Exploratory Testing
The acceptance test suite as a 
whole both verifies that the 
application delivers the business 
value and guards against 
regressions or defects that break 
preexisting functions of the 
application. 
— Humble, Farley, Continuous Delivery, 2010, Chapter 8.
An acceptance test may only 
drive and assert behaviour in 
the system through interfaces 
available to the system’s users.
Writing Acceptance 
Tests
@RunWith(AcceptanceTestRunner.class) 
@Multithreaded 
@AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
public class PlaceOrderAcceptanceTest extends DslTestCase { 
! 
@Before 
public void beforeEveryTest() { 
! 
adminAPI.createInstrument("name: instrument”, 
"orderQuantityIncrement: 0.1”,…); 
registrationAPI.createUser("user", "balance: 100000"); 
mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); 
publicAPI.login("user"); 
mtfFixAPI.login(“marketMaker"); 
} // end 
! 
@Test 
public void shouldRejectOrderIfNotLoggedIn() { 
publicAPI.logout(); 
publicAPI.placeOrder(“instrument", 
"side: buy", "quantity: 1.2”, 
"timeInForce: ImmediateOrCancel”, 
"unauthorised: true"); 
!
@RunWith(AcceptanceTestRunner.class) 
@Multithreaded 
@AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
public class PlaceOrderAcceptanceTest extends DslTestCase { 
! 
@Before 
public void beforeEveryTest() { 
! 
adminAPI.createInstrument("name: instrument”, 
"orderQuantityIncrement: 0.1”,…); 
registrationAPI.createUser("user", "balance: 100000"); 
mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); 
publicAPI.login("user"); 
mtfFixAPI.login(“marketMaker"); 
} // end 
! 
@Test 
public void shouldRejectOrderIfNotLoggedIn() { 
publicAPI.logout(); 
publicAPI.placeOrder(“instrument", 
"side: buy", "quantity: 1.2”, 
"timeInForce: ImmediateOrCancel”, 
"unauthorised: true"); 
!
@RunWith(AcceptanceTestRunner.class) 
@Multithreaded 
@AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
public class PlaceOrderAcceptanceTest extends DslTestCase { 
! 
@Before 
public void beforeEveryTest() { 
! 
adminAPI.createInstrument("name: instrument”, 
"orderQuantityIncrement: 0.1”,…); 
registrationAPI.createUser("user", "balance: 100000"); 
mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); 
publicAPI.login("user"); 
mtfFixAPI.login(“marketMaker"); 
} // end 
! 
@Test 
public void shouldRejectOrderIfNotLoggedIn() { 
publicAPI.logout(); 
publicAPI.placeOrder(“instrument", 
"side: buy", "quantity: 1.2”, 
"timeInForce: ImmediateOrCancel”, 
"unauthorised: true"); 
!
@RunWith(AcceptanceTestRunner.class) 
@Multithreaded 
@AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
public class PlaceOrderAcceptanceTest extends DslTestCase { 
! 
@Before 
public void beforeEveryTest() { 
! 
adminAPI.createInstrument("name: instrument”, 
"orderQuantityIncrement: 0.1”,…); 
registrationAPI.createUser("user", "balance: 100000"); 
mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); 
publicAPI.login("user"); 
mtfFixAPI.login(“marketMaker"); 
} // end 
! 
@Test 
public void shouldRejectOrderIfNotLoggedIn() { 
publicAPI.logout(); 
publicAPI.placeOrder(“instrument", 
"side: buy", "quantity: 1.2”, 
"timeInForce: ImmediateOrCancel”, 
"unauthorised: true"); 
!
@RunWith(AcceptanceTestRunner.class) 
@Multithreaded 
@AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
public class PlaceOrderAcceptanceTest extends DslTestCase { 
! 
@Before 
public void beforeEveryTest() { 
! 
adminAPI.createInstrument("name: instrument”, 
"orderQuantityIncrement: 0.1”,…); 
registrationAPI.createUser("user", "balance: 100000"); 
mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); 
publicAPI.login("user"); 
mtfFixAPI.login(“marketMaker"); 
} // end 
! 
@Test 
public void shouldRejectOrderIfNotLoggedIn() { 
publicAPI.logout(); 
publicAPI.placeOrder(“instrument", 
"side: buy", "quantity: 1.2”, 
"timeInForce: ImmediateOrCancel”, 
"unauthorised: true"); 
!
DSL 
TradingUI 
PublicAPI 
AdminAPI 
Test 
MtfMemberAPI 
LoginPanel 
Driver 
Selenium 
BalancesPanel 
Driver 
InstrumentPanel 
Driver 
JavaAPI 
Driver 
AdminAPI 
Driver 
MtfFixDriver 
XML/HTTP 
QuickFIX 
Drivers
Time Travel
Service 
Service 
Service 
Service 
Service 
Time 
Machine 
Test 
Time Travel To 
Time Delta 
Get Current 
Time
@RunWith(AcceptanceTestRunner.class) 
@AcceptanceTest(id = 5194, flavour = {Flavour.PLACE_ORDER, Flavour.API}) 
@Multithreaded(tardis = true) 
public class CancelAndReplaceAcceptanceTest extends DslTestCase 
{ 
@Before 
public void setUp() 
{ 
dsl.forceToUtcTimeZone(); 
dsl.enableTimeMachine(); 
! 
dsl.createTimePoint("name: origin”, 
"value: <next weekday>"); 
dsl.createTimePoint("name: marketOpen", 
"value: origin plus 1 weekdayCalendarOpenOffset”); 
! 
dsl.waitUntil("marketOpen");
Pro-Tip: 
Isolate as much as 
possible
Simple DSL 
https://github.com/LMAX-Exchange/Simple-DSL
Acceptance Testing 
(Running)
Parallel RTA 
Sequential 
Sequential 
Sequential 
RTA 
RTA 
RTA 
Scotty 
Romero 
Server 
Jenkins
Intermittency 
avp.wikia.com
Sources of Intermittency 
• Bad code (under test) 
• Bad test 
• Environmental
Just Fix It!
Acceptance Test DB
Wrap-Up 
•Write them well 
•Run them often 
•Keep them green
Thank you 
Q&A

Contenu connexe

Tendances

Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows storeWindows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
Frédéric Harper
 

Tendances (7)

Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015
 
Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
Selenium notes
Selenium notesSelenium notes
Selenium notes
 
Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows storeWindows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
Windows 8 Camp Ottawa - 2012-04-14 - Introducing the Windows store
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
 
Testing iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backendTesting iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backend
 

Similaire à Test automation 3

Code review for secure web applications
Code review for secure web applicationsCode review for secure web applications
Code review for secure web applications
silviad74
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
Tobias Schneck
 

Similaire à Test automation 3 (20)

The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
 
Junit mockito and PowerMock in Java
Junit mockito and  PowerMock in JavaJunit mockito and  PowerMock in Java
Junit mockito and PowerMock in Java
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you about
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Testing basics for developers
Testing basics for developersTesting basics for developers
Testing basics for developers
 
Functional Testing
Functional TestingFunctional Testing
Functional Testing
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How To
 
Code review for secure web applications
Code review for secure web applicationsCode review for secure web applications
Code review for secure web applications
 
Guide to the jungle of testing frameworks
Guide to the jungle of testing frameworksGuide to the jungle of testing frameworks
Guide to the jungle of testing frameworks
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLCUI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrity
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
 
Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversing
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developer
 
Inside Logic Apps
Inside Logic AppsInside Logic Apps
Inside Logic Apps
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture
 
100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EE100% Code Coverage - TDD mit Java EE
100% Code Coverage - TDD mit Java EE
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
 

Plus de Michael Barker (7)

Value Types
Value TypesValue Types
Value Types
 
Stuff I Learned About Performance
Stuff I Learned About PerformanceStuff I Learned About Performance
Stuff I Learned About Performance
 
Disruptor yow2013 v2
Disruptor yow2013 v2Disruptor yow2013 v2
Disruptor yow2013 v2
 
Concurrecy techdrop
Concurrecy techdropConcurrecy techdrop
Concurrecy techdrop
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
 
Beginners guide-concurrency
Beginners guide-concurrencyBeginners guide-concurrency
Beginners guide-concurrency
 
Disruptor tools in action
Disruptor   tools in actionDisruptor   tools in action
Disruptor tools in action
 

Dernier

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 

Test automation 3

  • 1. 7 Years of Test Automation ! @mikeb2701
  • 2. Assumptions • Testing is important • Automating testing is important
  • 3. Types of tests • Static Analysis • Unit Testing • Integration Testing • Acceptance Testing! • Performance Testing • Testing in Live • Exploratory Testing
  • 4.
  • 5. The acceptance test suite as a whole both verifies that the application delivers the business value and guards against regressions or defects that break preexisting functions of the application. — Humble, Farley, Continuous Delivery, 2010, Chapter 8.
  • 6. An acceptance test may only drive and assert behaviour in the system through interfaces available to the system’s users.
  • 8. @RunWith(AcceptanceTestRunner.class) @Multithreaded @AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) public class PlaceOrderAcceptanceTest extends DslTestCase { ! @Before public void beforeEveryTest() { ! adminAPI.createInstrument("name: instrument”, "orderQuantityIncrement: 0.1”,…); registrationAPI.createUser("user", "balance: 100000"); mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); publicAPI.login("user"); mtfFixAPI.login(“marketMaker"); } // end ! @Test public void shouldRejectOrderIfNotLoggedIn() { publicAPI.logout(); publicAPI.placeOrder(“instrument", "side: buy", "quantity: 1.2”, "timeInForce: ImmediateOrCancel”, "unauthorised: true"); !
  • 9. @RunWith(AcceptanceTestRunner.class) @Multithreaded @AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) public class PlaceOrderAcceptanceTest extends DslTestCase { ! @Before public void beforeEveryTest() { ! adminAPI.createInstrument("name: instrument”, "orderQuantityIncrement: 0.1”,…); registrationAPI.createUser("user", "balance: 100000"); mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); publicAPI.login("user"); mtfFixAPI.login(“marketMaker"); } // end ! @Test public void shouldRejectOrderIfNotLoggedIn() { publicAPI.logout(); publicAPI.placeOrder(“instrument", "side: buy", "quantity: 1.2”, "timeInForce: ImmediateOrCancel”, "unauthorised: true"); !
  • 10. @RunWith(AcceptanceTestRunner.class) @Multithreaded @AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) public class PlaceOrderAcceptanceTest extends DslTestCase { ! @Before public void beforeEveryTest() { ! adminAPI.createInstrument("name: instrument”, "orderQuantityIncrement: 0.1”,…); registrationAPI.createUser("user", "balance: 100000"); mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); publicAPI.login("user"); mtfFixAPI.login(“marketMaker"); } // end ! @Test public void shouldRejectOrderIfNotLoggedIn() { publicAPI.logout(); publicAPI.placeOrder(“instrument", "side: buy", "quantity: 1.2”, "timeInForce: ImmediateOrCancel”, "unauthorised: true"); !
  • 11. @RunWith(AcceptanceTestRunner.class) @Multithreaded @AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) public class PlaceOrderAcceptanceTest extends DslTestCase { ! @Before public void beforeEveryTest() { ! adminAPI.createInstrument("name: instrument”, "orderQuantityIncrement: 0.1”,…); registrationAPI.createUser("user", "balance: 100000"); mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); publicAPI.login("user"); mtfFixAPI.login(“marketMaker"); } // end ! @Test public void shouldRejectOrderIfNotLoggedIn() { publicAPI.logout(); publicAPI.placeOrder(“instrument", "side: buy", "quantity: 1.2”, "timeInForce: ImmediateOrCancel”, "unauthorised: true"); !
  • 12. @RunWith(AcceptanceTestRunner.class) @Multithreaded @AcceptanceTest(id = 29, flavour = {Flavour.PLACE_ORDER, Flavour.API}) public class PlaceOrderAcceptanceTest extends DslTestCase { ! @Before public void beforeEveryTest() { ! adminAPI.createInstrument("name: instrument”, "orderQuantityIncrement: 0.1”,…); registrationAPI.createUser("user", "balance: 100000"); mtfMemberAPI.createMtfMemberAndFixSession("marketMaker"); publicAPI.login("user"); mtfFixAPI.login(“marketMaker"); } // end ! @Test public void shouldRejectOrderIfNotLoggedIn() { publicAPI.logout(); publicAPI.placeOrder(“instrument", "side: buy", "quantity: 1.2”, "timeInForce: ImmediateOrCancel”, "unauthorised: true"); !
  • 13. DSL TradingUI PublicAPI AdminAPI Test MtfMemberAPI LoginPanel Driver Selenium BalancesPanel Driver InstrumentPanel Driver JavaAPI Driver AdminAPI Driver MtfFixDriver XML/HTTP QuickFIX Drivers
  • 15. Service Service Service Service Service Time Machine Test Time Travel To Time Delta Get Current Time
  • 16. @RunWith(AcceptanceTestRunner.class) @AcceptanceTest(id = 5194, flavour = {Flavour.PLACE_ORDER, Flavour.API}) @Multithreaded(tardis = true) public class CancelAndReplaceAcceptanceTest extends DslTestCase { @Before public void setUp() { dsl.forceToUtcTimeZone(); dsl.enableTimeMachine(); ! dsl.createTimePoint("name: origin”, "value: <next weekday>"); dsl.createTimePoint("name: marketOpen", "value: origin plus 1 weekdayCalendarOpenOffset”); ! dsl.waitUntil("marketOpen");
  • 17. Pro-Tip: Isolate as much as possible
  • 20. Parallel RTA Sequential Sequential Sequential RTA RTA RTA Scotty Romero Server Jenkins
  • 21.
  • 22.
  • 24. Sources of Intermittency • Bad code (under test) • Bad test • Environmental
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 32.
  • 33.
  • 34. Wrap-Up •Write them well •Run them often •Keep them green