Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Agile Technical Practices Distilled

You're reading from   Agile Technical Practices Distilled A learning journey in technical practices and principles of software design

Arrow left icon
Product type Paperback
Published in Jun 2019
Publisher
ISBN-13 9781838980849
Length 442 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Marco Consolaro Marco Consolaro
Author Profile Icon Marco Consolaro
Marco Consolaro
Alessandro Di Gioia Alessandro Di Gioia
Author Profile Icon Alessandro Di Gioia
Alessandro Di Gioia
Pedro M. Santos Pedro M. Santos
Author Profile Icon Pedro M. Santos
Pedro M. Santos
Arrow right icon
View More author details
Toc

Table of Contents (31) Chapters Close

Preface 1. Section 1 FREE CHAPTER
2. Chapter 1 3. Chapter 2 4. Chapter 3 5. Chapter 4 6. Chapter 5 7. Section 2
8. Chapter 6 9. Chapter 7 10. Chapter 8 11. Chapter 9 12. Chapter 10 13. Section 3
14. Chapter 11 15. Chapter 12 16. Chapter 13 17. Chapter 14 18. Chapter 15 19. Section 4
20. Chapter 16 21. Chapter 17 22. Chapter 18 23. Chapter 19 24. Chapter 20 25. Chapter 21
26. Chapter 22 27. Chapter 23 28. License: CyberDojo
29. Sample Solutions
30. Feedback

Katas

Fizz Buzz by cyber-dojo

Cyber-dojo foundation (See license): http://www.cyber-dojo.org/.

Write a function that takes numbers from 1 to 100 and outputs them as a string, but for multiples of 3, it returns Fizz instead of the number, and for multiples of 5, it returns Buzz. For numbers that are multiples of both 3 and 5, it returns FizzBuzz.

Tip

Start by writing a failing test. Think about what behaviors your code should implement.

Fizz Buzz – partial walkthrough

Let's first pick the behavior where numbers not divisible by 3 or 5 are returned as a string. Let's start with number 1.

Write a new failing test.

When I fizzbuzz number 1, I get back a string representing it

Use fake it as an implementation strategy.

return "1"

Run the test and make sure it's green.

Write a new failing test since we do not have enough examples to prove the behavior we are implementing yet.

When I fizzbuzz number 2, I get back a string...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image