Test Driven Development Coding Katas ADRIAN O’SULLIVAN, LEAD APPLICATION DEVELOPER DEUTSCHE BANK GLOBAL TECHNOLOGY.

Slides:



Advertisements
Similar presentations
TDD Basics Tom Clune presiding Principles Tests should not duplicate implementation Tests should strive to be orthogonal Tests do not uniquely determine.
Advertisements

Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
CIT 590 Unit testing.
COMP 121 Week 7: Object-Oriented Design and Efficiency of Algorithms.
Recursion. Recursion is a powerful technique for thinking about a process It can be used to simulate a loop, or for many other kinds of applications In.
Testing by Duncan Butler Sara Stephens. Too much to cover.
16-Jun-15 Recognizers. 2 Parsers and recognizers Given a grammar (say, in BNF) and a string, A recognizer will tell whether the string belongs to the.
10 November JavaScript. Presentation Hints What do YOU think makes a good presentation Some of my suggestions Don’t write full sentences on slides Talk,
{ Welcome to CAMDUG Dojo Day Thank you to our hosts, Granta Design (We’re hiring!) Sorry for the lack of internet.
Beaconside Primary & Nursery School Numeracy Information Morning To provide you with a taster of how we teach Numeracy in school and to help you support.
Introduction to Continuous Integration Mike Roberts.
CIT 590 Unit testing. Agenda Debugging attempt 2 (because I am stubborn) What is unit testing Why? Unit testing framework in Python.
By for Test Driven Development: Industry practice and teaching tool Robert Vanderwall, Ph.D. 1 WISTPC-15.
Test Driven Development TDD. Testing ”Testing can never demonstrate the absence of errors in software, only their presence” Edsger W. Dijkstra (but it.
Remote Pair Programming Agile 2013 Johannes Brodwall Exilesoft Chief Guest starring: Niruka Ruhunage.
Lists in Python.
1 Welcome to CS 362 Applied Software Engineering What happens after (and during) design? Testing, debugging, maintaining programs Lessons for software.
Computing Science 1P Lecture 21: Friday 20 th April Simon Gay Department of Computing Science University of Glasgow 2006/07.
Section 3 Calculations National 4/5 Scratch Course.
CARLETON READS & COUNTS (TUTOR SESSION) April 30, 2013 Diane Torbenson RtI Greenvale Park Elementary School
Recursion.
Designing with Procedures 1. Designing a Program with Procedures If the code for your program is going to be less than one page, normally don’t bother;
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
By for Testing Tools: Test Automation and supporting tools Jariro Pava, Robert Vanderwall 1 WISTPC-14.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Future Media  BBC MMXI TDD at the BBC David Craddock, Jack Palfrey and Tom Canter.
Debugging Strategies from Software Carpentry. Agan's Rules Many people make debugging harder than it needs to be by: Using inadequate tools Not going.
Software Engineering Chapter 3 CPSC Pascal Brent M. Dingle Texas A&M University.
CSC 107 – Programming For Science. Today’s Goal  Become familiar with simple arrays  Declaring an array variable  Assigning data to array entries 
Fibonacci plays the National Lottery An Investigation.
Week 6.  Lab 1 and 2 results  Common mistakes in Style  Lab 1 common mistakes in Design  Lab 2 common mistakes in Design  Tips on PE preparation.
Test-Driven Development Eduard Miric ă. The problem.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Scalatest. 2 Test-Driven Development (TDD) TDD is a technique in which you write the tests before you write the code you want to test This seems backward,
TDD & PP Workshop for Sterias FHS og T&D team, 9. desember, 2010 Johannes Brodwall Anders Karlsen.
CS001 Introduction to Programming Day 2 Sujana Jyothi
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
Recursion in Java The answer to life’s greatest mysteries are on the last slide.
Test-Driven Development Learn the "Test First" Approach to Coding Svetlin Nakov Technical Trainer Software University
 Scientific notation is simply a method for expressing, and working with, very large or very small numbers. It is a short hand method for writing numbers,
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
A High Flying Overview CS139 – Fall 2010 How far we have come.
By Manish Shrotriya CSE MS 4 Point Agile Manifesto 1.Individuals and interactions over processes and tools 2.Working software over comprehensive.
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Test-Driven Development
CS170 – Week 1 Lecture 3: Foundation Ismail abumuhfouz.
John D. McGregor Session 9 Testing Vocabulary
Lesson #6 Modular Programming and Functions.
Algorithmic complexity: Speed of algorithms
Lesson #6 Modular Programming and Functions.
Grab the handout off the front table
John D. McGregor Session 9 Testing Vocabulary
Lesson #6 Modular Programming and Functions.
John D. McGregor Session 9 Testing Vocabulary
History, Characteristics and Frameworks
Recursion.
Algorithmic complexity: Speed of algorithms
Test Driven Development
Lesson #6 Modular Programming and Functions.
Algorithmic complexity: Speed of algorithms
WHEN THINGS GO WRONG I go to an Elementary School.
Java Coding 4 (part2) David Davenport Computer Eng. Dept.,
Test Driven Development
Primitive Data Types and Operators
Presentation transcript:

Test Driven Development Coding Katas ADRIAN O’SULLIVAN, LEAD APPLICATION DEVELOPER DEUTSCHE BANK GLOBAL TECHNOLOGY

What is TDD

What is TDD

What is a Kata

What is a Kata?

Karate Katas Sand the floor Right the circle Left the circle Breath in breath out Paint the fence Paint up Paint down Breath in out (no look me look fence!) Wash the car Wax on – right hand circle Wax off – left hand circle Breath in breathe out

What is a Coding Kata? As a group, software developers don’t practice enough. Most of our learning takes place on the job, which means that most of our mistakes get made there as well. Other creative professions practice: artists carry a sketchpad, musicians play technical pieces, poets constantly rewrite works. In karate, where the aim is to learn to spar or fight, most of a student’s time is spent learning and refining basic moves. The more formal of these exercises are called kata. Dave Thomas

TDD Katas 1.You are not allowed to write any production code unless it is to make a failing unit test pass. 2.You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures. 3.You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

TDD Kata Demo

Roman Numerals Kata Return a string with the Roman Numerals for a given integer. Remember to follow the rules of TDD. Wax on, wax off, breathe!

TDD Katas Fibonacci Sequence Print the sum of the previous two numbers FizzBuzz If divisible by 3, fizz If divisible by 5, buzz If divisible by both, fizzbuzz 1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz fizzbuzz

TDD katas Tennis scoring Bowling scoring String Calculator PacMan Pacman needs to move about on a grid. Given - something When – something Then - something

Why do this One of the reasons TDD is hard for newcomers is that it is very explicit about the baby-step nature of the changes you make to the code. You simply are not allowed to add anything more than the current tests require. And for experienced developers, this is very hard to do, especially when working on real code.

Why do this TDD is not taking TDD cadence System complexity Try new libraries Learn shortcuts Learn from other developers Understand a new language Understand an old language Its fun

Styles of Kata Solo ◦Daily ◦Weekly Group ◦Write a test, pass a test, pass the keyboard ◦Pass a test, write a test, pass the keyboard ◦4 person group ◦n Pairs

Discussions Whether to use one assert or multiple asserts in each test When to use mocks and when its better to use stubs Is it ok to change the access level of methods from private to protected or public? TDD/OO vs functional programming How complex problems broken into small chunks It takes discipline to not make 'improvements' to the code for which there is not yet a failing test! Its so tempting to make untested changes, but doing so usually ends in an unhappy experience and gets rolled back. The logic of implementing the 'simplest thing that could possibly work‘

Lessons Learnt Mac/Windows keyboards are not the same! Don’t rely on network access Sit together Pairs of people new to TDD need supervision Do the kata yourself before supervising a group session Expect inconsistent attendance