ontogeny of unit testsin test driven development

80
Ontogeny of Unit Tests in Test Driven Development June Kim President, Agile Consulting [email protected]

Upload: june-kim

Post on 24-May-2015

333 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Ontogeny of Unit Testsin Test Driven Development

Ontogeny of Unit Testsin

Test Driven Development

June KimPresident, Agile [email protected]

Page 2: Ontogeny of Unit Testsin Test Driven Development

Good Software

Page 3: Ontogeny of Unit Testsin Test Driven Development

Nature of Order

Page 4: Ontogeny of Unit Testsin Test Driven Development

Christopher Alexander

Page 5: Ontogeny of Unit Testsin Test Driven Development

Living Structure

Page 6: Ontogeny of Unit Testsin Test Driven Development

Wholeness

Page 7: Ontogeny of Unit Testsin Test Driven Development

Life

Page 8: Ontogeny of Unit Testsin Test Driven Development

Which one of these two things

would I prefer to become by the day of my death?

Page 9: Ontogeny of Unit Testsin Test Driven Development

Comparing A and B,

which one makes me feel the most wholeness in myself,

which one allows me to come closest to my own life,

which makes me experience life most deeply?

Page 10: Ontogeny of Unit Testsin Test Driven Development

Mistake-free

Page 11: Ontogeny of Unit Testsin Test Driven Development

Ontogeny

Page 12: Ontogeny of Unit Testsin Test Driven Development

Morphogenesis

Page 13: Ontogeny of Unit Testsin Test Driven Development

Differentiation

Page 14: Ontogeny of Unit Testsin Test Driven Development

Structure Preserving Transformation

Page 15: Ontogeny of Unit Testsin Test Driven Development
Page 16: Ontogeny of Unit Testsin Test Driven Development
Page 17: Ontogeny of Unit Testsin Test Driven Development
Page 18: Ontogeny of Unit Testsin Test Driven Development

Henry Matisse

Page 19: Ontogeny of Unit Testsin Test Driven Development
Page 20: Ontogeny of Unit Testsin Test Driven Development
Page 21: Ontogeny of Unit Testsin Test Driven Development
Page 22: Ontogeny of Unit Testsin Test Driven Development
Page 23: Ontogeny of Unit Testsin Test Driven Development
Page 24: Ontogeny of Unit Testsin Test Driven Development
Page 25: Ontogeny of Unit Testsin Test Driven Development
Page 26: Ontogeny of Unit Testsin Test Driven Development
Page 27: Ontogeny of Unit Testsin Test Driven Development
Page 28: Ontogeny of Unit Testsin Test Driven Development
Page 29: Ontogeny of Unit Testsin Test Driven Development
Page 30: Ontogeny of Unit Testsin Test Driven Development
Page 31: Ontogeny of Unit Testsin Test Driven Development
Page 32: Ontogeny of Unit Testsin Test Driven Development
Page 33: Ontogeny of Unit Testsin Test Driven Development
Page 34: Ontogeny of Unit Testsin Test Driven Development

Center

Page 35: Ontogeny of Unit Testsin Test Driven Development

Pattern

Page 36: Ontogeny of Unit Testsin Test Driven Development

Sequence

Page 37: Ontogeny of Unit Testsin Test Driven Development

Living Process

Page 38: Ontogeny of Unit Testsin Test Driven Development

Unfolding

Page 39: Ontogeny of Unit Testsin Test Driven Development

Generative

Page 40: Ontogeny of Unit Testsin Test Driven Development

1. think about the activities in your kitchen and formulate them as generic centers2. decide the size and shape of the kitchen3. place windows in the kitchen, to bring beautiful light into the room4. place a big kitchen table as the main focus of the kitchen5. place a fireplace to form a secondary center in the room6. place an outdoor kitchen garden, according to sun and wind and view7. place a door leading to the outdoors8. place the kitchen counter and your workspace in a good relationship to the main centers9. put in thick walls around the room, to supplement the table, fire, and counter

unfolding sequence of kitchen design

Page 41: Ontogeny of Unit Testsin Test Driven Development

Do one small good thing; then do another small good thing; then do another good thing

After a person has grasped that idea, I may then point out that sometimes, the good things that we do work even better if each small good thing also helps to achieve some slightly larger good thing.

How to improve a corner of a garden

Page 42: Ontogeny of Unit Testsin Test Driven Development

15 Properties

Page 43: Ontogeny of Unit Testsin Test Driven Development

15 Properties of Natural Morphology

1. Levels of scale 2. Strong centers 3. Boundaries

4. Alternating Repetition 5. Positive Space 6. Good shape

7. Local Symmetries 8. Deep Interlock and Ambiguity 9. Contrast

15. Not-separateness 13. The Void 14. Simplicity and inner calm

10. Gradients 11. Roughness 12. Echoes

Page 44: Ontogeny of Unit Testsin Test Driven Development

15 Transformations

Page 45: Ontogeny of Unit Testsin Test Driven Development

Levels of Scale

Page 46: Ontogeny of Unit Testsin Test Driven Development

Strong Centers

Page 47: Ontogeny of Unit Testsin Test Driven Development

Boundaries

Page 48: Ontogeny of Unit Testsin Test Driven Development

Alternating Repetition

Page 49: Ontogeny of Unit Testsin Test Driven Development

Positive Space

Page 50: Ontogeny of Unit Testsin Test Driven Development

Good Shape

