Trikalabs
  • Home
  • Best online TDD videos
  • Book Suggestions
  • About Me
  • Contact
Trikalabs
No Result
View All Result

Banking Kata

by fragi
April 28, 2019
in Code Kata, TDD
Share on FacebookShare on Twitter

Banking Kata is a great Kata to practise the Outside-In technique.

I found this Kata in the Codurance and as a big fan of the Outside-In technique, I decided to give it a try. Although I tried the Kata many times with different approaches, in the GitHub link I will post an approach very similar to the one that Sandro Mancuso implements in his video screencasts. In our solution though instead of using the Console as output, we will use an array of strings, and instead of creating the Transaction in the repository (Data Layer) we use a TransactionFactory in the Domain Layer.

This is an example of a statement.

Date             || Amount  || Balance

22/01/2016  || 300          || 1300

12/01/2016  || -500         || 1000

02/11/2015  || 1500        || 1500

Description:

Write a class named Account that has only the following public methods.

func deposit(amount: Int)

func withdraw(amount: Int)

func printStatement()

You are not allowed to create more public methods or to change the existing method signatures.

 

Swift solution:

https://github.com/Fragki/BankKata

Resources:

https://katalyst.codurance.com/bank

 

fragi

fragi

Related Posts

What is TDD?
TDD

XCTestCase lifecycle

May 25, 2021

XCTestCase has many methods as part of its lifecycle. It has a class setup method that executes only once before...

What is TDD?
TDD

Make your tests more readable

May 23, 2021

In the FizzBuzz code challenge, we had to write the following test method: Although the test is easy to...

What is TDD?
TDD

@testable

May 16, 2021

At the beginning of the FizzBuzz code challenge , we deleted the @testable line of code. What does this @testable...

What is TDD?
TDD

What is SUT

May 16, 2021

In many articles about TDD, you will find the term SUT, which refers to the System Under Test. Using SUT...

What is TDD?
TDD

Why unit testing is valuable

May 16, 2021

There are many benefits of writing unit tests. The test we write can serve as a documentation of what the...

What is TDD?
TDD

Cyclomatic complexity

November 11, 2021

According to Wikipedia (https://en.wikipedia.org/wiki/Cyclomatic_complexity): Cyclomatic complexity is a software metric used to indicate the complexity of a program. It is...

Next Post
FizzBuzz Kata

FizzBuzz Kata

Game of life Kata

Game of life Kata

How to test Errors in Swift

How to test Errors in Swift

  • Advertise
  • Privacy & Policy
  • Contact

© 2019 Trikalabs Ltd. All rights reserved.

No Result
View All Result
  • Home
  • About Me
  • A curated list with the best free online TDD videos
  • Book Suggestions
  • Pinner Code Club

© 2019 Trikalabs Ltd. All rights reserved.