5. My Journey
• Software Craftsmanship
• First coderetreat outside US
• Many meetings
• Many travels to European communities
• I TAKE Unconference
• SoftDevGang
6. But that wasn’t enough for me
I’m a child of SciFi, born and raised in communist Romania
7. Raising the Bar
As aspiring Software Craftsmen we are raising the bar of profes-
sional software development by practicing it and helping others
learn the craft
9. So I’m very surprised to hear…
I’m Software Crafter, don’t want to hear about agile
I’m doing DevOps, not agile or software development
We want to scale agile, should we do SAFE or LESS?
I’m a CSM, CSPO, CSP, …
I’m interested in code, what relevance do Math / Physics / Human-
ities have ?
16. Usable Software Design
Who uses software designs? Developers (in agile sense, including
programmers, testers, ops, etc)
What if we apply UX techniques to inform our design decisions?
• Personas
• User journeys
• Usability tests
18. By analogy, Usable Software Design helps
• Shorten the time from new developer to productive
• Reduce the number of mistakes the teams make
• Improve team motivation
• Improve team productivity
24. Code is a Material we use for Prototyping
Is it a …
• Crystalline / non-crystalline Solid?
• Gas?
• Liquid?
• Plasma?
• Non-newtonian fluid?
• Something else?
25. Code as a “Physical” material
Forces:
• Change - add some more code, remove some code, modify some code
• Execution - pass some inputs, read the outputs
Constraint:
• Coherence - code runs and produces desirable results
Mechanical properties:
• Rigidity: unevenly distributed
27. Materials Science + Software Design = Some Equations and new approaches?
• Could we compute the rigidity distribution of code? Aka an integration
of coupling over the code topology ?
• Could we compute the effect of change on the rigidity distribution?
• Could we visualize the rigidity distribution?
• Could we interact with code through the plasticine-like view?
30. Maths is Fun!
1 + 2 + 3 + 4 + … = ?
Ramanujan extension to addition gives the result -1/12.
This is used in physics (eg. string theory).
Watch the video here: Mathologer: Ramanujan: Making sense of 1+2+3+… =
-1/12 and Co.
36. Idea: Use Lambda calculus to refactor legacy code
1. Pick a region of code to refactor
2. Turn it into a big, ugly lambda through safe refactoring (aka separate
from state and dependencies)
3. Decompose the big ugly lambda into small nice lambdas
4. Reorganize lambdas into small objects based on cohesion or
duplication of parameters
37. Algorithm v2
From any code region to big, ugly lambda:
1. Pick a set of statements
2. Extract to a function
3. Make the function static and immutable
4. For each compilation error, either: replace state with parameters and
return values or extract another lambda
5. Simplify through currying, functional composition or lambda injection
38. Experimental result
// Groovy version of trivia legacy code base
private static pure_Roll(
final currentPlayerInPenaltyBoxFunction,
final printCurrentPlayerNameFunction,
final printRollFunction,
final isRollOddFunction,
final rollOddAndPlayerInPenaltyBoxFunction,
final playerInPenaltyBoxAndRollEvenFunction,
final playerNotInPenaltyBoxFunction
)
Source:
https://github.com/MozaicWorks/trivia/blob/decomposeLambdasTry2/
groovy/src/main/groovy/com/adaptionsoft/games/uglytrivia/Game.groovy
39. Experimental result: method body
printCurrentPlayerNameFunction()
printRollFunction()
if (currentPlayerInPenaltyBoxFunction()) {
if (isRollOddFunction()) {
return rollOddAndPlayerInPenaltyBoxFunction()
} else {
return playerInPenaltyBoxAndRollEvenFunction()
}
} else {
return playerNotInPenaltyBoxFunction()
}
41. Maths + Legacy code = ?
• Can we create a method that is mathematically proven to maintain
code behavior?
• And simple enough to learn and apply with modern tools?
43. Built-in self test
A built-in self-test (BIST) or built-in test (BIT) is a mechanism that
permits a machine to test itself. Engineers design BISTs to meet
requirements such as:
• high reliability
• lower repair cycle times
or constraints such as:
• limited technician accessibility
• cost of testing during manufacture
Source: Wikipedia
46. Why not self-contained programs?
usage: createUser -[create|selfSetup|selfTest|selfCleanup]
-create,--create creates a user
-help,--help show usage information
-selfBackup,--self-backup backs up the database
-selfCleanup,--self-cleanup drops database and user
-selfRestore,--self-restore restores the last backup
-selfSetup,--self-setup creates database and user
-selfTest,--self-test runs self test
Source code: https://github.com/MozaicWorks/
SelfContainedProcessesAsMicroservicesDesignStudy
47. Built-in self test, setup, backup, restore + code = ?
• Psychological: No separation between operational needs and
“production” code
• Software engineering: All requirements taken into account, including
ops
• Technical: Little change
49. Problem
Scientific experiments with software development have weird results. Why?
Maybe access issue. Scientists can run experiments either on students, on
open source code bases, or in large companies.
Results don’t fit with software crafters, small / medium companies or
experienced developers.
50. Possible Solution
A CI plugin easy to install and with good default configuration that publishes
anonymous code-related metrics (without the code) to a public repository
accessible to scientists.
55. If we remove all the other difficulties …
Imagine an ideal generation machine.
We turn the requirements into a very specific language:
Given ...
When ...
Then ...
We feed the machine with the requirements.
We get out generated code that matches the requirements.
56. Consequence: turning back time
Did you make a mistake in your requirements? No worries, plug in the
correct ones and get the right code out
Do you want to change something fundamental? No worries, same process
No more design mistakes, no more rigidity
57. How would the ideal generative machine work?
Intuitively:
• Generate more specialized tests from the given / when / then
• Use TDD cycles + Transformations to adjust the code
58. Is this even remotely possible?
I don’t know. Where to start?
60. Your turn
• Software development + biology = ?
• Software development + chemistry = ?
• Software development + quantum physics = ?
• Software development + art = ?
• Software development + writing = ?
• Software development + typography = ?
Start your workgroups!
61. Thank you!
Let’s raise the bar together!
I’ve been Alex Bolboacă, @alexboly, alex.bolboaca@mozaicworks.com
programmer, trainer, mentor, writer
at Mozaic Works
Think. Design. Work Smart.
62. 50% off my books with the code LSCC
Usable Software Design: https://leanpub.com/usablesoftwaredesign/c/lscc
Coderetreat, Hosting and Facilitating:
https://leanpub.com/coderetreat/c/lscc