Page 51: Ontogeny of Unit Testsin Test Driven Development

Local Symmetries

Page 52: Ontogeny of Unit Testsin Test Driven Development

Deep Interlock and Ambiguity

Page 53: Ontogeny of Unit Testsin Test Driven Development

Contrast

Page 54: Ontogeny of Unit Testsin Test Driven Development

Gradients

Page 55: Ontogeny of Unit Testsin Test Driven Development

Roughness

Page 56: Ontogeny of Unit Testsin Test Driven Development

Echoes

Page 57: Ontogeny of Unit Testsin Test Driven Development

The Void

Page 58: Ontogeny of Unit Testsin Test Driven Development

Simplicity and Inner Calm

Page 59: Ontogeny of Unit Testsin Test Driven Development

Not-Separateness

Page 60: Ontogeny of Unit Testsin Test Driven Development

Media Art

Page 61: Ontogeny of Unit Testsin Test Driven Development

Programming Demo

Page 62: Ontogeny of Unit Testsin Test Driven Development

Luhn Algorithm

Page 63: Ontogeny of Unit Testsin Test Driven Development

8763: 1+6(8*2) + 7 + 1+2(6*2) + 3 mod

10

Page 64: Ontogeny of Unit Testsin Test Driven Development

return 60;

5 주

First center

Page 65: Ontogeny of Unit Testsin Test Driven Development

6 주

return 5 + 4 + 9 + 4 + 1 + 7 + 3 + 5 + 7 + 3

Strong CentersLocal Symmetries

Page 66: Ontogeny of Unit Testsin Test Driven Development

8 주

return (1+4) + 4 + (1+8) + 4 + (1+0) + 7 + (1+2) + 5 + (1+6) + 3

Local SymmetriesAlternating Repetition

Page 67: Ontogeny of Unit Testsin Test Driven Development

8.5 주

result = reduce(14) + 4 + (1+8) + 4 + (1+0) + 7 + (1+2) + 5 + (1+6) + 3;

return result;

Strong Centers

Page 68: Ontogeny of Unit Testsin Test Driven Development

9 주

result = reduce(14) + 4 + reduce(18) + 4 + reduce(10) + 7 + reduce(12) + 5 + reduce(16) + 3;

return result;

Local Symmetries

Page 69: Ontogeny of Unit Testsin Test Driven Development

10 주

result = reduce(7 * 2) + 4 + reduce(9 * 2) + 4 + reduce(5 * 2) + 7 + reduce(6 * 2) + 5 + reduce(8 * 2) + 3;

return result;Local Symmetries

Page 70: Ontogeny of Unit Testsin Test Driven Development

13 주char *s = “7494576583”;

result = reduce(dat(s, 0) * 2) + dat(s, 1) + reduce(dat(s, 2) * 2) +

dat(s, 3) + reduce(dat(s, 4) * 2) + dat(s, 5) + reduce(dat(s, 6) * 2) + dat(s, 7) + reduce(dat(s, 8) * 2) + dat(s, 9);

return result;Good Shape

Page 71: Ontogeny of Unit Testsin Test Driven Development

15 주char *s = “7494576583”;

result = reduce(dat(s, 0) * 2) + reduce(dat(s, 1)) + reduce(dat(s, 2) * 2) +reduce(dat(s, 3)) + reduce(dat(s, 4) * 2) + reduce(dat(s, 5)) + reduce(dat(s, 6) * 2) + reduce(dat(s, 7)) + reduce(dat(s, 8) * 2) + reduce(dat(s, 9));

return result;Strong CentersEchoes

Page 72: Ontogeny of Unit Testsin Test Driven Development

20 주char *s = “7494576583”;

pos = len = strlen(s);for (i = 0; i < len; i++) { if ((pos – 2) % 2) result = result + reduce(dat(s, i)); else result = result + reduce(dat(s, i) * 2); pos--;}

return result;Simplicity and Inner Calm

Page 73: Ontogeny of Unit Testsin Test Driven Development

30 주char *s = “7494576583”;

len = strlen(s);for (i = 0; i < len; i++) { if (((len-i) – 2) % 2) result += reduce(dat(s, i)); else result += reduce(dat(s, i) * 2);}

return result;

Page 74: Ontogeny of Unit Testsin Test Driven Development

40 주

len = strlen(s);for (i = 0; i < len; i++) { if (((len-i) – 2) % 2) result += reduce(dat(s, i) * 1); else result += reduce(dat(s, i) * 2);}

return result;

Page 75: Ontogeny of Unit Testsin Test Driven Development

42 주

len = strlen(s);for (i = 0; i < len; i++) { result += reduce(dat(s, i) * (2-(len-i) % 2));} return result;

Page 76: Ontogeny of Unit Testsin Test Driven Development

int dat(char *s, int i) {return s[i]-'0';}int reduce(int n) {return n>=10 ? n-9 : n;}

int coef(int l, int i) { int ri=l-i, even=!(ri%2); return even+1;}

int checksum(char *s) { int i, result=0, l = strlen(s); for (i = 0; i < l; i++) result += reduce(coef(l,i) * dat(s, i)); return result;}

Page 77: Ontogeny of Unit Testsin Test Driven Development

Applicationsto larger scale

Page 78: Ontogeny of Unit Testsin Test Driven Development

such as… Features

Page 79: Ontogeny of Unit Testsin Test Driven Development

Wrap Up

Page 80: Ontogeny of Unit Testsin Test Driven Development

?/!