The “transformation priority premise”

Post on 16-Jan-2017

436 views 0 download

Transcript of The “transformation priority premise”

The “Transformation Priority Premise”

Christian Hujer @christianhujer,CEO/CTO Nelkinda Software Craft Pvt Ltd

Equal Experts at NOTHS 2015-11-25

Aliens?

N = R* × fp × ne × fl × fi × fc × LR* average rate of star formation in our galaxyfp fraction of stars that have planetsne average number of planets per star that can potentially support lifefl fraction of planets that actually develop lifefi fraction of planets that develop intelligent lifefc fraction of civilizations that develop technologyL length of time for which such civilizations release detectable signals into space

The Drake equation

Dr. Frank Drake

The Fermi Paradox

Enrico Fermi

“Then where is everybody?”

Speculation

How do you explain (“solve”) the Fermi Paradox?

Speculation

● We are the only ones● Intelligent life destroys itself● Intelligent life destroys others● Life is periodically destroyed by nature● Most universes are (too) young● Too far scattered● Too expensive to spread through galaxy

Speculation (continued)

● We’re not around long enough● We’re not listening properly● Radio signals only used for brief period● Civilizations isolate themselves● They are too alien● They are non-technological● Everyone is listening, no one transmitting

Speculation (continued)

● Earth is deliberately not contacted (zoo)● Earth is purposely isolated (planetarium)● It is dangerous to communicate● Self-fulfilling Fermi-Paradox● They are undetected● They are unacknowledged

Agenda

● Reprise: TDD - The Three Laws and the Red-Green-Refactor Cycle

● Reprise: What is Refactoring?● Definition: What is Transformation?● The (current) Priority list of Transformations● Example

Questions to Cover

● What is a Transformation?● Why do they have Priorities?● Why is it a Premise?● How is it related to Refactoring and TDD?● How can I use it? How does it help me?

The Three Laws of TDD

1. You can’t write any production code until you first have written a failing unit test.

2. You can’t write more of a unit test than is sufficient to fail, and not compiling is failing.

3. You can’t write more production code than is sufficient to pass the currently failing unit test.

The Red-Green-Refactor CycleRed: Write as much of test as is sufficient to fail.

Green: Write as much of production code as is sufficient to pass.

Refactor: Well, refactor!

Refactoring

Refactoring, n:A change to the structure of source code without significantly changing its behavior.

Transformation

Transformation, n:A change to the behavior of source code without significantly changing its structure.

List of Transformations● {} → nil● nil → constant● constant → constant +● constant → scalar● statement → statements● unconditional → if

● scalar → array● array → container● statement → recursion● if → while● expression → function● variable → assignment

How it works

● The first unit test should demand the first transformation.

● The next unit test should demand the simplest next transformation possible.

● Apply the simplest transformations that still satisfy the test.

● And: Red → Green → Refactor

Who invented it?Robert “Uncle Bob” C. Martin● Red-Green-Refactor● Three Laws of TDD● Transformation Priority Premise● SOLID Principles● …

Thank you!Questions?

Follow me on Twitter: @christianhujer