30
Populations, Variety and Selection: Verifying Complex Designs 5/6/2011 1 Austin DVClub 4/19/2011 Ken Albin [email protected]

Populations, Variety, and Selection: Verifying Complex Designs

  • Upload
    dvclub

  • View
    121

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Populations, Variety, and Selection: Verifying Complex Designs

Populations, Variety and Selection: Verifying Complex Designs

5/6/2011 1

Austin DVClub 4/19/2011Ken Albin

[email protected]

Page 2: Populations, Variety, and Selection: Verifying Complex Designs

What is going on?

Why is it that no matter how thorough we are:

customers still find bugs?

randomization finds combinations we didn't think about for our directed tests?

writing formal properties finds errors and ambiguities in the specification?

Is doing the same thing more efficiently really going to get us to a higher level of quality sooner?

5/6/2011 Austin DVClub,

[email protected]

2

Page 3: Populations, Variety, and Selection: Verifying Complex Designs

Why this talk?

Verification planning is often focused on low-level details without first considering the higher-level alternatives.

Focus on ROI seems to be taking us away from methods employing variety.

Complexity is the root problem we struggle with – what can we learn from complexity research?

5/6/2011 Austin DVClub,

[email protected]

3

Page 4: Populations, Variety, and Selection: Verifying Complex Designs

What are complex systems?

It turns out that there are several definitions and models of complex systems, generally tuned to the field in which they are being used.

In the book Harnessing Complexity, Axelrod and Cohen describe systems “...where the full consequences of actions may be hard – even impossible – to predict.”

Their Complex Adaptive Systems model captured ideas I saw applied in successful verification planning and execution efforts.

5/6/2011 Austin DVClub,

[email protected]

4

Page 5: Populations, Variety, and Selection: Verifying Complex Designs

5/6/2011 Austin DVClub,

[email protected]

5

A Brief Introduction to Complex Adaptive Systems

Page 6: Populations, Variety, and Selection: Verifying Complex Designs

Complex Adaptive Systems (CAS)

Axelrod and Cohen's CAS framework combines aspects of two familiar complex systems:

Biological systems

Agent-based software systems

The result is a framework for reasoning about complex systems – not a magic oracle, but an aid to decision making.

5/6/2011 Austin DVClub,

[email protected]

6

Page 7: Populations, Variety, and Selection: Verifying Complex Designs

A simplified CAS model

5/6/2011 Austin DVClub,

[email protected]

7

Agent/Strategy 1

Done!

Agent/Strategy 2

Agent/Strategy 3

Agent/Strategy 4

Agent/Strategy N

...

As an example, let's talk about growing apples.

Page 8: Populations, Variety, and Selection: Verifying Complex Designs

Populations of agents or strategies

5/6/2011 Austin DVClub,

[email protected]

8

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

In CAS, there is a pool of different types of agents or strategies in action, each attempting to accomplish the same goal.

Page 9: Populations, Variety, and Selection: Verifying Complex Designs

Selecting the amount of variety

5/6/2011 Austin DVClub,

[email protected]

9

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

Weighting of the different agents or strategies happens initially and is adjusted during execution.

Page 10: Populations, Variety, and Selection: Verifying Complex Designs

Exploitation (limiting variety)

5/6/2011 Austin DVClub,

[email protected]

10

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

Exploitation selects only the current best solution and avoids less efficient strategies.

Page 11: Populations, Variety, and Selection: Verifying Complex Designs

When to limit varietyExploitation is appropriate if:

You are sure you have the best solution

The problem is not going to change

In our example, if you have determined everyone's favorite apple and are sure there will be no changes in market preference and ideal growing conditions, then producing other types of apples would be a waste of resources.

5/6/2011 Austin DVClub,

[email protected]

11

Page 12: Populations, Variety, and Selection: Verifying Complex Designs

Exploration (encouraging variety)

5/6/2011 Austin DVClub,

[email protected]

12

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

Exploration tries and evaluates different strategies when the best solution is not known.

Page 13: Populations, Variety, and Selection: Verifying Complex Designs

When to encourage varietyExploration is valuable for problems that:

are long term or widespread

provide fast reliable feedback

have low risk of catastrophe from exploration *

have looming disaster

With apple trees, some amount of variety seems prudent.

5/6/2011 Austin DVClub,

[email protected]

13

Page 14: Populations, Variety, and Selection: Verifying Complex Designs

Exploitation vs. Exploration

The big knob to turn in a CAS is the amount of variety in the agents or strategies.

It is often the case that a CAS begins in exploration mode and moves to exploitation over time.

However, reducing variety too quickly results in premature convergence, and too slowly results in eternal boiling

5/6/2011 Austin DVClub,

[email protected]

14

Page 15: Populations, Variety, and Selection: Verifying Complex Designs

Interaction

5/6/2011 Austin DVClub,

[email protected]

15

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

Interaction can create superior new hybrid varieties or strategies which produce better results than the sum of the parts.

Page 16: Populations, Variety, and Selection: Verifying Complex Designs

Extinction

5/6/2011 Austin DVClub,

[email protected]

