Roy Osherove provides training courses on test-driven development (TDD), behavior-driven development (BDD), and consulting/coaching services. He teaches TDD techniques for JavaScript, Ruby, Java, C#, and EpiServer/MVC frameworks. He also offers leadership training through 5whys.com. His focus is on using TDD to drive development, influence design decisions, and enable incremental delivery and early feedback. He advocates for TDD when code will need to be maintained long-term or for minimum viable products, but not for proofs of concept or short-lived code.
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove
Roy Osherove provides training courses on topics like test-driven development (TDD), behavior-driven development (BDD), and consulting/coaching services. He discusses test reviews as an alternative to code reviews that can be quicker and help learning teams. The presentation focuses on creating tests that are trustworthy, maintainable, and readable through techniques like avoiding test logic, not repeating production logic, separating unit and integration tests, and using readable structures, naming, and avoiding magic values.
This document discusses principles and practices for unit testing legacy code. It covers background on large, old software projects with complex code. The motivation is to facilitate changes, not find bugs. Principles include keeping tests simple, not adding tests to bad code, avoiding assumptions, stopping legacy code creation, and educating others. Practices include setting up a framework, domain modeling, identifying hot areas to start, using a bottom-up approach, learning functions through tests, and making code testable by refactoring dependencies. The document advocates bringing order to chaos and finding fun in learning features and deleting code.
Unit Testing 101 presented at ESRI Developer Summit, March 24th, 2009. This talk reviews the key concepts of unit testing, the technologies used by DTSAgile in out development projects.
Ever tried doing Test First Test Driven Development? Ever failed? TDD is not easy to get right. Here's some practical advice on doing BDD and TDD correctly. This presentation attempts to explain to you why, what, and how you should test, tell you about the FIRST principles of tests, the connections of unit testing and the SOLID principles, writing testable code, test doubles, the AAA of unit testing, and some practical ideas about structuring tests.
The document discusses unit testing and best practices for writing effective unit tests. It defines what a unit test is and explores different philosophies for testing. It addresses challenges like flaky tests, testing private methods, and relying too heavily on code coverage metrics. The document provides examples of how to avoid these issues and write clean, focused unit tests that reliably test single units of code.
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
Unit testing is a method to test individual units of source code to determine if they are fit for use. A unit is the smallest testable part of an application. Unit tests are created by programmers during development. Test-driven development uses tests to drive the design by writing a failing test first, then code to pass the test, and refactoring the code. Unit tests should be isolated, repeatable, fast, self-documenting, and use techniques like dependency injection and mocking dependencies. Benefits of unit testing include instant feedback, promoting modularity, acting as a safety net for changes, and providing documentation.
Roy Osherove provides training courses on test-driven development (TDD), behavior-driven development (BDD), and consulting/coaching services. He teaches TDD techniques for JavaScript, Ruby, Java, C#, and EpiServer/MVC frameworks. He also offers leadership training through 5whys.com. His focus is on using TDD to drive development, influence design decisions, and enable incremental delivery and early feedback. He advocates for TDD when code will need to be maintained long-term or for minimum viable products, but not for proofs of concept or short-lived code.
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove
Roy Osherove provides training courses on topics like test-driven development (TDD), behavior-driven development (BDD), and consulting/coaching services. He discusses test reviews as an alternative to code reviews that can be quicker and help learning teams. The presentation focuses on creating tests that are trustworthy, maintainable, and readable through techniques like avoiding test logic, not repeating production logic, separating unit and integration tests, and using readable structures, naming, and avoiding magic values.
This document discusses principles and practices for unit testing legacy code. It covers background on large, old software projects with complex code. The motivation is to facilitate changes, not find bugs. Principles include keeping tests simple, not adding tests to bad code, avoiding assumptions, stopping legacy code creation, and educating others. Practices include setting up a framework, domain modeling, identifying hot areas to start, using a bottom-up approach, learning functions through tests, and making code testable by refactoring dependencies. The document advocates bringing order to chaos and finding fun in learning features and deleting code.
Unit Testing 101 presented at ESRI Developer Summit, March 24th, 2009. This talk reviews the key concepts of unit testing, the technologies used by DTSAgile in out development projects.
Ever tried doing Test First Test Driven Development? Ever failed? TDD is not easy to get right. Here's some practical advice on doing BDD and TDD correctly. This presentation attempts to explain to you why, what, and how you should test, tell you about the FIRST principles of tests, the connections of unit testing and the SOLID principles, writing testable code, test doubles, the AAA of unit testing, and some practical ideas about structuring tests.
The document discusses unit testing and best practices for writing effective unit tests. It defines what a unit test is and explores different philosophies for testing. It addresses challenges like flaky tests, testing private methods, and relying too heavily on code coverage metrics. The document provides examples of how to avoid these issues and write clean, focused unit tests that reliably test single units of code.
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
Unit testing is a method to test individual units of source code to determine if they are fit for use. A unit is the smallest testable part of an application. Unit tests are created by programmers during development. Test-driven development uses tests to drive the design by writing a failing test first, then code to pass the test, and refactoring the code. Unit tests should be isolated, repeatable, fast, self-documenting, and use techniques like dependency injection and mocking dependencies. Benefits of unit testing include instant feedback, promoting modularity, acting as a safety net for changes, and providing documentation.
Unit testing involves testing individual components of software to ensure they function as intended when isolated from the full system. It helps identify unintended effects of code changes. While unit tests cannot prove the absence of errors, they act as an executable specification for code behavior. Writing unit tests requires designing code for testability through principles like single responsibility and dependency injection. Tests should focus on public interfaces and state transitions, not implementation details. Test-driven development involves writing tests before code to define requirements and ensure only testable code is written. Mocking frameworks simulate dependencies to isolate the system under test. Well-written unit tests keep behaviors isolated, self-contained, and use the arrange-act-assert structure.
Unit testing has entered the main stream. It is generally considered best practice to have a high level of unit test code coverage, and to ideally write tests before the code, via Test Driven Development.
However, some code is just plain difficult to test. The cost of effort of adding the tests may seem to outweigh the benefits. In this session, we will do a quick review of the benefits of unit tests, but focus on how to test tricky code, such as that static and private methods, and legacy code in general.
Examples are in Java, but the principals are language agnostic.
SpringOne Platform 2016
Speaker: Matt Parker; Engineering Director, Pivotal.
TDD, the savior of bad code, the promise of a better world. And yet… so many teams have tried TDD and failed. It’s a deceptively simple practice that actually requires a good deal of craftsmanship and skill to wield effectively. Through explanations and examples, we’ll examine a number of common problems teams face, including:
Test Coupling
Many folks our community promote the idea that unit testing means having a test file for every production class, and a test for every public method. And yet this tightly couples tests to the underlying design patterns of the codebase, and makes it hard to refactor. We’ll look at a way to minimize the surface area of your testing and intentionally define an interface between your tests and production code.
Mocking (Hammer of the Gods)
Mockito (and libraries like it) have created very simple and powerful ways for Java developers to create and use test doubles in their tests. And yet those libraries have also led to a good deal of misunderstanding and misuse of test doubles. We’ll examine the five types of test doubles, their roles, and when they’re applicable – and we’ll also look at the common problems developers run into misusing these tools and concepts.
Death by a Thousand Flakes
Outside-in behavior driven development is a commonly used practice. And yet we have too often conflated “outside” with ”GUI” – with disastrous results. We’ll look at the problems this has caused, including slow test suites, flaky test suites, upside down testing pyramids, and more.
Test Suite Bankruptcy
When all of these bad practices combine, they lead to one place: test suite bankruptcy. We’ll examine a case study of a team that, with the best intentions, applied all of these practices together for the better part of a year, and was forced to declare test suite bankruptcy at the end. We’ll talk about the tell-tale signs that you are approaching bankruptcy, and what you should do if you ever find yourself in that situation (or inheriting that situation from others).
Refactoring legacy code driven by tests - ENGLuca Minudel
re you working on code poorly designed or on legacy code that’s hard to test? And you cannot refactor it because there are no tests?
During this Coding Dojo you’ll be assigned a coding challenge in Java, C#, Ruby, JavaScript or Python. You will face the challenge of improving the design and refactoring existing code in order to make it testable and to write unit tests.
We will discuss SOLID principles, the relation between design and TDD, and how this applies to your solution.
Reading list:
Growing Object-Oriented Software, Guided by Tests; Steve Freeman, Nat Pryce
Test Driven Development: By Example; Kent Beck
Working Effectively with Legacy; Michael Feathers
Agile Software Development, Principles, Patterns, and Practices; Robert C. Martin (C++, Java)
Agile Principles, Patterns, and Practices in C#; Robert C. Martin (C#)
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
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
Unit and integration tests are automated tests written by developers to test their code. Unit tests test individual functions or methods, while integration tests test how components work together. Tests are run automatically during continuous integration to check for failures and ensure code works as intended before deployment. Writing tests is important to catch bugs early and ensure code continues working properly over time as changes are made. Mocking is used in unit tests to simulate interactions between code components without executing their actual implementation.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
The document discusses various techniques for debugging software bugs, including gathering relevant information, forming and testing hypotheses about the cause, and strategies like tracing execution, simplifying tests, questioning assumptions, and cleaning up unused code. It also provides a checklist for determining the root cause of bugs and ensuring debugging efforts are focused on the right location. The goal of debugging is to understand why bugs occur so they can be removed and prevent future bugs through improved testing, risk management, and learning from past issues.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
This document provides an introduction to test-driven development (TDD). It discusses the benefits of unit testing over end-to-end testing, including error localization, execution time, tighter feedback loops, and test coverage. It defines what constitutes a unit test and what does not. Examples of difficult scenarios to unit test are given. The basic TDD cycle of writing a failing test, making the test pass, and refactoring is explained. An exercise demonstrates applying TDD principles. Mock objects and the differences between the Chicago and London schools of TDD are briefly covered. Finally, additional resources on TDD are listed.
This document discusses concurrency errors in Java and how to avoid them. It begins by defining a concurrency error as the result of incorrect synchronization that can cause issues like race conditions and starvation. It notes that concurrency errors can lead to data corruption, security vulnerabilities, and incorrect behavior. While Java includes synchronization primitives, concurrency is still tricky and errors can occur if the primitives are used incorrectly or without properly designing the concurrency model. The document provides examples of potential concurrency errors and ways to avoid them, such as locking on an appropriate shared object to ensure atomic read/write operations. In the end, it emphasizes the importance of remaining vigilant about concurrency through tools, analysis, and careful design.
This document provides an overview of unit testing. It defines a unit as a software component containing routines and variables. Unit testing involves testing individual units in isolation to find defects. The benefits of unit testing include refactoring code easily and making integration testing simpler. Various test types are covered, including functional, non-functional, and structure-based testing. Static and white box testing techniques like statement coverage and branch coverage are also discussed. The document concludes with guidelines for effective unit testing.
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...Alan Richardson
A common reason for Null Pointer Exceptions in Java is a variable redeclaration instead of instantiation. Learn what that means, how to avoid it, and how to spot it, in this presentation.
Read the full blog post: http://testerhq.com/post/blogs/javafortesters/2017-08-29-faq-null-pointer-exception/
Visit my Java Web Site: http://javafortesters.com
---
# FAQ - why does my code throw a null pointer exception - common reason #1 Redeclaration
- Using `@BeforeClass` or `@Before` can setup data for use in tests
- Any 'variables' we instantiate need to be 'fields' rather than variables
- We want to instantiate them in the setup method rather than redeclare them
---
# Example of the Problem
I know I will use an `Adder` in my test so I create it as a field:
~~~~~~~~
public class WhyCodeThrowsNullPointerExceptionTest {
Adder adder;
~~~~~~~~
I don't want to re-instantiate it each time so I make an `@BeforeClass` method to instantiate it:
~~~~~~~~
@BeforeClass
public static void setupAdder(){
Adder adder = new Adder();
}
~~~~~~~~
**Warning: Error in the above code**
---
# Semantic Error
I just made a Semantic coding error. This won't be caught by a compiler, but it will cause my `@Test` to fail with a Null Pointer Exception.
In the setup method I really wanted to assign a value to the field, instead I created an new variable with the same name.
# In General
- Try to write one test at a time so that if you have a problem it is easier to identify where the problem is
- Try to write working isolated tests and then refactor to a more general solution when you need it - that way, you know it was working, so you just have to work backwards to find out what went wrong
- Try to use automated IDE refactoring rather than move code around manually
- Use the IDE syntax highlighting to help spot any issues
This document discusses unit testing and provides an overview of its benefits and best practices. It defines unit testing as testing small pieces of code in isolation. It recommends writing unit tests for all code to check functionality and prevent bugs, and integrating testing into the development process by writing tests before code and ensuring tests pass before check-ins. The document also discusses test-driven development, refactoring code based on test results, and tools like NUnit that can automate the testing process.
Oh dear, your application has suddenly stopped working as expected. What should you do now?
Using techniques applicable to any php application, we'll go over what to look for and which problems to avoid when trying to determine where the problem lies. We'll show how to correctly identify and deal with problems including:
* network connectivity
* server config issues
* php config
* WSOD
* common CakePHP application errors
The document summarizes key concepts from the Udacity CS259 Software Debugging course, including:
1) Three states of errors in programs - defects in code, infections spreading errors, and failures in execution. Understanding how errors propagate through a program is important to debugging.
2) Techniques for debugging like assertions, code coverage, tracing, delta debugging and phi scoring to narrow relevant information and find root causes of failures.
3) Managing bugs in a project through proper tracking of problem lifecycles from new to closed, and use of bug databases linked to version control to map defects to code revisions.
- Testing shows the presence, not the absence of bugs. Tests are driven by requirements and business rules, focusing only on relevant cases rather than testing everything.
- Tests improve quality and confidence by verifying that each scenario works as expected. Tests serve as live documentation of the system.
- While testing has been used for decades in different forms like debugging, demonstration, and evaluation, modern test-driven development and integrated testing frameworks from the 1990s helped establish testing as a mainstream practice.
Collaboration avec le client plutôt que négociation de contrat » est certes l'un des 4 piliers du manifeste agile. Mais quel client, quel fournisseur seraient capables de démarrer un projet sans contrat? Cette présentation n'a pas pour objectif de vous donner la solution clés en main mais d'ouvrir le débat après avoir dépeint les solutions disponibles et donné des pistes de réflexion
Unit testing involves testing individual components of software to ensure they function as intended when isolated from the full system. It helps identify unintended effects of code changes. While unit tests cannot prove the absence of errors, they act as an executable specification for code behavior. Writing unit tests requires designing code for testability through principles like single responsibility and dependency injection. Tests should focus on public interfaces and state transitions, not implementation details. Test-driven development involves writing tests before code to define requirements and ensure only testable code is written. Mocking frameworks simulate dependencies to isolate the system under test. Well-written unit tests keep behaviors isolated, self-contained, and use the arrange-act-assert structure.
Unit testing has entered the main stream. It is generally considered best practice to have a high level of unit test code coverage, and to ideally write tests before the code, via Test Driven Development.
However, some code is just plain difficult to test. The cost of effort of adding the tests may seem to outweigh the benefits. In this session, we will do a quick review of the benefits of unit tests, but focus on how to test tricky code, such as that static and private methods, and legacy code in general.
Examples are in Java, but the principals are language agnostic.
SpringOne Platform 2016
Speaker: Matt Parker; Engineering Director, Pivotal.
TDD, the savior of bad code, the promise of a better world. And yet… so many teams have tried TDD and failed. It’s a deceptively simple practice that actually requires a good deal of craftsmanship and skill to wield effectively. Through explanations and examples, we’ll examine a number of common problems teams face, including:
Test Coupling
Many folks our community promote the idea that unit testing means having a test file for every production class, and a test for every public method. And yet this tightly couples tests to the underlying design patterns of the codebase, and makes it hard to refactor. We’ll look at a way to minimize the surface area of your testing and intentionally define an interface between your tests and production code.
Mocking (Hammer of the Gods)
Mockito (and libraries like it) have created very simple and powerful ways for Java developers to create and use test doubles in their tests. And yet those libraries have also led to a good deal of misunderstanding and misuse of test doubles. We’ll examine the five types of test doubles, their roles, and when they’re applicable – and we’ll also look at the common problems developers run into misusing these tools and concepts.
Death by a Thousand Flakes
Outside-in behavior driven development is a commonly used practice. And yet we have too often conflated “outside” with ”GUI” – with disastrous results. We’ll look at the problems this has caused, including slow test suites, flaky test suites, upside down testing pyramids, and more.
Test Suite Bankruptcy
When all of these bad practices combine, they lead to one place: test suite bankruptcy. We’ll examine a case study of a team that, with the best intentions, applied all of these practices together for the better part of a year, and was forced to declare test suite bankruptcy at the end. We’ll talk about the tell-tale signs that you are approaching bankruptcy, and what you should do if you ever find yourself in that situation (or inheriting that situation from others).
Refactoring legacy code driven by tests - ENGLuca Minudel
re you working on code poorly designed or on legacy code that’s hard to test? And you cannot refactor it because there are no tests?
During this Coding Dojo you’ll be assigned a coding challenge in Java, C#, Ruby, JavaScript or Python. You will face the challenge of improving the design and refactoring existing code in order to make it testable and to write unit tests.
We will discuss SOLID principles, the relation between design and TDD, and how this applies to your solution.
Reading list:
Growing Object-Oriented Software, Guided by Tests; Steve Freeman, Nat Pryce
Test Driven Development: By Example; Kent Beck
Working Effectively with Legacy; Michael Feathers
Agile Software Development, Principles, Patterns, and Practices; Robert C. Martin (C++, Java)
Agile Principles, Patterns, and Practices in C#; Robert C. Martin (C#)
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
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
Unit and integration tests are automated tests written by developers to test their code. Unit tests test individual functions or methods, while integration tests test how components work together. Tests are run automatically during continuous integration to check for failures and ensure code works as intended before deployment. Writing tests is important to catch bugs early and ensure code continues working properly over time as changes are made. Mocking is used in unit tests to simulate interactions between code components without executing their actual implementation.
This document provides an overview of test-driven development (TDD). It defines TDD as a technique for building software where tests are written before code to guide development. The key aspects of TDD covered are:
- Writing tests first before code, which helps improve design and ensures tests are written.
- The TDD mantra of Red-Green-Refactor, where tests initially fail (Red), code is written to pass tests (Green), then code is refactored to improve design.
- An example case study of a large Java project developed using TDD that has over 20,000 lines of unit tests providing over 90% test coverage.
The document discusses various techniques for debugging software bugs, including gathering relevant information, forming and testing hypotheses about the cause, and strategies like tracing execution, simplifying tests, questioning assumptions, and cleaning up unused code. It also provides a checklist for determining the root cause of bugs and ensuring debugging efforts are focused on the right location. The goal of debugging is to understand why bugs occur so they can be removed and prevent future bugs through improved testing, risk management, and learning from past issues.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
This document provides an introduction to test-driven development (TDD). It discusses the benefits of unit testing over end-to-end testing, including error localization, execution time, tighter feedback loops, and test coverage. It defines what constitutes a unit test and what does not. Examples of difficult scenarios to unit test are given. The basic TDD cycle of writing a failing test, making the test pass, and refactoring is explained. An exercise demonstrates applying TDD principles. Mock objects and the differences between the Chicago and London schools of TDD are briefly covered. Finally, additional resources on TDD are listed.
This document discusses concurrency errors in Java and how to avoid them. It begins by defining a concurrency error as the result of incorrect synchronization that can cause issues like race conditions and starvation. It notes that concurrency errors can lead to data corruption, security vulnerabilities, and incorrect behavior. While Java includes synchronization primitives, concurrency is still tricky and errors can occur if the primitives are used incorrectly or without properly designing the concurrency model. The document provides examples of potential concurrency errors and ways to avoid them, such as locking on an appropriate shared object to ensure atomic read/write operations. In the end, it emphasizes the importance of remaining vigilant about concurrency through tools, analysis, and careful design.
This document provides an overview of unit testing. It defines a unit as a software component containing routines and variables. Unit testing involves testing individual units in isolation to find defects. The benefits of unit testing include refactoring code easily and making integration testing simpler. Various test types are covered, including functional, non-functional, and structure-based testing. Static and white box testing techniques like statement coverage and branch coverage are also discussed. The document concludes with guidelines for effective unit testing.
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...Alan Richardson
A common reason for Null Pointer Exceptions in Java is a variable redeclaration instead of instantiation. Learn what that means, how to avoid it, and how to spot it, in this presentation.
Read the full blog post: http://testerhq.com/post/blogs/javafortesters/2017-08-29-faq-null-pointer-exception/
Visit my Java Web Site: http://javafortesters.com
---
# FAQ - why does my code throw a null pointer exception - common reason #1 Redeclaration
- Using `@BeforeClass` or `@Before` can setup data for use in tests
- Any 'variables' we instantiate need to be 'fields' rather than variables
- We want to instantiate them in the setup method rather than redeclare them
---
# Example of the Problem
I know I will use an `Adder` in my test so I create it as a field:
~~~~~~~~
public class WhyCodeThrowsNullPointerExceptionTest {
Adder adder;
~~~~~~~~
I don't want to re-instantiate it each time so I make an `@BeforeClass` method to instantiate it:
~~~~~~~~
@BeforeClass
public static void setupAdder(){
Adder adder = new Adder();
}
~~~~~~~~
**Warning: Error in the above code**
---
# Semantic Error
I just made a Semantic coding error. This won't be caught by a compiler, but it will cause my `@Test` to fail with a Null Pointer Exception.
In the setup method I really wanted to assign a value to the field, instead I created an new variable with the same name.
# In General
- Try to write one test at a time so that if you have a problem it is easier to identify where the problem is
- Try to write working isolated tests and then refactor to a more general solution when you need it - that way, you know it was working, so you just have to work backwards to find out what went wrong
- Try to use automated IDE refactoring rather than move code around manually
- Use the IDE syntax highlighting to help spot any issues
This document discusses unit testing and provides an overview of its benefits and best practices. It defines unit testing as testing small pieces of code in isolation. It recommends writing unit tests for all code to check functionality and prevent bugs, and integrating testing into the development process by writing tests before code and ensuring tests pass before check-ins. The document also discusses test-driven development, refactoring code based on test results, and tools like NUnit that can automate the testing process.
Oh dear, your application has suddenly stopped working as expected. What should you do now?
Using techniques applicable to any php application, we'll go over what to look for and which problems to avoid when trying to determine where the problem lies. We'll show how to correctly identify and deal with problems including:
* network connectivity
* server config issues
* php config
* WSOD
* common CakePHP application errors
The document summarizes key concepts from the Udacity CS259 Software Debugging course, including:
1) Three states of errors in programs - defects in code, infections spreading errors, and failures in execution. Understanding how errors propagate through a program is important to debugging.
2) Techniques for debugging like assertions, code coverage, tracing, delta debugging and phi scoring to narrow relevant information and find root causes of failures.
3) Managing bugs in a project through proper tracking of problem lifecycles from new to closed, and use of bug databases linked to version control to map defects to code revisions.
- Testing shows the presence, not the absence of bugs. Tests are driven by requirements and business rules, focusing only on relevant cases rather than testing everything.
- Tests improve quality and confidence by verifying that each scenario works as expected. Tests serve as live documentation of the system.
- While testing has been used for decades in different forms like debugging, demonstration, and evaluation, modern test-driven development and integrated testing frameworks from the 1990s helped establish testing as a mainstream practice.
Collaboration avec le client plutôt que négociation de contrat » est certes l'un des 4 piliers du manifeste agile. Mais quel client, quel fournisseur seraient capables de démarrer un projet sans contrat? Cette présentation n'a pas pour objectif de vous donner la solution clés en main mais d'ouvrir le débat après avoir dépeint les solutions disponibles et donné des pistes de réflexion
Alors que les modèles classiques de conduite de projets impliquant les technologies de l'information (mais pas exclusivement) - tels que cycle en V - résistent mal à l'épreuve des faits, les méthodes agiles s'imposent de plus en plus comme une alternative crédible à la gestion de projet informatique, mettant en avant l'adaptation et l'interaction entre les personnes plutôt que la prédiction et la gestion d'un contrat figé.
Elles se présentent sous une forme originale : partant d'un Manifeste, elles invitent au respect de valeurs et de principes tels que la communication, la simplicité et le feedback, tentant de réconcilier les trop fréquents écueils vécus entre un client intransigeant (sur la base d'un cahier des charges approximatif ou instable) et une équipe de développement déresponsabilisée.
Disciplinées, rigoureuses et efficaces, les méthodes AGILE proposent une structuration de la gestion de projet qui, pour la majorité des cas, n'impose pas de lourdeur superflue.
Sous le feu des critiques: Trop moderne! Pas assez subversive aux yeux de certains! Pas créative! Un effet de mode passager pour les "djeunz"! Ou pire une musique de drogués!! Permettez moi au cours de cette session de vous éclairer sur cette culture et également sur les coulisses de la création des musiques assistées par ordinateur (MAO), et de voir ensemble les relations intéressantes que l'on peut tisser avec nos pratiques du développement logiciel (Software Craftsmanship).
On a pu lire quelques analogies entre pratique des musiques jazz, somme toute une musique très classique, et la pratique du développement logiciel tel que nous la concevons tous ici ("agile" diront certain). Pourtant il y a bien des façons de faire de la musique et en tant que spécialistes de la programmation j'ai été étonné de constater que peu d'entre nous s’intéressent à la musique dite "électronique". Pourtant, dans ces musiques aussi, nous nous servons d'outils logiciels au service de notre inspiration et notre créativité. On retrouve l'approche incrémentale, la technique imposée par les machines, des patterns évidemment, mais aussi de la pratique répétée, de l'amélioration continue et la coopération quand nous formons des groupes collaboratifs.
Au cours de cette session, après les généralités d'usage, je vous montrerai un DAW (digital audio workstation) logiciel, très couramment employé, et pas que pour la musique électronique, j'ai nommé "Live 9" d'Ableton avec sa surface de contrôle dédiée: Push (une sorte de clavier multi-fonctions pour la musique). Live est également extensible grâce à Max MSP, une API de programmation qui permet de scripter/patcher ce logiciel sous bien des formes.
J'espère vous montrer que création et programmation ne sont pas si éloignés que cela... et vous ferai partager mon expérience au sein de la Do It Yourself Music Academy
Présentation des différents designs applicatifs et de leur implémentation avec Symfony2.
Les exemples sont disponibles sur Github :
https://github.com/romainkuzniak
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
Treat Your Unit Tests As Production Code - DARGO - Amadeus - Soirée du Test L...TelecomValley
The document discusses unit testing and provides tips for writing robust unit tests. It notes that unit tests should be treated like production code by following best practices for quality and maintainability. Common problems with unit tests include external dependencies, fragile test code that breaks easily, and not refactoring test code when refactoring production code. To address these, the document recommends techniques like dependency injection, avoiding direct dependencies on databases/IO, and allowing test code to evolve independently from production code structure. The goal is to write unit tests that can evolve alongside the code under test without breaking.
This document discusses testing Enterprise JavaBeans (EJB) applications. It acknowledges that EJB frameworks were not originally designed with testing in mind. However, it outlines several approaches that can be used to test EJBs, including unit testing from the bottom of the test pyramid, using dependency injection frameworks like Spring that facilitate testing, and using embedded containers or the Arquillian testing framework to test more fully integrated applications. The document advocates for testing EJB applications and provides examples of how different testing frameworks approach testing EJBs.
Unit Testing, TDD and the Walking SkeletonSeb Rose
The document discusses unit testing, test-driven development (TDD), and the walking skeleton approach. It provides an overview of these software development practices, including writing automated tests before code, using the tests to drive code development, and starting projects with an initial architecture or "walking skeleton" that is automatically testable, buildable, and deployable. The document aims to dispel common myths about testing and convince readers of the value of these practices.
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?
Agile * Agile Principles * Agile Practices * Pair Programming * Extreme Programming * SOLID design principles * SDLC * Software Development
After working 10 years in multiple major "from-scratch" development projects, I finally got a chance to work in a truly Agile development project. Here is my take on how to make Agile work for your project.
This document discusses testing from a developer perspective. It recommends writing tests first before coding to document intentions and allow for safe refactoring. Various testing frameworks are described, including xUnit frameworks, behavior driven development (BDD) frameworks that describe expected behavior, and BDD frameworks that use Given/When/Then syntax. It also discusses the importance of UI/UX testing tools like Selenium. The key takeaways are: 1) write tests first to guide development, 2) xUnit and BDD frameworks provide different approaches to testing code, 3) UI testing tools are needed to test applications at a user interface level.
The document discusses best practices for database development and deployment. It recommends having identical environments for development, testing, and production to enable easy comparisons. This allows issues to be detected and fixed before production deployment. It also suggests using tools that track database changes and compare schemas to simplify environments and ensure consistency across stages. Regular practice deployments in non-production environments are advised to work out any issues before changes reach production.
This is an introduction to unit testing using various mocking frameworks. It covers why you should consider using a mocking framework, how to apply mocks in your unit testing, and a high level comparison of various tools for mocking/stub creation. The distinction between mocks and stubs is clearly defined.
This document discusses test-driven development (TDD) and behavior-driven development (BDD). It covers the core principles and rules of TDD, including writing failing tests first and then code to pass the tests. The benefits of TDD are described, such as improved design, documentation, and catching errors earlier. Challenges with TDD are acknowledged, but it is argued that with experience writing clean code and following design best practices, TDD can help developers write higher quality code. Tools for writing tests like Hamcrest and AssertJ are also mentioned.
Neo4j Stored Procedure Training Part 1Max De Marzi
This document provides instructions for creating and testing a stored procedure in Neo4j using Java and Maven. It discusses setting up a Maven project with the necessary dependencies, creating a stored procedure class with the @Procedure annotation, returning results with a custom Result class, and testing the procedure using the Neo4jRule to start an embedded Neo4j instance with the procedure deployed. The document contains code snippets and step-by-step explanations for setting up the project structure, procedure, and test.
The document discusses various aspects of automating software testing. It suggests automating the detection of flaky tests, determining the severity of test failures, converting tests to more isolated unit tests, and using usage data to determine what to test next. It emphasizes that while automation can improve testing efficiency, human oversight is still needed, and code reviews serve as the link between automated and manual processes.
Unit Testing like a Pro - The Circle of PurityVictor Rentea
Best practices on designing unit tests, designing testable production code, a glimpse of TDD, using mocks and isolating pure functions for easy testing. Talk distilled from http://victorrentea.ro/#unit-testing
Held at VoxxedDays Bucharest in March 2019.
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.
This document discusses 10 ways to improve programming code through practices like composing methods, test-driven development, static analysis, and questioning assumptions. It encourages techniques like short single-purpose methods, writing tests before code, using tools like FindBugs, avoiding unnecessary complexity, and continually learning language nuances. Examples show refactoring code to follow these practices. Resources are provided on related topics like pair programming and anti-object-oriented design.
Why should we use TDD to develop in Elixir? When we are applying it correctly? What are the differences that we can find in a code developed with TDD and in code not developed with it? Is it TDD about testing? Really? In this talk, I'll show what is TDD and how can be used it in functional programming like Elixir to design the small and the big parts of your system, showing what are the difference and the similarities between an OOP and FP environment. Showing what is the values of applying a technique like TDD in Elixir and what we should obtain applying it.
This document summarizes 10 ways to improve code based on a presentation by Neal Ford. The techniques discussed include composing methods to perform single tasks, test-driven development to design through tests, using static analysis tools to find bugs, avoiding singletons, applying the YAGNI principle to only build what is needed, questioning conventions, embracing polyglot programming, learning Java nuances, enforcing the single level of abstraction principle, and considering "anti-objects" that go against object-oriented design. Questions from the audience are then addressed.
1. The document discusses the challenges of building software in a chaotic world, noting that building software is not a linear process and involves much uncertainty.
2. It emphasizes the importance of taking an iterative approach to reduce risks, having a strong user-centered vision rather than being user-led, and focusing on building the right product for the right customer.
3. The author advocates for viewing building software as a human activity involving technical and social complexity, and notes that processes, coordination across and within teams, and roles like product management are important for navigating this complex work.
The document discusses mutation testing and provides tips for implementing it. It explains different types of mutations like statement, value, and decision mutations. It also discusses how to calculate mutation score and challenges like cost. Examples are provided using tools like Pitest and Stryker. Advice is given around using mocks, refactoring complex code, and targeting tests to improve mutation testing.
This document discusses functional programming concepts. It explains that functional programming treats functions as first-class citizens and avoids side effects. Pure functions are easier to reason about because their outputs only depend on their inputs. The document also discusses avoiding null values and exceptions by using options and monads. Functional programming encourages immutability, referential transparency, and honesty in function signatures to make code more readable and easier to test.
This document provides an overview of domain-driven design (DDD) based on a feedback session in Amsterdam. It discusses:
1. What DDD is and is not - it is not a method, framework, or tool but has concepts like ubiquitous language, domain model, bounded contexts, and event sourcing.
2. Key DDD principles like having domain experts define the problem and solution, using a ubiquitous language, and designing bounded contexts to separate concerns while maintaining relationships.
3. Techniques for exploring a domain like event storming, user personas, acceptance tests, and distilling the core vs. support domains.
4. Architectural approaches like hexagonal/ports and adapters and
Que se passe t il avec l'Agilité en 2020. Crise de confiance? Manque d'évolutions? La crise du Covid19 a t elle permis de développer l'agilité dans les entreprises. Allons voir...
https://www.youtube.com/watch?v=URO7195UIdM&feature=youtu.be
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Things to Consider When Choosing a Website Developer for your Website | FODUUFODUU
Choosing the right website developer is crucial for your business. This article covers essential factors to consider, including experience, portfolio, technical skills, communication, pricing, reputation & reviews, cost and budget considerations and post-launch support. Make an informed decision to ensure your website meets your business goals.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
CAKE: Sharing Slices of Confidential Data on BlockchainClaudio Di Ciccio
Presented at the CAiSE 2024 Forum, Intelligent Information Systems, June 6th, Limassol, Cyprus.
Synopsis: Cooperative information systems typically involve various entities in a collaborative process within a distributed environment. Blockchain technology offers a mechanism for automating such processes, even when only partial trust exists among participants. The data stored on the blockchain is replicated across all nodes in the network, ensuring accessibility to all participants. While this aspect facilitates traceability, integrity, and persistence, it poses challenges for adopting public blockchains in enterprise settings due to confidentiality issues. In this paper, we present a software tool named Control Access via Key Encryption (CAKE), designed to ensure data confidentiality in scenarios involving public blockchains. After outlining its core components and functionalities, we showcase the application of CAKE in the context of a real-world cyber-security project within the logistics domain.
Paper: https://doi.org/10.1007/978-3-031-61000-4_16
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
32. MAKES YOUR LIFE EASIER
I must set up a Test DB
What if someone else add sh*t in your test DB?
Test DB is growing and growing…
What if you loose you DB connection?
What if you loose it all?
33. NO DEPENDENCE ON EXTERNAL STATE
• the tests must run the same
way every time they run
34. IDEMPOTENT TEST
you are able to rerun something because the process of
running it did not change its state.
45. ONE BUG = ONE MISSING TEST
No unit test can tell you that you need more tests…
Exploration can.
46. THERE’S ALWAYS A PATTERN
To be more and more isolated (SRP/OCP/LSP/ISP/DI)
• Factory
• Facade
• Visitor
• IoC ( Depency Injectors)
• ….
• MVP
• Humble Dialog ….
47. ALL IS A MATTER OF CONCEPTS
Abstraction & Architecture
48. CHANGE THE WAY YOU CODE
ALWAYS CODE AS YOU TEST: in isolation
-> Domain knows nothing about the infrastructure.