Download presentation
Presentation is loading. Please wait.
1
{ Welcome to CAMDUG Dojo Day Thank you to our hosts, Granta Design (We’re hiring!) Sorry for the lack of internet
2
Welcome! What is Software Craftsmanship? What is Test-Driven Development (TDD)? Introduction
3
Pair Programming Aim for one assertion per test Give your tests fully descriptive names TestThat_Foo_ShouldReturnBar_WhenBazIsFalse Session Basics Method Name Expectation Condition
4
{ Roman Numerals 2 paired iterations Introduction to TDD
5
Leap Year kata Write a function that returns true or false depending on whether its input integer is a leap year or not. A leap year is divisible by 4, but is not otherwise divisible by 100 unless it is also divisible by 400. 2001 is a typical common year 1996 is a typical leap year 1900 is an atypical common year 2000 is an atypical leap year
6
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
7
{ Minefield kata 2 paired iterations Cementing your knowledge
8
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.
9
Minefield kata Example input 4 3 *.....*..... Example output *211 12*1 0111
10
{ Thanks to our sponsor Red Gate http://j.mp/rickyleeks Lunch
11
{ Bank accounts 1 paired iteration TDD in the real world
12
Write a system to model a bank account Implement these three basic behaviours: Deposit Withdraw Check balance Bank account
13
{ Bank account kata 1 paired iteration New rules http://j.mp/objectcalisthenics An objective work-out
14
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 line 6.Don’t abbreviate 7.Keep all entities small 8.No classes with more than two instance variables 9.No getters/setters/properties
15
{ Thank you for coming! Please join us at The Flying Pig Close
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.