Coding Dojo Vienna:
Bank OCR Outside-In
Session 20150428
#CodingDojoVie
Peter Kofler, ‘Code Cop’
@codecopkofler
www.code-cop.org
Copyright Peter Kofler, licensed under CC-BY.
Peter Kofler
• Ph.D. (Appl. Math.)
• Professional Software
Developer for 15 years
• “fanatic about code quality”
• I help development teams
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Coding Dojo Mindset
●
Safe place outside
work
●
We are here to learn
●
Need to slow down
●
Focus on doing it right
●
Collaborative Game
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
“London” Constraint*
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
*) London School TDD is Outside-In but Classic TDD can be as well
Outside-In TDD
●
build the system from the "outside-in",
following the user interaction
through all the parts of the system
●
(maybe) create a Guiding Test
●
start with top level interactions/collaborators
●
create fake dependencies or mock them
●
implement using TDD until all tests green
●
move "inside" to previously faked collaborator
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Assignment
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Bank OCR
●
You work for a bank, which has a machine to assist in reading
letters. The machine scans the paper documents, and produces
a file with a number of entries which each look like this:
····_··_·····_··_··_··_··_·
··|·_|·_||_||_·|_···||_||_|
··||_··_|··|·_||_|··||_|·_|
●
Each entry is 4 lines long, each line has 27 characters. The first
3 lines contain an account number written using pipes and
underscores, and the fourth line is blank. Each account
number should have 9 digits, all of which should be in the
range 1-9.
●
Write a program that can take this file and parse it into actual
account numbers.
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Prepare
●
Find a pair.
●
Choose a programming language.
●
Java: https://bitbucket.org/pkofler/bankocr-kata-setup
●
JS: https://bitbucket.org/carlosble/bankocr-kata
●
Py: http://technivore.org/posts/2013/12/23/coding-kata-bank-ocr.html
●
See BankOcrTest.java (failing test)
●
guiding test as starting point.
●
Work through outer API
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Don't Focus on
Getting it Done.
F0cus on Doing
It Perfectly.
Closing Circle
●
What did you learn today?
●
What surprised you today?
●
What will you do
differently in the
future?
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
Peter Kofler
@codecopkofler
www.code-cop.org
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
CC Images
●
Bank https://www.flickr.com/photos/bigmacsc99/4325336251
●
Dojo
http://www.flickr.com/photos/49715404@N00/3267627038/
●
London https://www.flickr.com/photos/damski/8019978119
●
Wants you http://www.flickr.com/photos/shutter/105497713/
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Coding Dojo: Bank OCR Outside-In (2015)

  • 1.
    Coding Dojo Vienna: BankOCR Outside-In Session 20150428 #CodingDojoVie Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.
  • 2.
    Peter Kofler • Ph.D.(Appl. Math.) • Professional Software Developer for 15 years • “fanatic about code quality” • I help development teams PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 3.
    Coding Dojo Mindset ● Safeplace outside work ● We are here to learn ● Need to slow down ● Focus on doing it right ● Collaborative Game PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 4.
    “London” Constraint* PETER KOFLER,CODE-COP.ORG FANATIC ABOUT CODE QUALITY *) London School TDD is Outside-In but Classic TDD can be as well
  • 5.
    Outside-In TDD ● build thesystem from the "outside-in", following the user interaction through all the parts of the system ● (maybe) create a Guiding Test ● start with top level interactions/collaborators ● create fake dependencies or mock them ● implement using TDD until all tests green ● move "inside" to previously faked collaborator PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 6.
    Assignment PETER KOFLER, CODE-COP.ORGFANATIC ABOUT CODE QUALITY
  • 7.
    Bank OCR ● You workfor a bank, which has a machine to assist in reading letters. The machine scans the paper documents, and produces a file with a number of entries which each look like this: ····_··_·····_··_··_··_··_· ··|·_|·_||_||_·|_···||_||_| ··||_··_|··|·_||_|··||_|·_| ● Each entry is 4 lines long, each line has 27 characters. The first 3 lines contain an account number written using pipes and underscores, and the fourth line is blank. Each account number should have 9 digits, all of which should be in the range 1-9. ● Write a program that can take this file and parse it into actual account numbers. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 8.
    Prepare ● Find a pair. ● Choosea programming language. ● Java: https://bitbucket.org/pkofler/bankocr-kata-setup ● JS: https://bitbucket.org/carlosble/bankocr-kata ● Py: http://technivore.org/posts/2013/12/23/coding-kata-bank-ocr.html ● See BankOcrTest.java (failing test) ● guiding test as starting point. ● Work through outer API PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 9.
    Don't Focus on Gettingit Done. F0cus on Doing It Perfectly.
  • 10.
    Closing Circle ● What didyou learn today? ● What surprised you today? ● What will you do differently in the future? PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 11.
    Peter Kofler @codecopkofler www.code-cop.org PETER KOFLER,CODE-COP.ORG FANATIC ABOUT CODE QUALITY
  • 12.
    CC Images ● Bank https://www.flickr.com/photos/bigmacsc99/4325336251 ● Dojo http://www.flickr.com/photos/49715404@N00/3267627038/ ● Londonhttps://www.flickr.com/photos/damski/8019978119 ● Wants you http://www.flickr.com/photos/shutter/105497713/ PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY