SlideShare une entreprise Scribd logo
1  sur  21
Robust Software –Robust Software –
Dotting the I’s andDotting the I’s and
Crossing the T’sCrossing the T’s
Chris OldwoodChris Oldwood
ACCU Conference 2013ACCU Conference 2013
@chrisoldwood / gort@cix.co.uk@chrisoldwood / gort@cix.co.uk
The I’s & T’sThe I’s & T’s
 RobustnessRobustness
 Handling ErrorsHandling Errors
 Safely Ignoring ErrorsSafely Ignoring Errors
 TimeoutsTimeouts
 Unit Testing FailuresUnit Testing Failures
 Flexible ConfigurationFlexible Configuration
 Monitoring ClarityMonitoring Clarity
RobustnessRobustness
Stable in the face ofStable in the face of
unexpected behaviourunexpected behaviour
Pop Quiz – Exit Code?Pop Quiz – Exit Code?
int main(int argc, char* argv[])
{
throw UnhandledException();
}
Exit Code ConventionExit Code Convention
program.exe
if %errorlevel% neq 0 (
echo ERROR: Program failed
exit /b 1
)
Big Outer Try BlockBig Outer Try Block
int main(int argc, char* argv[])
{
try
{
return DoUsefulWork(argc, argv);
}
catch (const std::exception& e)
{ /* Report failure */ }
catch (…)
{ /* Report failure */ }
return EXIT_FAILURE;
}
Module BoundariesModule Boundaries
HRESULT DoSomething(...)
{
try
{
return Impl::DoSomething(...);
}
catch (const std::bad_alloc& e)
{ return E_OUTOFMEMORY; }
catch (const std::exception& e)
{ return E_FAIL; }
catch (...)
{ return E_UNEXPECTED; }
}
Exception Safety GuaranteesException Safety Guarantees
 NoneNone
 BasicBasic
 StrongStrong
 No ThrowNo Throw
Exception Unsafe CodeException Unsafe Code
IServicePtr AcquireService()
{
if (!m_service)
{
m_service = new Service();
m_service.CreateInstance();
}
return m_service;
}
IServicePtr m_service;
Exception Safe CodeException Safe Code
IServicePtr AcquireService()
{
if (!m_service)
{
ServicePtr service = new Service();
service.CreateInstance();
m_service.swap(service);
}
return m_service;
}
IServicePtr m_service;
Forever is a Really Long TimeForever is a Really Long Time
Handle completed = BeginAsyncOperation();
. . .
Wait(completed, INFINITE);
Cancellable OperationsCancellable Operations
Handle completed = BeginAsyncOperation();
Handle aborted = GetAbortHandle();
Handle waitables[] = { aborted, completed };
. . .
Handle signalled = Wait(waitables, timeout);
if (signalled == aborted)
{
Retries: immediate then queuedRetries: immediate then queued
Unit Testing FailuresUnit Testing Failures
Testing Write+Rename IdiomTesting Write+Rename Idiom
[Test]
public Void OriginalFilePreservedOnException()
{
var fakeIo = new FakeIo();
fakeIo.Write = (file, buffer) =>
{ throw new IoException(); }
var writer = new WriterService(fakeIo);
var filename = “original.txt”;
Assert.Throws(() => writer.WriteFile(filename));
Assert.True(fakeIo.FileExists(filename));
Assert.That(. . .);
}
Flexible ConfigurationFlexible Configuration
Monitoring ClarityMonitoring Clarity
Release It!Release It!
Questions?Questions?
Blog:Blog:
http://chrisoldwood.blogspot.comhttp://chrisoldwood.blogspot.com
@chrisoldwood / gort@cix.co.uk@chrisoldwood / gort@cix.co.uk

Contenu connexe

Similaire à Robust Software

Shift Left Security
Shift Left SecurityShift Left Security
Shift Left SecurityBATbern
 
The Safety Net of Functional Web Testing
The Safety Net of Functional Web TestingThe Safety Net of Functional Web Testing
The Safety Net of Functional Web Testingogborstad
 
Recent Trends in Cyber Security
Recent Trends in Cyber SecurityRecent Trends in Cyber Security
Recent Trends in Cyber SecurityAyoma Wijethunga
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)Steve Upton
 
Its not about the tooling
Its not about the toolingIts not about the tooling
Its not about the toolingBram Vogelaar
 
Automotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a HackerAutomotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a HackerForAllSecure
 
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts Mike Boudreaux
 
Testing the Internet of Everything
Testing the Internet of EverythingTesting the Internet of Everything
Testing the Internet of EverythingTechWell
 
A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)Luciano Mammino
 
