This document summarizes a TDD walkthrough for converting times to words. It begins by setting up the necessary files and frameworks. The first test case converts 5:00 to "five o' clock" and fails initially. Code is then written to pass this test. Additional tests are added for other times like 5:30 and 5:15, with code changes to pass each new test while maintaining previous tests. Refactoring removes duplication, leading to cleaner code structure using variables and objects. The walkthrough demonstrates a step-by-step TDD process.
Seconda serata di introduzione al Test-Driven Development, tenuta in XPeppers a Trento il 24 Ottobre 2012.
Nelle slide c'è anche la descrizione del coding dojo sullo string calculator che abbiamo svolto assieme.
The document is a walkthrough of using test-driven development (TDD) to solve an encryption problem. It begins by setting up test and source code files. Tests are written based on examples from the problem. Minimal code is written to pass each test. Refactoring improves the code while maintaining passing tests. The implementation is generalized through many small iterative changes. Edge cases are addressed, like when the encryption grid is too small. The completed solution passes all tests.
This document summarizes a presentation on applying the Open-Closed Principle during Test Driven Development. It discusses when refactoring should occur during the TDD process, how to structure code to follow the Open-Closed Principle, and provides an example "OCP Kata" exercise to practice these concepts. Learning objectives, examples, and rules for the kata are outlined to help attendees understand and apply the Open-Closed Principle.
TDD and Simple Design Workshop - Session 1 - March 2019Paulo Clavijo
The document discusses test-driven development (TDD) and simple design. It introduces TDD and some of its core practices, including test-driven development, simple design, refactoring, and pair programming. It provides an agenda for a workshop that will cover these topics over three sessions, including extreme programming (XP), the four elements of simple design, test doubles, outside-in TDD, and SOLID principles. The workshop aims to communicate best practices for using technical practices to succeed with agile development.
Slides from the session "TDD - That Was Easy!" presented by Fadi Stephan from Kaizenko at AgileDC2019 on September 23, 2019 in Washington DC. A blog post accompanying this talk will be published soon on kaizenko.com
Abstract:
Have you tried TDD? Do you hate it? Do you have a hard time applying it in practice? Do you find it promoting bad design decisions because you must write micro tests instead of looking at the big picture? Are your tests tightly coupled to the implementation due to a lot of mocking making refactoring a pain? Do tons of tests break when a simple change is made? Do you have a hard time justifying all the time spent on writing tests vs. just focusing on development?
You are not alone. Every organization or team that I run into is supposedly Agile. Some are also applying agile engineering practices such as automated unit, integration and acceptance testing, etc… However, many struggle with TDD. TDD is hard, seems counter-intuitive and requires a lot of investment. Come to this session for a TDD reboot. We will look at the benefits of TDD, discuss the resistance to TDD and uncover some common difficulties along with misconceptions. We will address these misunderstandings and explore different approaches to making TDD easier. Leave with a fresh perspective and new insights on how to become better at TDD and apply it with ease
Beyond Testing: Specs and Behavior Driven DevelopmentRabble .
This document discusses testing approaches for software development, including:
1. It begins by describing traditional QA testing from the perspective of a programmer, noting it finds major problems but is extra work.
2. It then introduces the concept of regression testing in code to automatically verify functionality. Unit testing is described as the most common type of regression testing.
3. The document advocates for behavior driven development (BDD) which focuses on testing functionality and desired behavior rather than implementation details, using "should" statements rather than asserts. This helps avoid issues when code changes but functionality does not.
Test-driven development is generally regarded as a good move: it should result in simple decoupled design, your tests tend to cover behaviour not methods, and far fewer bugs. However, just getting unit tests in on a real, commercial project is hard - switching to TDD is even harder. Often you can start a project with good intentions and coverage, then the deadline looms and the tests go out then the hacks come in. So, instead of beating ourselves up about not being perfect let's look at an interative approach to adopting TDD principles. We'll look at tactics for selling TDD to your client, boss and colleagues. This talk will also cover methods for making TDD easier for you by showing you what tools you can use to integrate it into your development environment. In the project itself, we'll examine how we can make small but permanent steps towards full TDD, without losing that progress when deadlines hit. We'll also cover a few methods for learning on your own time and how the whole process can actually be made quite enjoyable.
Seconda serata di introduzione al Test-Driven Development, tenuta in XPeppers a Trento il 24 Ottobre 2012.
Nelle slide c'è anche la descrizione del coding dojo sullo string calculator che abbiamo svolto assieme.
The document is a walkthrough of using test-driven development (TDD) to solve an encryption problem. It begins by setting up test and source code files. Tests are written based on examples from the problem. Minimal code is written to pass each test. Refactoring improves the code while maintaining passing tests. The implementation is generalized through many small iterative changes. Edge cases are addressed, like when the encryption grid is too small. The completed solution passes all tests.
This document summarizes a presentation on applying the Open-Closed Principle during Test Driven Development. It discusses when refactoring should occur during the TDD process, how to structure code to follow the Open-Closed Principle, and provides an example "OCP Kata" exercise to practice these concepts. Learning objectives, examples, and rules for the kata are outlined to help attendees understand and apply the Open-Closed Principle.
TDD and Simple Design Workshop - Session 1 - March 2019Paulo Clavijo
The document discusses test-driven development (TDD) and simple design. It introduces TDD and some of its core practices, including test-driven development, simple design, refactoring, and pair programming. It provides an agenda for a workshop that will cover these topics over three sessions, including extreme programming (XP), the four elements of simple design, test doubles, outside-in TDD, and SOLID principles. The workshop aims to communicate best practices for using technical practices to succeed with agile development.
Slides from the session "TDD - That Was Easy!" presented by Fadi Stephan from Kaizenko at AgileDC2019 on September 23, 2019 in Washington DC. A blog post accompanying this talk will be published soon on kaizenko.com
Abstract:
Have you tried TDD? Do you hate it? Do you have a hard time applying it in practice? Do you find it promoting bad design decisions because you must write micro tests instead of looking at the big picture? Are your tests tightly coupled to the implementation due to a lot of mocking making refactoring a pain? Do tons of tests break when a simple change is made? Do you have a hard time justifying all the time spent on writing tests vs. just focusing on development?
You are not alone. Every organization or team that I run into is supposedly Agile. Some are also applying agile engineering practices such as automated unit, integration and acceptance testing, etc… However, many struggle with TDD. TDD is hard, seems counter-intuitive and requires a lot of investment. Come to this session for a TDD reboot. We will look at the benefits of TDD, discuss the resistance to TDD and uncover some common difficulties along with misconceptions. We will address these misunderstandings and explore different approaches to making TDD easier. Leave with a fresh perspective and new insights on how to become better at TDD and apply it with ease
Beyond Testing: Specs and Behavior Driven DevelopmentRabble .
This document discusses testing approaches for software development, including:
1. It begins by describing traditional QA testing from the perspective of a programmer, noting it finds major problems but is extra work.
2. It then introduces the concept of regression testing in code to automatically verify functionality. Unit testing is described as the most common type of regression testing.
3. The document advocates for behavior driven development (BDD) which focuses on testing functionality and desired behavior rather than implementation details, using "should" statements rather than asserts. This helps avoid issues when code changes but functionality does not.
Test-driven development is generally regarded as a good move: it should result in simple decoupled design, your tests tend to cover behaviour not methods, and far fewer bugs. However, just getting unit tests in on a real, commercial project is hard - switching to TDD is even harder. Often you can start a project with good intentions and coverage, then the deadline looms and the tests go out then the hacks come in. So, instead of beating ourselves up about not being perfect let's look at an interative approach to adopting TDD principles. We'll look at tactics for selling TDD to your client, boss and colleagues. This talk will also cover methods for making TDD easier for you by showing you what tools you can use to integrate it into your development environment. In the project itself, we'll examine how we can make small but permanent steps towards full TDD, without losing that progress when deadlines hit. We'll also cover a few methods for learning on your own time and how the whole process can actually be made quite enjoyable.
Test Driven Development - Phương pháp phát triển phần mềm theo hướng viết test trước.
Áp dụng TDD sẽ đem lại cho bạn thiết kế phần mềm trong sáng hơn và quản lý được chất lượng từng dòng code của mình viết ra.
Bài trình bày của bạn Lê Anh tại Meetup của Ha Noi .NET Group.
Chi tiết vui lòng xem tại: http://tungnt.net
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
This document discusses Test Driven Development (TDD) using FlexUnit 4. It provides an overview of TDD and its benefits. It then walks through an example of building a Twitter client application using TDD. It demonstrates how to create test suites and test cases, write tests to fail initially, then write code to pass the tests. It covers concepts like user stories, assertions, refactoring tests. The document recommends TDD for APIs, frameworks and services, but not GUI testing. It provides resources to learn more about TDD with FlexUnit 4 and Adobe technologies.
The document discusses Test Driven Development (TDD) in PHP. It provides an overview of TDD, the benefits it provides like high cohesion and loose coupling, and some drawbacks. It then demonstrates a live coding example of TDD in PHP by building a simple integer calculator using PHPUnit for a math tutor application. Resources for learning more about TDD, PHPUnit, and Xdebug are also included.
It is always tough to test a complex API comprehensively. The additional level of complexity brings us to the question “How can we validate that our API is working as intended?”
In this talk I will explain how to use test driven development for APIs to solve this problem and even further how TDD can drive an API Design towards a more usable design. I will outline my practical approach with an implementation example based on django. And finally I will give you a brief summary of my lessons learned using this approach in customer projects.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
TDD and Simple Design Workshop - Session 1 - November 2018Paulo Clavijo
The document contains snippets of code and discussions around test-driven development (TDD) best practices. It discusses principles of TDD like writing tests first, keeping tests independent and self-contained, and refactoring code. It also provides examples of refactoring Java and Kotlin test code, including using custom assertions and organizing tests in arrange-act-assert blocks. Pair programming and software design principles like YAGNI, DRY and SOLID are also briefly mentioned.
This presentation introduces the key testing concepts of the PHPUnit testing framework. It discusses unit testing, test cases, fixtures, stubs, mocks, and best practices for organizing and running tests. The presentation emphasizes that unit testing isolates and tests the smallest parts of an application to find errors, facilitate refactoring, and enable automated testing. PHPUnit allows writing tests for PHP code and provides features like data providers, exception handling, and code coverage reports.
Entering in the full TDD, including:
- how TDD works and why it is required in Agile development
- why there are so many people that say that TDD does not work
- how to fix the problems in bad TDD to make it effective
- and the primary value of the sofware: make it adaptable
The document outlines assignments due tomorrow including a chapter 5 review packet and test, with instructions to complete a timed test, turn in checked homework, and work on the review packet with a partner.
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
The document discusses Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD). It defines TDD and ATDD, provides demos of applying each approach to building a calculator and pet shop application, and discusses how they help keep design simple. Tools for TDD/ATDD and who writes unit/acceptance tests are also covered, along with why the approaches are used.
Many developers know that they should be writing tests for their apps. However, it’s often hard to know how to get started or to convince your manager that you should be spending half of your time writing and maintaining test code. In this talk, you will learn how you can integrate testing into your day-to-day workflow and you’ll learn why a good test suite will not cost you a lot of time. Instead, it should end up saving you time. And as you know, the manager loves it when you manage to save time. You will understand how TDD works, how to integrate the important bits of TDD and how to build a high-quality test suite that is a pleasure to maintain. To round things out, you will also learn about Xcode 11’s new test plans feature and how you can use it to make your test suite even better!
Test Driven Development Methodology and Philosophy Vijay Kumbhar
A technique for building software that guides software development by writing tests. This is the philosophy and state of mind that a developer should change and start following TDD
San Francisco Software Craftsmanship Meetup
Test Driven Developers Bay Area Meetup
TDD Flow: The Mantra in Action” is a talk + hands-on about the mantra of TDD and its core patterns. Here are some questions for this talk: What is TDD? How to write a good test that fails? How to write code enough to make the test pass? How to remove duplication? How to refactor code? How to create clean code? Is TDD about testing or design? How small should a test be? Should I only write unit tests? Should I estimate TDD? How to use TDD with other agile methods like Scrum, Kanban or BDD? And finally, how to flow in TDD?
This document discusses test driven development (TDD) and how it can be applied to legacy code. It describes the TDD process and patterns for writing tests. When applying TDD to legacy code, it recommends identifying change points and inflection points in the code. Tests should be written to cover the inflection point by breaking dependencies. Then changes can be made using the full TDD process, and the covered code can be refactored.
4 Nisan 2015 tarihinde Kadir Has Üniversitesi'nde yapılan 9. Yazılım Teknolojileri Seminer etkinliğinde Eralp Erat'ın yaptığı TDD (Test Driven Design) sunumu
The document provides a summary of a test-driven development walkthrough for a library fine calculation exercise. It outlines setting up the testing framework and files. It then describes the process of writing tests based on requirements, making the tests fail, then passing the tests by implementing minimal code. As more tests are added, the code is refactored to be more generalized through techniques like triangulation. The goal is to use tests to drive the development of production code in a iterative cycle.
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...FalafelSoftware
A complete introduction to unit testing, and test-first development for AngularJS programmers. Topics include tools, specs, test runners, core testing practices and patterns, Behavior-driven development, Spys, Matchers, Stubs and MOcks and much more.
The document discusses test-driven development (TDD) and refactoring. It explains what TDD is, how to implement it in three steps - writing a failing test, making the test pass, and refactoring code - and provides an example of modeling a calendar to track holidays using TDD. The document also discusses benefits of TDD like catching mistakes early, increasing coding confidence, and making it easier to implement new requirements through refactoring.
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...Abdelkrim Boujraf
The document discusses the authors' experience with different testing strategies at their company StratEx. They initially used Selenium for UI testing but found it did not help when they frequently changed screens. They then investigated Test-Driven Development (TDD) but found it inefficient, as tests are also code that must be written and maintained. Behavior-Driven Development (BDD) showed more promise as it focuses on functionality rather than architecture and bridges communication between users and developers. However, no methodology fully describes large, complex systems. The search for the best testing approach is ongoing.
TDD and agile methods originated from attempts to manage large software projects more effectively. TDD involves writing automated tests before code to specify requirements and catch errors early. It helps avoid major redesigns later. Tests should fail initially and then code is written to pass the test, followed by refactoring. Patterns like starting simply, faking dependencies, and generalizing from examples help get code passing tests quickly. Pitfalls include not starting with a failing test or refactoring tests improperly. The session covered TDD history and techniques, with examples and opportunities for further learning.
Pairing software developers with testers can improve code quality and productivity. The document describes a case where a developer, Marty, paired with a tester, Lanette, to integrate testing earlier in the development process. By explaining code changes to Lanette and incorporating her test ideas, Marty's code became more stable and automated testing was added. Both parties' skills benefited from the collaboration. The document advocates for occasional pairing rather than mandates, and provides tips for making pairing work effectively within teams.
Lập trình hướng kiểm thử - Test Driven developmentAnh Lê
This document discusses test driven development (TDD). It begins with an overview of TDD, explaining that TDD is a strong methodology that helps prevent bugs regardless of programming language. It then explains how to implement TDD using the "red/green/refactor" process in incremental baby steps. An example of reversing the last two characters of a string is provided. Benefits of TDD include clean code, preventing bugs, serving as documentation, and helping programmers design better. Common mistakes in TDD are also discussed. The document concludes with questions and answers about TDD.
Test Driven Development - Phương pháp phát triển phần mềm theo hướng viết test trước.
Áp dụng TDD sẽ đem lại cho bạn thiết kế phần mềm trong sáng hơn và quản lý được chất lượng từng dòng code của mình viết ra.
Bài trình bày của bạn Lê Anh tại Meetup của Ha Noi .NET Group.
Chi tiết vui lòng xem tại: http://tungnt.net
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
This document discusses Test Driven Development (TDD) using FlexUnit 4. It provides an overview of TDD and its benefits. It then walks through an example of building a Twitter client application using TDD. It demonstrates how to create test suites and test cases, write tests to fail initially, then write code to pass the tests. It covers concepts like user stories, assertions, refactoring tests. The document recommends TDD for APIs, frameworks and services, but not GUI testing. It provides resources to learn more about TDD with FlexUnit 4 and Adobe technologies.
The document discusses Test Driven Development (TDD) in PHP. It provides an overview of TDD, the benefits it provides like high cohesion and loose coupling, and some drawbacks. It then demonstrates a live coding example of TDD in PHP by building a simple integer calculator using PHPUnit for a math tutor application. Resources for learning more about TDD, PHPUnit, and Xdebug are also included.
It is always tough to test a complex API comprehensively. The additional level of complexity brings us to the question “How can we validate that our API is working as intended?”
In this talk I will explain how to use test driven development for APIs to solve this problem and even further how TDD can drive an API Design towards a more usable design. I will outline my practical approach with an implementation example based on django. And finally I will give you a brief summary of my lessons learned using this approach in customer projects.
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
TDD and Simple Design Workshop - Session 1 - November 2018Paulo Clavijo
The document contains snippets of code and discussions around test-driven development (TDD) best practices. It discusses principles of TDD like writing tests first, keeping tests independent and self-contained, and refactoring code. It also provides examples of refactoring Java and Kotlin test code, including using custom assertions and organizing tests in arrange-act-assert blocks. Pair programming and software design principles like YAGNI, DRY and SOLID are also briefly mentioned.
This presentation introduces the key testing concepts of the PHPUnit testing framework. It discusses unit testing, test cases, fixtures, stubs, mocks, and best practices for organizing and running tests. The presentation emphasizes that unit testing isolates and tests the smallest parts of an application to find errors, facilitate refactoring, and enable automated testing. PHPUnit allows writing tests for PHP code and provides features like data providers, exception handling, and code coverage reports.
Entering in the full TDD, including:
- how TDD works and why it is required in Agile development
- why there are so many people that say that TDD does not work
- how to fix the problems in bad TDD to make it effective
- and the primary value of the sofware: make it adaptable
The document outlines assignments due tomorrow including a chapter 5 review packet and test, with instructions to complete a timed test, turn in checked homework, and work on the review packet with a partner.
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
The document discusses Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD). It defines TDD and ATDD, provides demos of applying each approach to building a calculator and pet shop application, and discusses how they help keep design simple. Tools for TDD/ATDD and who writes unit/acceptance tests are also covered, along with why the approaches are used.
Many developers know that they should be writing tests for their apps. However, it’s often hard to know how to get started or to convince your manager that you should be spending half of your time writing and maintaining test code. In this talk, you will learn how you can integrate testing into your day-to-day workflow and you’ll learn why a good test suite will not cost you a lot of time. Instead, it should end up saving you time. And as you know, the manager loves it when you manage to save time. You will understand how TDD works, how to integrate the important bits of TDD and how to build a high-quality test suite that is a pleasure to maintain. To round things out, you will also learn about Xcode 11’s new test plans feature and how you can use it to make your test suite even better!
Test Driven Development Methodology and Philosophy Vijay Kumbhar
A technique for building software that guides software development by writing tests. This is the philosophy and state of mind that a developer should change and start following TDD
San Francisco Software Craftsmanship Meetup
Test Driven Developers Bay Area Meetup
TDD Flow: The Mantra in Action” is a talk + hands-on about the mantra of TDD and its core patterns. Here are some questions for this talk: What is TDD? How to write a good test that fails? How to write code enough to make the test pass? How to remove duplication? How to refactor code? How to create clean code? Is TDD about testing or design? How small should a test be? Should I only write unit tests? Should I estimate TDD? How to use TDD with other agile methods like Scrum, Kanban or BDD? And finally, how to flow in TDD?
This document discusses test driven development (TDD) and how it can be applied to legacy code. It describes the TDD process and patterns for writing tests. When applying TDD to legacy code, it recommends identifying change points and inflection points in the code. Tests should be written to cover the inflection point by breaking dependencies. Then changes can be made using the full TDD process, and the covered code can be refactored.
4 Nisan 2015 tarihinde Kadir Has Üniversitesi'nde yapılan 9. Yazılım Teknolojileri Seminer etkinliğinde Eralp Erat'ın yaptığı TDD (Test Driven Design) sunumu
The document provides a summary of a test-driven development walkthrough for a library fine calculation exercise. It outlines setting up the testing framework and files. It then describes the process of writing tests based on requirements, making the tests fail, then passing the tests by implementing minimal code. As more tests are added, the code is refactored to be more generalized through techniques like triangulation. The goal is to use tests to drive the development of production code in a iterative cycle.
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...FalafelSoftware
A complete introduction to unit testing, and test-first development for AngularJS programmers. Topics include tools, specs, test runners, core testing practices and patterns, Behavior-driven development, Spys, Matchers, Stubs and MOcks and much more.
The document discusses test-driven development (TDD) and refactoring. It explains what TDD is, how to implement it in three steps - writing a failing test, making the test pass, and refactoring code - and provides an example of modeling a calendar to track holidays using TDD. The document also discusses benefits of TDD like catching mistakes early, increasing coding confidence, and making it easier to implement new requirements through refactoring.
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...Abdelkrim Boujraf
The document discusses the authors' experience with different testing strategies at their company StratEx. They initially used Selenium for UI testing but found it did not help when they frequently changed screens. They then investigated Test-Driven Development (TDD) but found it inefficient, as tests are also code that must be written and maintained. Behavior-Driven Development (BDD) showed more promise as it focuses on functionality rather than architecture and bridges communication between users and developers. However, no methodology fully describes large, complex systems. The search for the best testing approach is ongoing.
TDD and agile methods originated from attempts to manage large software projects more effectively. TDD involves writing automated tests before code to specify requirements and catch errors early. It helps avoid major redesigns later. Tests should fail initially and then code is written to pass the test, followed by refactoring. Patterns like starting simply, faking dependencies, and generalizing from examples help get code passing tests quickly. Pitfalls include not starting with a failing test or refactoring tests improperly. The session covered TDD history and techniques, with examples and opportunities for further learning.
Pairing software developers with testers can improve code quality and productivity. The document describes a case where a developer, Marty, paired with a tester, Lanette, to integrate testing earlier in the development process. By explaining code changes to Lanette and incorporating her test ideas, Marty's code became more stable and automated testing was added. Both parties' skills benefited from the collaboration. The document advocates for occasional pairing rather than mandates, and provides tips for making pairing work effectively within teams.
Lập trình hướng kiểm thử - Test Driven developmentAnh Lê
This document discusses test driven development (TDD). It begins with an overview of TDD, explaining that TDD is a strong methodology that helps prevent bugs regardless of programming language. It then explains how to implement TDD using the "red/green/refactor" process in incremental baby steps. An example of reversing the last two characters of a string is provided. Benefits of TDD include clean code, preventing bugs, serving as documentation, and helping programmers design better. Common mistakes in TDD are also discussed. The document concludes with questions and answers about TDD.
Lightening Talk I gave at Inaka in April 2014.
I was in charge of investigating test-driven development for our iOS mobile team. Since I realized it was such a big concept, after having gathered enough information and having played with it enough, I decided to introduce my fellows on the topic by presenting it in a formal talk with slides. The aim was teaching them a different way of developing, which, for us, at that moment, was completely new and controversial.
TDD involves writing tests before writing code to ensure code works as intended and allows for refactoring. The TDD process involves writing specifications, tests, and then code. Tests provide confidence that code works, help design better code, and act as documentation. Tests should be written even for code that currently works perfectly since requirements and needs change over time. The benefits of TDD include producing modular code that is easy to change and refactor.
Here are some potential caveats with BDD style testing:
1. The framework can feel too "magical" if it uses too much metaprogramming under the hood. The implementation details should not be obscured.
2. Descriptions can become too vague if they only state intentions at a very high level without concrete examples. Tests as documentation only works if the descriptions are clear and specific.
3. There is a risk of duplication if contexts or examples are not properly organized and nested. Descriptions should aim to be DRY.
4. Performance overhead of the framework if it does a lot of runtime reflection or string manipulation. The framework should have a small performance footprint.
5. Tests become brittle
Staleness and Isolation in Prometheus 2.0 (PromCon 2017)Brian Brazil
The biggest semantic change in Prometheus 2.0 is the new staleness handling. This long awaited feature means there's no longer a fixed 5 minute staleness. Now time series go stale when they're no longer exposed, and targets that no longer exist don't hang around for a full 5 minutes. Learn about how it works and how to take advantage of it.
Unit testing JavaScript code allows developers to make changes quickly and confidently by verifying code works as expected through automated tests. Testacular is a Node.js-based testing framework that runs tests using various browsers and frameworks like Jasmine. It provides features like live reloading, code coverage reports, and integration with continuous integration servers. Writing tests in Jasmine involves describing test suites and individual specs using expectations and matchers to validate code behavior.
Wait A Moment? How High Workload Kills Efficiency! - Roman PicklPROIDEA
Join me in this talk about why high workload leads to increasing waiting times and is detrimental to your project’s efficiency. We will not only talk about queueing theory and capacity management, but also about strategies to cope with high utilization and how to start a virtuous circle.
Data Science Salon: Deep Learning as a Product @ ScribdFormulatedby
Presented by Kevin Perko, Head of Data Science at Scribd
Next DSS NYC Event 👉 https://datascience.salon/newyork/
Next DSS LA Event 👉 https://datascience.salon/la/
Kevin will cover his experience using deep learning, going from scratch to deploying models in production to improve the product experience. He goes in-depth in terms of how we started deep learning from scratch, including navigating the maze of frameworks and hyper-parameters to optimize. Kevin will discuss pitfalls of using other people's algorithms and make a call for more rigor in publishing data science blog posts. Kevin closes with how his failure turned into an open source contribution and the work in moving from dev to production.
This document provides instructions for several labs on testing a timeclock application using Ruby. It discusses exploring the timeclock interface by making mistakes, testing command results using an assert_equal function, using the Test::Unit framework for testing, working with arrays and hashes, and testing the timeclock application's web services interface.
This document provides instructions for several labs on testing a timeclock application using Ruby. It begins by having the student experiment with making mistakes using the timeclock commands to learn how errors are handled. It then guides them through setting up a testing framework using assertions and the Test::Unit library. Finally, it instructs them to write tests for the timeclock application's web services interface by checking that jobs are started, paused, stopped correctly and have the expected effects.
The document discusses the importance of testing code through test-driven development (TDD) and behavior-driven development (BDD). It explains that TDD involves writing tests, watching them fail, making them pass, refactoring, and repeating. BDD is more complex and involves business analysts, developers, and stakeholders specifying desired behaviors as user stories. The document encourages writing unit tests because it allows for quick code changes with confidence, helps understand code design, and documents expected behavior, though it takes time initially.
TDD - Unit testing done right and programmer happinessErez Cohen
Test Driven Development has been around for a while but it has been dismissed by many as a superfluous and tedious way of developing software.
I have discovered through experience that it helps me create better quality code while turning the development into an even more enjoyable process.
In this talk I explain what makes it so great, tackle some of the criticism and share some tips regarding better unit testing.
The document discusses unit testing anti-patterns. It describes implementation anti-patterns like long tests with many assertions, long test files, tests with complex logic, slow tests, and tests that cannot fail. It also describes workflow anti-patterns like writing tests last, only testing for regression, testing elsewhere than in unit tests, only running tests from the command line, and not using continuous integration. It suggests approaches like writing independent tests, avoiding redundant tests, and testing frequently to avoid these anti-patterns.
A Tale of Two Workflows - ChefConf 2014Pete Cheslock
Watch this talk here: https://www.youtube.com/watch?v=L__8o02od6Q
For an example of the code we used in our CI pipeline to make a Chef Environment from a Berksfile.lock - check out this project:
https://github.com/petecheslock/berks2env
One of the biggest advantages of Chef is it's flexibility, allowing you to customize it at-will to fit your infrastructure needs. While this makes Chef incredibly powerful, it can also be challenging to develop a workflow to manage the day-to-day usage of chef.
Should I use a single repo for all my cookbooks?
One cookbook per repo?
Berkshelf?
Librarian?
Test-Kitchen?
Where does Jenkins(CI) fit it?
What about Testing?
How does this work with my small team? What about my large team? What about my * Distributed Team?
Over the past few years I have been a part of two distinct Chef workflows that take opposite paths about how to solve issues around collaboration, versioning, testing, etc. During the course of this talk I will share:
Details about the requirements that lead us down these 2 paths.
What worked.
What didn't.
How we use many of the tools available to safely test code changes.
How we deploy cookbook changes safely and quickly (and keep uptime our highest priority).
Similar to TDD Walkthrough - The Time in Words (20)
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Drona Infotech is a premier mobile app development company in Noida, providing cutting-edge solutions for businesses.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
2. TDD Walkthrough - The Time in Words
Hello and welcome to my TDD Walkthrough!
Today’s exercise is The Time in Words, taken
from HackerRank.com at the following URL:
https://www.hackerrank.com/challenges/the-
time-in-words/problem
3. TDD Walkthrough - The Time in Words
In these TDD Walkthroughs, I assume that my
readers have basic knowledge of test driven
development. I highly suggest having an
understanding of TDD before going through this
walkthrough. The following blog post explains
the cycles of TDD.
http://blog.cleancoder.com/uncle-
bob/2014/12/17/TheCyclesOfTDD.html
I also assume that my readers have knowledge
of refactoring tools and terminology. If you need
more information, this blog post on the six core
refactorings will provide enough information.
http://arlobelshee.com/the-core-6-refactorings/
4. TDD Walkthrough - The Time in Words
For this exercise, I have the following already set up:
Chrome browser
Visual Studio Code
Jasmine testing framework
(see my other blog on setting up: https://www.greatersum.com/tdd-setup-jasmine/)
With the above already set up, let’s get started!
5. TDD Walkthrough - The Time in Words
I would normally brainstorm a test list of all the functionality I expect out of my
code. Since the exercise provides good examples of that functionality, I will use
those examples as my test list.
My first step will then be to implement the simplest test case, and for that I choose
5:00, which translates to “five o’ clock”.
Before that though, we must set up our project. Creating files, pointing to file
locations, and running for the first time.
6. TDD Walkthrough - The Time in Words
Starting with a basic Jasmine standalone
project, I will create the file that contains my
tests.
7. TDD Walkthrough - The Time in Words
There are various conventions for file names out
there. I tend to use the affectionately dubbed
kabob-case: the-time-in-words.spec.js
8. TDD Walkthrough - The Time in Words
This is a spec file. This file needs to be included
in the Jasmine spec runner, so open up the
SpecRunner.html file next.
Look for the comment that says “include spec
files here”, and include the spec file you just
created.
9. TDD Walkthrough - The Time in Words
Let’s write our first test. First, we create the test
suite:
And then we write the test function:
In our test function, we write what we are
expecting:
10. TDD Walkthrough - The Time in Words
At this point, you should be able to run your test runner HTML file by opening it in
the browser, and see a failing test.
Failing the test here is good! You haven’t written any production code yet, and
that’s ok. What you did write is a test that will tell you when your code fulfilled a
purpose, and that is to translate 5:00 to five o’ clock. It’s not much, but we take
one step at a time.
11. TDD Walkthrough - The Time in Words
Ok, so what does the test runner say?
theTimeInWords is not defined. That makes
sense, we haven’t written anything called
theTimeInWords yet.
Let’s go make that function!
12. TDD Walkthrough - The Time in Words
To keep the code organized well, the tests are
contained in the spec file, in the spec folder.
So then our source code should go in the source
folder!
13. TDD Walkthrough - The Time in Words
Our new source file will need to be included in
the Spec Runner though, so let’s not forget to do
that.
14. TDD Walkthrough - The Time in Words
Now back to our source file. The first issue is
that theTimeInWords is not defined, so let’s go
define it.
15. TDD Walkthrough - The Time in Words
You might be tempted to go implement all of the function right now. But bear with
me and take one small step at a time. Let’s focus on the error at hand, and we’ll
tackle each issue as they come up. That way we don’t write extra code for no
reason.
This is, after all, development that is driven by testing. So run the tests again. You
can rerun the tests by refreshing the spec runner page.
16. TDD Walkthrough - The Time in Words
Ok, different error message. Expected
undefined to be ‘five o’ clock’.
Well, the solution sounds simple. Make our
function return five o’ clock!
17. TDD Walkthrough - The Time in Words
This solution will make you cringe. It makes me cringe.
But you never write more code than you need. That prevents you from wasting
time on extra code, and it prevents you from writing code that can break other
things in other ways.
Focus on minimal design, and drive your code towards the functionality you want
with tests.
18. TDD Walkthrough - The Time in Words
Ok, that being said, our current test should pass.
Side note: We could implement all of the o’
clocks from 1 to 12. But in the interest of
keeping the blog shorter, I will focus on the
examples on the test list I decided on in the
beginning. I will still keep the code in a flexible
manner to allow for implementation of hours 1 to
12.
19. TDD Walkthrough - The Time in Words
So, with the five o’ clock case done, let’s pick
the next case. Preferably an easy one, like 5:30.
Our new test will fail, while our previous test is
still passing as shown in the top left of the test
runner. This is also important! Whatever you do
to your code, don’t break the old tests while
getting the new one to work!
20. TDD Walkthrough - The Time in Words
So, that being said, how do we make our
function do both of these? Looks like an if
statement will solve that problem.
And run our tests again, they should be passing
now.
21. TDD Walkthrough - The Time in Words
We have an opportunity to make our code cleaner! Whenever your tests are
passing and you are in a good state, you can look back at your code and look for
ways to improve it.
Removing duplication is one of those ways to clean up code. Duplication here
means using the same thing or doing the same thing in more than one place.
22. TDD Walkthrough - The Time in Words
Where is the duplication?
We use the word ‘five’ in both our strings. That
word will change when we do other hours in the
day, so this looks like a good opportunity for
refactoring.
23. TDD Walkthrough - The Time in Words
Extract the ‘five’ in the strings to a local variable.
Rerun those tests. They had better still be
passing! As long as they are passing, we can
continue.
What next? Let’s translate 5:15 to quarter past
five. Write the test first. Make sure it is failing.
24. TDD Walkthrough - The Time in Words
Much like last time, we can write an if statement
for the quarter past five case. Thanks to our
refactoring from before, we can reuse the hour
variable for our return.
Tests are passing again! Is there an opportunity
to clean the code?
25. TDD Walkthrough - The Time in Words
The return from the ‘half past’ and the ‘quarter
past’ look awfully similar. The only difference is
the ‘quarter’ vs the ‘half’. Let’s extract the ‘past’
out to local variable, as a step towards cleaning
the code.
We have changed the code, so we must run the
tests! They are still passing, so we may
continue.
26. TDD Walkthrough - The Time in Words
There is a type of duplication here as well! The
‘quarter past’ scenario and the ‘half past’
scenario look rather similar, the difference is in
the minutes past the hour.
The way to cleaner code may not be obvious
here. There is a duplication of intent in terms of
the minutes past the hour. Let’s turn the ‘quarter’
and the ‘hour’ into variables, and maybe the way
to cleaner code will become more obvious.
27. TDD Walkthrough - The Time in Words
How about that? They return just about the
same thing. Let’s move the returns down, to
remove the duplication.
Ah, but there is a problem. The return for the
hour o’ clock scenario conflicts if we move the
minutes past hour return down. Let’s find a way
to move the hour o’ clock return up so it doesn’t
conflict. Will an if statement change anything?
28. TDD Walkthrough - The Time in Words
Make the change. Run the tests. Everything is
green. The hour o’ clock if block can be moved
up now, with less fear of breaking things.
29. TDD Walkthrough - The Time in Words
That move didn’t break anything. Running our
tests will tell us that.
Now we should be able to move the minutes
past hour returns down without conflict.
30. TDD Walkthrough - The Time in Words
Quite a few changes were made. Run the tests,
make sure they pass, and continue on.
What should our next test be? Since we are
returning minutes past hour, we can probably
implement one minute past and ten minute past.
Let’s start with one minute past.
31. TDD Walkthrough - The Time in Words
Run the test to see it failing. Now, how to solve
this? An if statement would solve this problem
easily.
I’ll put the one minute past scenario between the
hour o’ clock and the quarter past scenario, so
that the scenarios are in ascending order by
minutes.
Organization does make code easier to read.
32. TDD Walkthrough - The Time in Words
Ok, tests should be passing.
But now our code doesn’t look so good with so
many if statements. We should clean those up.
What can we do about them? For one thing,
they only seem to care about the minutes. Let’s
change the if conditional to reflect that. The
javascript slice function will work here.
There is a pattern here. If the minutes of the
input is this, minutes is set to that. There are 3
pairs of this pattern.
33. TDD Walkthrough - The Time in Words
This pattern can be refactored into a key/value
type data structure. Some people call it
dictionaries, some people call it look ups. In
javascript, we can just use an object. Write up
the object first with its pairs.
Then replace the minutes strings with the
appropriate key from the minutes conversion
object.
34. TDD Walkthrough - The Time in Words
What I am doing here falls under a technique where you first create the
duplication, migrate your code from one version to the other version, then remove
the duplication.
In doing so, you migrate your code from one structure to another structure in a
step-by-step process. This method lets you catch errors while they are small. Feel
free to run tests continuously while making the changes.
35. TDD Walkthrough - The Time in Words
Now all these if statements look about the same!
Who needs the if statements anymore. Just
remove them.
36. TDD Walkthrough - The Time in Words
Pretty impressive, how so much code collapsed
into the one line. And all of this was done in an
incremental manner using certain techniques.
But wait, there’s more! What happens when we
try to add the next test case, ten minutes past
five?
37. TDD Walkthrough - The Time in Words
How much code would it take to pass this test?
Just a key value pair. Our code is very clean
and easy to change. That’s good news,
considering that our next few test cases will be
more interesting. Let’s do quarter to six first.
38. TDD Walkthrough - The Time in Words
Write the test and see it fail.
Quarter to six doesn’t seem to fit well into our
current code. Looks like we’ll have to write an if
statement for this. We’ll figure out how to make
it cleaner later.
39. TDD Walkthrough - The Time in Words
Tests should be passing now, but our code isn’t
as clean as before. We can take some small
steps to making it cleaner. We can change the
conditional to check minutes. And we can add
45 minutes as a key value pair.
It’s a small improvement. Having something
better than before is fine. Our upcoming test
cases will make the cleaner code more obvious
too.
40. TDD Walkthrough - The Time in Words
Tests should be passing now, but our code isn’t
as clean as before. We can take some small
steps to making it cleaner. We can change the
conditional to check minutes. And we can add
45 minutes as a key value pair.
It’s a small improvement. Having something
better than before is fine. Our upcoming test
cases will make the cleaner code more obvious
too.
41. TDD Walkthrough - The Time in Words
Let’s do 5:40, and run the tests to see it fail.
We can use some of our existing structure for
this scenario. We can add 40 to the minutes
conversion, and we can use our 45 minute
scenario to implement the 40 minute scenario
too. Not bad, but still a little bulky looking. Let’s
clean up a bit. When do we use the minutes to
six logic? When minutes is past 30. So let’s
replace the if conditional with that.
42. TDD Walkthrough - The Time in Words
Make the change. Run the tests and make sure
you don’t break anything. Now that’s better.
What other patterns are there? When minutes is
past 30, you say ‘to’ and ‘six’. Otherwise you
say ‘past’ and ‘five’. That sounds like something
we can implement with variables and logic.
43. TDD Walkthrough - The Time in Words
At this point, the return inside the if block looks
quite similar to the return at the end. Let’s make
them exactly the same. Then remove the return
from the if block. Theoretically everything should
still pass!
And they do pass! Our code doesn’t look so
bad, and we’ve hit all the major test cases. The
remaining test cases fit into our code very well.
Just add some key value pairs to the minutes
conversion object.
44. TDD Walkthrough - The Time in Words
Now, there is more duplication to remove and other refactorings to do to improve
the code quality, but I will leave that to you guys. This walkthrough illustrates how I
solve this problem in somewhat small steps. What I didn't dive into was why, or
how I knew that step was the next small step. I believe that the whys and hows
are best acquired through personal experience. So I encourage you guys to get
out there and try it! Good Luck!
45. TDD Walkthrough - The Time in Words
For those who want to look at the source code, I have this walkthrough posted on
github here:
https://github.com/khapeterk/TDDWalkthroughTheTimeInWords