{ welcome to camdug dojo day thank you to our hosts, granta design (we’re hiring!) sorry for the...
Post on 22-Dec-2015
214 views
TRANSCRIPT
{
Welcome to CAMDUG Dojo Day
Thank you to our hosts, Granta Design (We’re hiring!)Sorry for the lack of internet
Welcome! What is Software Craftsmanship? What is Test-Driven Development (TDD)?
Introduction
Pair Programming Aim for one assertion per test Give your tests fully descriptive names
TestThat_Foo_ShouldReturnBar_WhenBazIsFalse
Session Basics
Method Name
Expectation
Condition
{Roman Numerals2 paired iterations
Introduction to TDD
Roman Numerals Kata
Given a positive integer number determine its Roman numeral representation.
You cannot write numerals like IM for 999
I can be subtracted from V and X only; X can be subtracted from L and C only; C can be subtracted from D and M only
V, L and D can never be subtracted
I = 1 V = 5 X = 10 L = 50 C = 100 D = 500 M = 1000
{Minefield kata2 paired iterations
Cementing your knowledge
Minefield kata
Write a program to output a hint-field where each square is a * for a mine or the number of adjacent mine-squares if the square does not contain a mine.
Minefield kata
Example input4 3*.....*.....
Example output*21112*10111
{Thanks to our sponsor Red Gatehttp://j.mp/rickyleeks
Lunch
{Bank accounts1 paired iteration
TDD in the real world
Write a system to model a bank account Implement these three basic behaviours:
Deposit Withdraw Check balance
Bank account
{Bank account kata1 paired iterationNew rules http://j.mp/objectcalisthenics
An objective work-out
Object calisthenics
1. One level of indentation per method
2. Don’t use the ELSE keyword
3. Wrap all primitives and Strings
4. First class collections
5. One dot per line6. Don’t abbreviate7. Keep all entities small8. No classes with more
than two instance variables
9. No getters/setters/properties
{Thank you for coming!Please join us at The Flying Pig
Close