Case Studies in Terrible Testing
Case Studies in Terrible TestingCase Studies in Terrible Testing
Case Studies in Terrible TestingTodd Gardner
 
Mathematically Guaranteed C and C++ Code
Mathematically Guaranteed C and C++ CodeMathematically Guaranteed C and C++ Code
Mathematically Guaranteed C and C++ CodePauline Schellenberger
 
Peter Brown resume
Peter Brown resumePeter Brown resume
Peter Brown resumePeter Brown
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)Patricia Aas
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Teaching Elephants to Dance, Burr Sutter
Teaching Elephants to Dance, Burr SutterTeaching Elephants to Dance, Burr Sutter
Teaching Elephants to Dance, Burr SutterJudy Breedlove
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy codeDror Helper
 

Similaire à Robust Software (20)

Build Automate and Test Strategies - BATMAN
Build Automate and Test Strategies - BATMAN Build Automate and Test Strategies - BATMAN
Build Automate and Test Strategies - BATMAN
 
Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Security
 
The Safety Net of Functional Web Testing
The Safety Net of Functional Web TestingThe Safety Net of Functional Web Testing
The Safety Net of Functional Web Testing
 
Basic of SSDLC
Basic of SSDLCBasic of SSDLC
Basic of SSDLC
 
Recent Trends in Cyber Security
Recent Trends in Cyber SecurityRecent Trends in Cyber Security
Recent Trends in Cyber Security
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)
 
Its not about the tooling
Its not about the toolingIts not about the tooling
Its not about the tooling
 
Automotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a HackerAutomotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a Hacker
 
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts
Safety Lifecycle Management - Emerson Exchange 2010 - Meet the Experts
 
Testing the Internet of Everything
Testing the Internet of EverythingTesting the Internet of Everything
Testing the Internet of Everything
 
A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)
 
Using Robots for App Testing
Using Robots for App Testing Using Robots for App Testing
Using Robots for App Testing
 
Case Studies in Terrible Testing
Case Studies in Terrible TestingCase Studies in Terrible Testing
Case Studies in Terrible Testing
 
Mathematically Guaranteed C and C++ Code
Mathematically Guaranteed C and C++ CodeMathematically Guaranteed C and C++ Code
Mathematically Guaranteed C and C++ Code
 
Peter Brown resume
Peter Brown resumePeter Brown resume
Peter Brown resume
 
DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)DevSecOps for Developers, How To Start (ETC 2020)
DevSecOps for Developers, How To Start (ETC 2020)
 
BSides LA/PDX
BSides LA/PDXBSides LA/PDX
BSides LA/PDX
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Teaching Elephants to Dance, Burr Sutter
Teaching Elephants to Dance, Burr SutterTeaching Elephants to Dance, Burr Sutter
Teaching Elephants to Dance, Burr Sutter
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
 

Plus de Chris Oldwood

In The Toolbox - LIVE!
In The Toolbox - LIVE!In The Toolbox - LIVE!
In The Toolbox - LIVE!Chris Oldwood
 
Waltzing with Branches [ACCU]
Waltzing with Branches [ACCU]Waltzing with Branches [ACCU]
Waltzing with Branches [ACCU]Chris Oldwood
 
Becoming a Bitter Programmer
Becoming a Bitter ProgrammerBecoming a Bitter Programmer
Becoming a Bitter ProgrammerChris Oldwood
 
Waltzing with Branches [Agile o/t Beach]
Waltzing with Branches [Agile o/t Beach]Waltzing with Branches [Agile o/t Beach]
Waltzing with Branches [Agile o/t Beach]Chris Oldwood
 
Using xUnit as a Swiss-Aarmy Testing Toolkit
Using xUnit as a Swiss-Aarmy Testing ToolkitUsing xUnit as a Swiss-Aarmy Testing Toolkit
Using xUnit as a Swiss-Aarmy Testing ToolkitChris Oldwood
 
xUnit Style Database Testing
xUnit Style Database TestingxUnit Style Database Testing
xUnit Style Database TestingChris Oldwood
 
Version Control - Patterns and Practices
Version Control - Patterns and PracticesVersion Control - Patterns and Practices
Version Control - Patterns and PracticesChris Oldwood
 
Requiem (For Windows XP)
Requiem (For Windows XP)Requiem (For Windows XP)
Requiem (For Windows XP)Chris Oldwood
 
(Re)Reading the Classics
(Re)Reading the Classics(Re)Reading the Classics
(Re)Reading the ClassicsChris Oldwood
 

Plus de Chris Oldwood (16)

The __far* Side
The __far* SideThe __far* Side
The __far* Side
 
