Antifragile Software and Genetic Improvement Martin Monperrus - - PowerPoint PPT Presentation

antifragile software and genetic improvement martin
SMART_READER_LITE
LIVE PREVIEW

Antifragile Software and Genetic Improvement Martin Monperrus - - PowerPoint PPT Presentation

Antifragile Software and Genetic Improvement Martin Monperrus University of Lille & Inria, France CREST Open Workshop on Genetic Improvement Jan 2016 1 Martin Monperrus, University of Lille & Inria, France Exception Handling Analysis


slide-1
SLIDE 1

1

Martin Monperrus, University of Lille & Inria, France

Martin Monperrus University of Lille & Inria, France Antifragile Software and Genetic Improvement

CREST Open Workshop on Genetic Improvement Jan 2016

slide-2
SLIDE 2
slide-3
SLIDE 3

3

Martin Monperrus, University of Lille & Inria, France Exception Handling Analysis and Transformation Using Fault Injection: Study of Resilience Against Unanticipated Exceptions (IST 2014)

try { prepare_meringue() add_cream() make_balls() add_chocolate_shavings() } catch (MissingChocolateEx e) { use_nutella(); } « Anticipated errors »

slide-4
SLIDE 4

4

Martin Monperrus, University of Lille & Inria, France

  • Test colors

– Pink – Blue

  • White

Expected errors in test suites

Blue and white tests specify anticipated errors White tests specify resilience

slide-5
SLIDE 5

5

Martin Monperrus, University of Lille & Inria, France

Empirical results

3950 2046 2031 481 406 339 191 135 100 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% white blue pink

slide-6
SLIDE 6

6

Martin Monperrus, University of Lille & Inria, France

Our intuition: simulating unforeseen errors by perturbing test case execution

slide-7
SLIDE 7

7

Martin Monperrus, University of Lille & Inria, France

Why ?

slide-8
SLIDE 8

8

Martin Monperrus, University of Lille & Inria, France

Short circuit testing: Exception injection in test suites

+ =

White test

throw new X()

slide-9
SLIDE 9

9

Martin Monperrus, University of Lille & Inria, France

The try-catch blocks that keep the tests passing under exception injection are capable to handle unanticipated errors. We call them ''source-independent''.

Source-Independence

We call them ''source-independent''.

Empirical assessment of resilience against unforeseen errors

slide-10
SLIDE 10

10

Martin Monperrus, University of Lille & Inria, France

shindig-java-gadgets Commons-lang commons-codec sonar core shindig-common jbehave core joda time sonar plugin api spojo core 5 10 15 20 25 30 35 40 45 non agnostique agnostique

Empirical Evaluation

dependent independent

slide-11
SLIDE 11

11

Martin Monperrus, University of Lille & Inria, France

Test driver

try{ // instrumentation code if(Controller.isCurrentTryCatchWithInjection()) throw new Exception(); } ... //normal try body ... } catch ( Exception e ) { ... //normal catch body } IO IO // Genetic Improvement

slide-12
SLIDE 12

12

Martin Monperrus, University of Lille & Inria, France

Limit cases

Stack of try-catch at runtime // original Catch (OufofMemory) { Catch (NullPointer) { Catch (IOException) { } } } // stretched Catch (OufofMemory) { Catch (NullPointer) { Catch (Exception) { } } } throw new NullPointerException()

slide-13
SLIDE 13

13

Martin Monperrus, University of Lille & Inria, France

Empirical Evaluation

dependent independent

commons-lang commons-codec joda time spojo core sonar core sonar plugin jbehave core shindig-java-gadgets shindig-common 5 10 15 20 25 30 35 unstretchable stretchable

slide-14
SLIDE 14

14

Martin Monperrus, University of Lille & Inria, France

Take-away

“We inject exceptions during test suite execution to assess and improve resilience”

References: Exception Handling Analysis and Transformation Using Fault Injection: Study of Resilience Against Unanticipated Exceptions (Benoit Cornu, Lionel Seinturier, Martin Monperrus), In Information and Software Technology, Elsevier, 2014.

slide-15
SLIDE 15

15

Martin Monperrus, University of Lille & Inria, France

Definition A thing is antifragile if it becomes

better with stressors, shocks, volatility, noise, mistakes, faults, attacks, failures . . .

(Antifragile, N. N. Taleb, 2013)

slide-16
SLIDE 16

16

Martin Monperrus, University of Lille & Inria, France

A software system is antifragile if it becomes

better with failures, attacks, failures, misconfigurations, weird usages . . .

(Principles of Antifragile Software, M. Monperrus, 2014)

slide-17
SLIDE 17

17

Martin Monperrus, University of Lille & Inria, France

Short circuit testing is antifragile:

  • Better with exception

injection

  • Does not try to anticipate or

predict

slide-18
SLIDE 18

18

Martin Monperrus, University of Lille & Inria, France

Chaos Monkey

// Chaos Engineering // principlesofchaos.org, 2015 hypothesis ← perturbation, measure while (true) { perturb if (measure unacceptable) { report failure } }

slide-19
SLIDE 19

19

Martin Monperrus, University of Lille & Inria, France

Antifragile software engineering Core model:

  • perturbation model
  • perturbation controller
  • perturbation cost
  • perturbation gain

http://www.monperrus.net/martin/antifragile-software