Ten Commandments Of A Software Engineer

Preview:

DESCRIPTION

Software engineering is not an easy profession. You have to constantly learn new things to improve your coding skills and make sure you produce better and cleaner code over time. It’s not difficult, but you have to be aware of a few basic principles. With them in mind you will feel a better engineer and will gain respect from your fellow engineers. And the Lord said: “Thou shall always remember to write unit tests - no matter the deadline. Remember to keep the build green. Thou shall commit often and with meaningful messages (...)”

Citation preview

Ten Commandments Of A Software Engineer

Sebastian Marek, Internal Systems Technical Architect

PHP UKCONFERENCE 2013

✴ a Pole living in Sheffield

✴ over 12 years in development

✴ Pascal, C++, PHP, perl, python, Java

✴ co-author of 2 PHP Books

✴ big fan of process automation

✴ TDD and CI

✴ occasionally contributes to open-source projects

✴ wants to be a knight

@proofek

h"ps://joind.in/8050

http://www.flickr.com/photos/archeon/8107633765

Couple that work for me

http://www.reverendfun.com/?date=20010207

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

“I.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  disrupt����������� ������������������  the����������� ������������������  legacy����������� ������������������  system”

✴ obsolete technology

✴ business critical

✴ poorly documented

✴ change risk

✴ costly maintenance

Problem:

http://www.flickr.com/photos/tomswift/4253985734/

✴ extraction

✴ refactoring

✴ blackbox

✴ well defined interface

Solution:

h"p://www.flickr.com/photos/youraccount/3939769126

“II.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  document����������� ������������������  early����������� ������������������  and����������� ������������������  

while����������� ������������������  thy����������� ������������������  mind����������� ������������������  is����������� ������������������  fresh”

✴ document from the beginning of the project

✴ developer’s documentation

✴ end-user documentation

✓ automated documentation

✓ real world examples

✓ hints and tips

✓ internal

✓ external

h"p://www.flickr.com/photos/jannem/510243975/

“III.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  speak����������� ������������������  up����������� ������������������  early����������� ������������������  and����������� ������������������  often”

✴ effective communication within team

✴ effective communication within business

✴ no decisions vs. bad decisions

✓ communication channels

✓ open and honest

✓ provide options

✓ trust

✓ weak and strong points

h"p://www.flickr.com/photos/redspike/5622332401/

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

“IV.����������� ������������������  Designeth����������� ������������������  not����������� ������������������  for����������� ������������������  complexity,����������� ������������������  but����������� ������������������  for����������� ������������������  simplicity;����������� ������������������  and����������� ������������������  

wherever����������� ������������������  the����������� ������������������  Beast����������� ������������������  named����������� ������������������  Complex����������� ������������������  shall����������� ������������������  rear����������� ������������������  its����������� ������������������  ugly����������� ������������������  head,����������� ������������������  

smiteth����������� ������������������  it����������� ������������������  with����������� ������������������  thy����������� ������������������  Sword����������� ������������������  named����������� ������������������  Modular,����������� ������������������  and����������� ������������������  let����������� ������������������  no����������� ������������������  Module����������� ������������������  be����������� ������������������  known����������� ������������������  by����������� ������������������  the����������� ������������������  Name����������� ������������������  of����������� ������������������  the����������� ������������������  Beast.”

✴ the curse of over-engineering

✴ convention over configuration design paradigm

✴ complex problems are best solved using simple solutions

h"p://www.flickr.com

/pho

tos/kelp/4894023263

h"p://www.flickr.com

/pho

tos/kelp/4894889826

“Make����������� ������������������  everything����������� ������������������  as����������� ������������������  simple����������� ������������������  as����������� ������������������  possible,����������� ������������������  but����������� ������������������  not����������� ������������������  simpler”

h"p://commons.wikimedia.org/wiki/Image:Albert_Einstein_Head.jpg

“V.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  re-invent����������� ������������������  the����������� ������������������  wheel”

✴ repeatable operations

✴ in-house frameworks

✴ open-source frameworks

✴ training and support costs

h"p://www.flickr.com/photos/raoulpop/2280399565/

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

“VI.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  commit����������� ������������������  often����������� ������������������  and����������� ������������������  

your����������� ������������������  messages����������� ������������������  shalt����������� ������������������  be����������� ������������������  informative”

✴ right tool for the job

✴ commit frequency

✴ commit verbosity

h"p://www.flickr.com/photos/27594459@N04/5941708682/

Meaningless commit messages

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <generic@email.net>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

commit 38b22c0b4ed15ddf003d6e1d7fb879349a867957Author: Other Stuff Guy <otherstuff@email.net>Date: Mon Nov 22 16:26:27 2010 +0000

Changes to cancel other code

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <generic@email.net>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Verbose Guy <verboseguy@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Expand on comment

commit 38b22c0b4ed15ddf003d6e1d7fb879349a867957Author: Other Stuff Guy <otherstuff@email.net>Date: Mon Nov 22 16:26:27 2010 +0000

Changes to cancel other code

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <generic@email.net>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