16

Red Delicious

Done!

Golden Delicious

Granny Smith

Gala

Fuji

...

The loss of available variety may seriously impact the adaptability and robustness of a system.

Page 17: Populations, Variety, and Selection: Verifying Complex Designs

5/6/2011 Austin DVClub,

[email protected]

17

Example: intelligent agents in action

Page 18: Populations, Variety, and Selection: Verifying Complex Designs

Under the hood in formal tools

5/6/2011 Austin DVClub,

[email protected]

18

BDD-based fixpoint

Done!

BDD-ATPG

Random simulation

SAT solver

Symbolic simulation

...

Note: once a successful combination of engines is found through exploration, it can be exploited in “regression mode” as long as the design doesn't change much.

Page 19: Populations, Variety, and Selection: Verifying Complex Designs

5/6/2011 Austin DVClub,

[email protected]

19

Applying the framework to verification planning and execution

Page 20: Populations, Variety, and Selection: Verifying Complex Designs

Checklist for applying the framework

5/6/2011 Austin DVClub,

[email protected]

20

Identify population

Identify selection criteria

Analyze impact of variety

ExploitationBest solution?Stable problem?

ExplorationLong term problem?Fast, reliable feedback?Looming disaster?

Analyze interaction benefits

Analyze extinction risk

Page 21: Populations, Variety, and Selection: Verifying Complex Designs

5/6/2011 Austin DVClub,

[email protected]

21

Example: is it worth achieving 100% coverage?

Page 22: Populations, Variety, and Selection: Verifying Complex Designs

The last few percent

5/6/2011 Austin DVClub,

[email protected]

22

100%

0%

co

ve

rag

e

time/effort

Page 23: Populations, Variety, and Selection: Verifying Complex Designs

Verification planning and execution

5/6/2011 Austin DVClub,

[email protected]

23

Coverage analysis and hole filling

Done!

Writing functional coverage

Writing assertions

Code reviews

Booting a microkernal

...

Bug finding orproof of correctness

Page 24: Populations, Variety, and Selection: Verifying Complex Designs

Identify population

Identify selection criteria

Analyze impact of variety

ExploitationBest solution?Stable problem?

Exploration Long term problem? Fast, reliable feedback? Looming disaster?

Analyze interaction benefits

Analyze extinction risk

100% coverage analysis

5/6/2011 Austin DVClub,

[email protected]

24

Comparison of source and functional coverage, joint code/coverage reviews, formal reachability analysis don't require 100% coverage..

Infrastructure and skills either not created or going stale limit adaptability.

Not known to be best solution, correlating coverage to design changes over time is a problem.

Finding bugs is a problem throughout the product lifetime, methods finding bugs are quickly noticed, disaster is always looming.

Page 25: Populations, Variety, and Selection: Verifying Complex Designs

5/6/2011 Austin DVClub,

[email protected]

25

Example: should multiple simulators be used?

Page 26: Populations, Variety, and Selection: Verifying Complex Designs

Use of multiple simulators

5/6/2011 Austin DVClub,

[email protected]

26

IFV SystemVerilog

Done!

Questa SystemVerilog

VCS SystemVerilog

Symbolic simulator

Spice

...

UVM support,Clarity of messages,

Efficiency, cost

Note: this analysis is focused more on the robustness of the environment rather than efficiency in finding bugs.

Page 27: Populations, Variety, and Selection: Verifying Complex Designs

Identify population

Identify selection criteria

Analyze impact of variety

Exploitation Best solution?Stable problem?

Exploration Long term problem? Fast, reliable feedback? Looming disaster?

Analyze interaction benefits

Analyze extinction risk

Choice of multiple simulators

5/6/2011 Austin DVClub,

[email protected]

27

Alternatives not available in case of implementation show stopper or vendor switch.

Cross check LRM conformance, clarity of error messages, identifying race conditions.

One simulator may be more efficient for some classes of problem, but if new language features are being added (e.g., SVTB) the problem may not be stable.

The feature implementations may not be resolved by the end of the project, feedback is nearly immediate, and disaster is always looming.

Page 28: Populations, Variety, and Selection: Verifying Complex Designs

Other verification examples

emulation vs. sim farm

rerunning unit tests vs. system tests

static analysis vs. simulation

code reviews vs. writing assertions

5/6/2011 Austin DVClub,

[email protected]

28

Page 29: Populations, Variety, and Selection: Verifying Complex Designs

Key ideas

We need to consider exploitation vs. exploration trade-offs in verification planning and execution.

Variety from exploration provides more robustness and is more easily adapted to changing requirements.

Plan for interaction between strategies to achieve better overall results.

5/6/2011 Austin DVClub,

[email protected]

29

Page 30: Populations, Variety, and Selection: Verifying Complex Designs

Further info

There are many different definitions of complex systems, but the ideas for this talk were based on the definition of Complex Adaptive Systems found in this book:

Harnessing Complexity: Organizational Implications of a Scientific Frontier (2001) by Robert Axelrod, Michael D Cohen (amazon link)

5/6/2011 Austin DVClub,

[email protected]

30