Monolithic Delivery
Monolithic DeliveryMonolithic Delivery
Monolithic Delivery
 
A Test of Strength
A Test of StrengthA Test of Strength
A Test of Strength
 
In The Toolbox - LIVE!
In The Toolbox - LIVE!In The Toolbox - LIVE!
In The Toolbox - LIVE!
 
Test-Driven SQL
Test-Driven SQLTest-Driven SQL
Test-Driven SQL
 
Waltzing with Branches [ACCU]
Waltzing with Branches [ACCU]Waltzing with Branches [ACCU]
Waltzing with Branches [ACCU]
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Becoming a Bitter Programmer
Becoming a Bitter ProgrammerBecoming a Bitter Programmer
Becoming a Bitter Programmer
 
Waltzing with Branches [Agile o/t Beach]
Waltzing with Branches [Agile o/t Beach]Waltzing with Branches [Agile o/t Beach]
Waltzing with Branches [Agile o/t Beach]
 
Using xUnit as a Swiss-Aarmy Testing Toolkit
Using xUnit as a Swiss-Aarmy Testing ToolkitUsing xUnit as a Swiss-Aarmy Testing Toolkit
Using xUnit as a Swiss-Aarmy Testing Toolkit
 
xUnit Style Database Testing
xUnit Style Database TestingxUnit Style Database Testing
xUnit Style Database Testing
 
Version Control - Patterns and Practices
Version Control - Patterns and PracticesVersion Control - Patterns and Practices
Version Control - Patterns and Practices
 
Requiem (For Windows XP)
Requiem (For Windows XP)Requiem (For Windows XP)
Requiem (For Windows XP)
 
(Re)Reading the Classics
(Re)Reading the Classics(Re)Reading the Classics
(Re)Reading the Classics
 
Recycle Bin 101
Recycle Bin 101Recycle Bin 101
Recycle Bin 101
 
The Art of Code
The Art of CodeThe Art of Code
The Art of Code
 

Dernier

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 

Dernier (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 

Robust Software

Notes de l'éditeur

  1. Who am I
  2. Quick walkthrough of the schedule
  3. What do I mean by Robustness? Not so much about reliability Chair – sitting, to standing, stacking, etc. – from specified to unknown
  4. Why is it important? Bedrock for sustainable development of new features. Not over-engineering, just consideration of failures
  5. What do some runtimes do when an unhandled exceptional failure occurs? Nothing! See QM #6
  6. The exit code convention is 0 for success Note, that’s “success == !true” just for extra confusion The parent can’t react and recover if you don’t give them the chance to Exceptions only exists within languages once you cross module boundaries it’s back to return codes
  7. Assume failure by default Don’t assume the runtime will do the right thing It’s int main(), not void main() – always return an exit code
  8. Required at any module boundary, e.g. Win32 callback, COM component, WCF service, etc. Service recovery – shutdown may be worse – black hole effect
  9. Recap the Abrahams exception safety guarantees These apply equally to C#, Java, etc. as well Basic can be implemented with RAII in C++ and Dispose pattern in C# otherwise a manual try/catch block
  10. Example of real-world code, caused process to fail all work rapidly
  11. When recovery is not foremost in the method, be exception agnostic Still hard - more recent example was slowly losing engines due to subtle out-of-memory exception Two phase construction is a bad idea anyway, always prefer just the constructor or factory method to do it all
  12. Don’t wait forever, there must be an upper limit on how long a user/system actor will actually wait Don’t even start work if the users has already got bored Status message example – received every 60 secs so no point waiting any longer
  13. Infinite waits acceptable when operation can be cancelled through other means Long running operations should be cancellable to allow graceful termination/shutdown
  14. Fast and slow retries – perhaps retry much later (queued) if there is a specific blockage
  15. Test more than just the happy path (disks fill up, networks hang, access gets denied) If expecting automatic retry on a cluster failover, mock the service and simulate one to test recovery
  16. Write + rename is equivalent to create + swap earlier Build facades to allow unit testing of I/O operations and for simulating errors, e.g. out of disk space
  17. In-house production can be simpler as change is tightly controlled, development is where the action happens Never hard-code anything, all service endpoints and paths must be configurable (on different levels) Testing often drives the need for flexibility due to shared resources, e.g. developers workstation DR also a driver, but can be useful outside DR too (e.g. active/passive failover) But also default sensibly where possible to avoid bloated configuration files
  18. Calm and considered – pages of errors and alarm bells make it harder to diagnose You’ll never dream up every possible failure, but you can design ways to allow for it
  19. An excellent book probably the best on the subject – good case studies