Useless commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <fixedguy@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

Useless commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <fixedguy@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

commit a69657b2045f1105cc940b67bab4b80b0e07ebe9Author: Did Tests Guy <didtests@email.net>Date: Tue Mar 22 15:29:03 2011 +0000

Unit tests to prove the fix

Useless commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <fixedguy@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

commit a69657b2045f1105cc940b67bab4b80b0e07ebe9Author: Did Tests Guy <didtests@email.net>Date: Tue Mar 22 15:29:03 2011 +0000

Unit tests to prove the fix

commit af1e80d98c9d8b6fe40efd3eadc27a9d4b1a2420Author: Failed Codereview Guy <failedreview@email.net>Date: Wed Nov 24 17:07:16 2010 +0000

Code review changes, rename file

Useless commit messages

Informative commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: ProperComment Guy <propercomment@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed <TicketID>: Scheduled changes cancelled without cancelling engineering appointment

Do not let scheduled changes to be cancelled without calling in, as there is an appointment that needs to be cancelled

Informative commit messages

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: ProperComment Guy <propercomment@email.net>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed <TicketID>: Scheduled changes cancelled without cancelling engineering appointment

Do not let scheduled changes to be cancelled without calling in, as there is an appointment that needs to be cancelled

commit af1e80d98c9d8b6fe40efd3eadc27a9d4b1a2420Author: ProperComment Guy <propercomment@email.net>Date: Wed Nov 24 17:07:16 2010 +0000

Fixed <TicketID>: Missing data in migration email

Added the extra variables in the email needed for a customer migrating from <a product>

Informative commit messages

“VII.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  kill����������� ������������������  (maintainability)”

✴ coding standards that everybody follows

✴ keep your code under control

✴ remove dead code

✓ size

✓ complexity

h"p://www.flickr.com/photos/brykmantra/76765412

“VIII.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  repeat����������� ������������������  yourself”

✴ copy/paste temptation

✴ clones mutation

✴ extract and reuse ASAP

✴ tools that support clone detection

h"p://www.flickr.com/photos/via/6182784051/

Project cycle phases

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

“IX.����������� ������������������  Fear����������� ������������������  not����������� ������������������  the����������� ������������������  Priests����������� ������������������  of����������� ������������������  Quality����������� ������������������  Assurance����������� ������������������  nor����������� ������������������  the����������� ������������������  Altar����������� ������������������  of����������� ������������������  Testability,����������� ������������������  

though����������� ������������������  they����������� ������������������  be����������� ������������������  stained����������� ������������������  with����������� ������������������  the����������� ������������������  blood����������� ������������������  of����������� ������������������  thy����������� ������������������  brethren;����������� ������������������  

for����������� ������������������  they����������� ������������������  are����������� ������������������  the����������� ������������������  Salvation����������� ������������������  of����������� ������������������  the����������� ������������������  Righteous,����������� ������������������  and����������� ������������������  the����������� ������������������  Servants����������� ������������������  of����������� ������������������  our����������� ������������������  Lord,����������� ������������������  the����������� ������������������  Customer.”

✴ manual testing vs. automated

✴ unit tests

✴ functional tests

✴ frequent and early integration

✴ setup CI server

✴ fix bugs ASAP

✴ take ownership

h"p://www.flickr.com/photos/alisdair/135306281

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

“X.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  recognize����������� ������������������  and����������� ������������������  retain����������� ������������������  your����������� ������������������  top����������� ������������������  talent”

✴ non fungible people

✴ experience + talent

✴ retention policy

✴ “hit by a bus” vs. “upset and unhappy”

✴ people gardening - fertilizers vs. weed control

h"p://www.flickr.com/photos/javacolleen/2897180413/

The 10 commandments of a Software EngineerI. Thou shalt not disrupt the legacy system

II. Thou shalt document early and while thy mind is fresh

III. Thou shalt speak up early and often

IV. Designeth not for complexity, but for simplicity ...

V. Thou shalt not re-invent the wheel

VI. Thou shalt commit often and your messages shalt be informative

VII. Thou shalt not kill (maintainability)

VIII. Thou shalt not repeat yourself

IX. Fear not the Priests of Quality Assurance ...

X. Thou shalt recognize and retain your top talent

Further reading

✴ The Ten Commanndments of Software Engineering✓ http://bit.ly/IgHZTu

✴ The Ten Commandments of Software Quality✓ http://bit.ly/yJfatp

✴ The Ten Commandments of Egoless Programming✓ http://bit.ly/atT1F9

✴ http://www.commitlogsfromlastnight.com/

Robert C. Martin@unclebobmartin

✴ http://cleancoder.posterous.com/

✴ http://blog.8thlight.com/

✴ http://cleancoders.com/

✴ http://manifesto.softwarecraftsmanship.org/

✴ http://katas.softwarecraftsmanship.org/

Software craftsmanship

h"p://www.flickr.com/photos/the-­‐g-­‐uk/7221928760

Q&Ah"ps://joind.in/8050

Recommended