The document discusses test-driven development for TYPO3 projects. It introduces the concept of unit testing and test-driven development. It describes how the TYPO3 phpunit extension and PHPUnit can be used to write unit tests and run them automatically. It provides examples of different types of tests and how the testing framework can fake database records, frontend pages and other elements to test code in isolation.
Test-Driven Development for TYPO3 @ T3CON12DEOliver Klee
The document discusses test-driven development for TYPO3 and provides examples of unit testing code. It explains key concepts like test cases, test suites, assertions, and the lifecycle of unit tests. It encourages writing tests before code using a test-first approach and refactoring code. The document also provides best practices for naming unit tests with descriptive names that indicate the behavior and preconditions being tested.
The document discusses test-driven development for TYPO3 and describes how to use unit testing and the testing framework in TYPO3. It covers key testing concepts like test cases, assertions, and test suites. It also provides an overview of the testing lifecycle and recommends a test-first development approach. Finally, it demonstrates how the testing framework can be used to fake different parts of TYPO3 like records, relations, pages, and frontend users.
Unit testing for the TYPO3 4.x core (T3DD10)Oliver Klee
This document discusses unit testing for the TYPO3 CMS 4.x core. It explains why writing unit tests is important to verify code works as expected, prevent code from being broken, and allow for safe refactoring. It provides an overview of the phpunit testing framework and tools available in TYPO3 for running tests. Finally, it promotes a test-first development approach of writing tests before code.
Test-driven development for TYPO3 (T3DD11)Oliver Klee
This document discusses test-driven development for TYPO3. It provides an overview of unit testing, describing how automated testing is faster and more reliable than manual testing. It also summarizes a real estate manager extension that contains over 1600 tests that run in under 60 seconds. The document then discusses key testing concepts and terminology like test cases, test suites, assertions, and the lifecycle of unit tests. It promotes a test-first development approach and describes how to write meaningful, well-named unit tests. Finally, it outlines how the TYPO3 testing framework can fake or simulate different parts of an application to enable isolated and repeatable testing.
The document discusses different types of testing including unit tests, integration tests, and functional tests. It provides an overview of the unittest, doctest, zope.testing, ZopeTestCase, PortalTestCase, and PloneTestCase frameworks for testing in Python, Zope, and Plone. Examples are given of how to write and organize tests using these frameworks.
JUnit is a unit testing framework for Java that originated from xUnit. It allows developers to write test cases that test classes and methods in Java code. JUnit provides classes like TestCase that define test methods, TestSuite that collects multiple test cases, and TestRunner that executes the tests and reports results. Developers create test classes that extend TestCase and define test methods to verify the behavior of the classes under test. TestRunner is used to run test cases and test suites and display the results, which helps ensure code quality during refactoring.
This document discusses setting up and running tests for Plone projects. It covers traditional Plone 3 test setup using PPD and Optilux, newer test setup using testcaselayers, and the future of testing with plone.testing. It provides examples of testing Archetypes, Dexterity, portlets, and viewlets. Integration and functional tests are demonstrated along with the Zope and Plone test runners. Resources for further testing information and examples are also listed.
- The document describes an approach called ChangeCommander for recommending context changes to method invocations based on patterns learned from past context changes that fixed bugs.
- An initial validation of the approach on five open source projects showed it was able to recommend true positive context changes that later fixed bugs, with a varying number of false positive and false negative recommendations depending on the project.
- The goal of the ChangeCommander approach is to integrate recommendations into the development process to potentially reduce future bugs.
Test-Driven Development for TYPO3 @ T3CON12DEOliver Klee
The document discusses test-driven development for TYPO3 and provides examples of unit testing code. It explains key concepts like test cases, test suites, assertions, and the lifecycle of unit tests. It encourages writing tests before code using a test-first approach and refactoring code. The document also provides best practices for naming unit tests with descriptive names that indicate the behavior and preconditions being tested.
The document discusses test-driven development for TYPO3 and describes how to use unit testing and the testing framework in TYPO3. It covers key testing concepts like test cases, assertions, and test suites. It also provides an overview of the testing lifecycle and recommends a test-first development approach. Finally, it demonstrates how the testing framework can be used to fake different parts of TYPO3 like records, relations, pages, and frontend users.
Unit testing for the TYPO3 4.x core (T3DD10)Oliver Klee
This document discusses unit testing for the TYPO3 CMS 4.x core. It explains why writing unit tests is important to verify code works as expected, prevent code from being broken, and allow for safe refactoring. It provides an overview of the phpunit testing framework and tools available in TYPO3 for running tests. Finally, it promotes a test-first development approach of writing tests before code.
Test-driven development for TYPO3 (T3DD11)Oliver Klee
This document discusses test-driven development for TYPO3. It provides an overview of unit testing, describing how automated testing is faster and more reliable than manual testing. It also summarizes a real estate manager extension that contains over 1600 tests that run in under 60 seconds. The document then discusses key testing concepts and terminology like test cases, test suites, assertions, and the lifecycle of unit tests. It promotes a test-first development approach and describes how to write meaningful, well-named unit tests. Finally, it outlines how the TYPO3 testing framework can fake or simulate different parts of an application to enable isolated and repeatable testing.
The document discusses different types of testing including unit tests, integration tests, and functional tests. It provides an overview of the unittest, doctest, zope.testing, ZopeTestCase, PortalTestCase, and PloneTestCase frameworks for testing in Python, Zope, and Plone. Examples are given of how to write and organize tests using these frameworks.
JUnit is a unit testing framework for Java that originated from xUnit. It allows developers to write test cases that test classes and methods in Java code. JUnit provides classes like TestCase that define test methods, TestSuite that collects multiple test cases, and TestRunner that executes the tests and reports results. Developers create test classes that extend TestCase and define test methods to verify the behavior of the classes under test. TestRunner is used to run test cases and test suites and display the results, which helps ensure code quality during refactoring.
This document discusses setting up and running tests for Plone projects. It covers traditional Plone 3 test setup using PPD and Optilux, newer test setup using testcaselayers, and the future of testing with plone.testing. It provides examples of testing Archetypes, Dexterity, portlets, and viewlets. Integration and functional tests are demonstrated along with the Zope and Plone test runners. Resources for further testing information and examples are also listed.
- The document describes an approach called ChangeCommander for recommending context changes to method invocations based on patterns learned from past context changes that fixed bugs.
- An initial validation of the approach on five open source projects showed it was able to recommend true positive context changes that later fixed bugs, with a varying number of false positive and false negative recommendations depending on the project.
- The goal of the ChangeCommander approach is to integrate recommendations into the development process to potentially reduce future bugs.
This document describes how to create custom annotations in Java to simulate a simple unit test framework. It defines two annotations - @Test and @TesterInfo. @Test is used to mark test methods and optionally disable them. @TesterInfo stores metadata about test classes. The document also shows how to use reflection to read the annotations and execute the tests, outputting the results.
Test Driven Development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases that are failed, then code is written to pass the tests, and finally the new code is refactored if needed. This process allows software to be developed incrementally while facilitating change by providing continuous feedback. The document provides details on TDD patterns and processes like red-green-refactor cycles and using test doubles.
JUnit is the de facto standard in Java testing. Yet many advanced JUnit features are little known and poorly understood. This session reviews some lesser-known features of JUnit, along with a few associated libraries, that can make your unit tests more powerful, expressive, and fun. The session is intended for Java developers, lead developers, and architects trying to introduce good testing practices into their teams.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests to determine whether code is functioning as intended. Key aspects of JUnit include writing tests before code via test-driven development, annotations for metadata and configuration of tests, and the ability to isolate tests from external dependencies using stubs and mocks. JUnit helps improve code quality and avoid regressions by identifying problems early in the development cycle.
The document discusses JUnit 5, the next generation of the JUnit testing framework for Java. Key aspects include a new programming model using extensions, support for Java 8 features, and ways to migrate from earlier JUnit versions. The new framework consists of the JUnit Platform launcher, the JUnit Jupiter API for writing tests, and the JUnit Vintage engine for running JUnit 3 and 4 tests.
Unit testing with JUnit can be done using JUnit 3.x or 4.x frameworks. Key aspects include writing test cases as Java classes that extend TestCase and contain test methods starting with "test", using assertion methods like assertTrue and assertEquals to validate outcomes, and running tests from Eclipse. JUnit 4.x introduced annotations like @Before, @Test, and @After to respectively set up objects before each test, identify test methods, and tear down objects after tests.
This document provides an overview of unit testing in PHP using PHPUnit. It discusses some goals of test automation like improving quality and reducing risks. It also covers the testing continuum from unit to integration to functional tests. The document introduces PHPUnit and how it is based on the xUnit family of tools. It then walks through an example of writing the first PHPUnit test to test a ROT13 encoding function in a test-driven way, demonstrating best practices like following the RED-GREEN-REFACTOR process and using assertions. Finally, it discusses principles of good test automation like independence of tests and isolating the system under test.
This document provides an introduction to Test Driven Development (TDD) in Italian. It defines key TDD concepts like "test first" and automating tests. It then provides examples of using TDD to develop a parser for the "df" command output and features for an astrology horoscope application. The examples demonstrate the TDD process of writing a failing test, then code to pass the test, and refactoring. Rules for TDD like keeping tests passing and writing tests for all features are also outlined.
This document introduces unit testing with PHPUnit. It discusses what unit testing is, why it's important, and tools like SimpleTest and PHPUnit. It provides examples of basic unit tests for a HelloWorld class using PHPUnit. It also covers more advanced testing techniques like data providers, expected exceptions, fixtures, doubles, mocks, stubs, and database testing using examples like testing a BankAccount class. The document provides hints and tips for unit testing MVC frameworks like Zend Framework.
Unit testing involves writing code to test individual units or components of a software to ensure they operate as intended. JUnit is a popular tool for performing unit tests in Java. It allows writing test cases as Java classes and methods, and running them to validate the code under test. Eclipse IDE facilitates creating and running JUnit test cases directly from the Java code being tested.
The document shows the step-by-step development of a PrimeFactors class using test-driven development. Unit tests are added one by one to drive the implementation of a generate method to return the prime factors of a given integer. The tests initially fail and then the production code is written to pass each new test in turn.
Unit testing with PHPUnit - there's life outside of TDDPaweł Michalik
Basics of PHPUnit and why is it even more relevant in legacy code. Key points of the framework are explained, along with mocking objects, test organisation, creating documentations with tests and accessing non-public objects (where applicable).
Live version with additional notes available at: http://pawelmichalik.net/presentations/unit-testing-with-phpunit?showNotes=true
Prezentacja dostępna także w języku polskim: http://pawelmichalik.net/prezentacje/testy-jednostkowe-w-phpunit?showNotes=true
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockitoshaunthomas999
This document provides an overview of JUnit 5, including its components and features. It introduces JUnit 5 as an improvement over JUnit 4, released in 2017 to work with Java 8+. JUnit 5 consists of the Platform, Jupiter, and Vintage. The Platform provides test discovery and execution. Jupiter supports writing new tests with annotations and extensions. Vintage allows running old JUnit 3 & 4 tests on the platform. New features discussed include assertions, assumptions, display names, tags, repetition, and parameterization. It also covers using JUnit 5 with Spring tests and Mockito.
Unit testing, everyone talks about it and wants to do it but never gets around to actually start testing. Complex spaghetti code and time / budget pressures are often the reasons why nobody dives in and gets started with testing. But when the application breaks, and people loose money or worse it's often too late.
In this talk I will take you on a journey with real examples that will show you how you can set up your tests, how to test complex situations with legacy spaghetti code, test web services, database interactions and how to gradually build a solid foundation to safeguard the core code base and everything around it.
Don't you want to be confident when you walk out the office?
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests of Java code. Key aspects of JUnit include:
1. Tests are written by creating test classes that extend JUnit's TestCase class and contain test methods with names beginning with "test".
2. Tests use JUnit's assert methods like assertEquals to make assertions and determine whether the test passed or failed.
3. Annotations like @Before and @After allow setting up fixtures that run before and after each test.
4. The TestRunner class collects and runs all test cases and reports results.
5. Tests can be organized into test suites to group related tests and control execution
The document discusses unit testing and the PHPUnit testing framework. It provides an overview of what unit testing is, why it is useful, and how to get started with PHPUnit. Key points include that unit testing finds bugs early, encourages good coding practices, and makes codebases easier to change and deploy. PHPUnit is introduced as the most popular PHP testing framework. Instructions are given for installing PHPUnit via PEAR and writing basic tests, including test fixtures, assertions, and annotations. More advanced topics like mock objects, data providers, and exception testing are also covered.
JUnit is an open source unit testing framework for Java applications. It was written by Erich Gamma and Kent Beck and is part of the xUnit family of unit testing frameworks. JUnit allows developers to write test cases that test individual classes and methods. These test cases can be grouped into test suites and run automatically to ensure code meets requirements and to catch errors early in the development process. JUnit includes annotations like @Test to identify test methods and asserts to validate method output. It integrates with development tools like Eclipse to provide test results.
With Extbase - a new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process to develop clean code cost efficient in less time. Extbase is one cornerstone for a smooth transition to TYPO3 v5, another is reusable business domain knowledge in form of Generic Domain Models available in 4.x and 5.x. The Generic Domain Models will enable you to add a Semantic Web topping.
This document describes how to create custom annotations in Java to simulate a simple unit test framework. It defines two annotations - @Test and @TesterInfo. @Test is used to mark test methods and optionally disable them. @TesterInfo stores metadata about test classes. The document also shows how to use reflection to read the annotations and execute the tests, outputting the results.
Test Driven Development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases that are failed, then code is written to pass the tests, and finally the new code is refactored if needed. This process allows software to be developed incrementally while facilitating change by providing continuous feedback. The document provides details on TDD patterns and processes like red-green-refactor cycles and using test doubles.
JUnit is the de facto standard in Java testing. Yet many advanced JUnit features are little known and poorly understood. This session reviews some lesser-known features of JUnit, along with a few associated libraries, that can make your unit tests more powerful, expressive, and fun. The session is intended for Java developers, lead developers, and architects trying to introduce good testing practices into their teams.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests to determine whether code is functioning as intended. Key aspects of JUnit include writing tests before code via test-driven development, annotations for metadata and configuration of tests, and the ability to isolate tests from external dependencies using stubs and mocks. JUnit helps improve code quality and avoid regressions by identifying problems early in the development cycle.
The document discusses JUnit 5, the next generation of the JUnit testing framework for Java. Key aspects include a new programming model using extensions, support for Java 8 features, and ways to migrate from earlier JUnit versions. The new framework consists of the JUnit Platform launcher, the JUnit Jupiter API for writing tests, and the JUnit Vintage engine for running JUnit 3 and 4 tests.
Unit testing with JUnit can be done using JUnit 3.x or 4.x frameworks. Key aspects include writing test cases as Java classes that extend TestCase and contain test methods starting with "test", using assertion methods like assertTrue and assertEquals to validate outcomes, and running tests from Eclipse. JUnit 4.x introduced annotations like @Before, @Test, and @After to respectively set up objects before each test, identify test methods, and tear down objects after tests.
This document provides an overview of unit testing in PHP using PHPUnit. It discusses some goals of test automation like improving quality and reducing risks. It also covers the testing continuum from unit to integration to functional tests. The document introduces PHPUnit and how it is based on the xUnit family of tools. It then walks through an example of writing the first PHPUnit test to test a ROT13 encoding function in a test-driven way, demonstrating best practices like following the RED-GREEN-REFACTOR process and using assertions. Finally, it discusses principles of good test automation like independence of tests and isolating the system under test.
This document provides an introduction to Test Driven Development (TDD) in Italian. It defines key TDD concepts like "test first" and automating tests. It then provides examples of using TDD to develop a parser for the "df" command output and features for an astrology horoscope application. The examples demonstrate the TDD process of writing a failing test, then code to pass the test, and refactoring. Rules for TDD like keeping tests passing and writing tests for all features are also outlined.
This document introduces unit testing with PHPUnit. It discusses what unit testing is, why it's important, and tools like SimpleTest and PHPUnit. It provides examples of basic unit tests for a HelloWorld class using PHPUnit. It also covers more advanced testing techniques like data providers, expected exceptions, fixtures, doubles, mocks, stubs, and database testing using examples like testing a BankAccount class. The document provides hints and tips for unit testing MVC frameworks like Zend Framework.
Unit testing involves writing code to test individual units or components of a software to ensure they operate as intended. JUnit is a popular tool for performing unit tests in Java. It allows writing test cases as Java classes and methods, and running them to validate the code under test. Eclipse IDE facilitates creating and running JUnit test cases directly from the Java code being tested.
The document shows the step-by-step development of a PrimeFactors class using test-driven development. Unit tests are added one by one to drive the implementation of a generate method to return the prime factors of a given integer. The tests initially fail and then the production code is written to pass each new test in turn.
Unit testing with PHPUnit - there's life outside of TDDPaweł Michalik
Basics of PHPUnit and why is it even more relevant in legacy code. Key points of the framework are explained, along with mocking objects, test organisation, creating documentations with tests and accessing non-public objects (where applicable).
Live version with additional notes available at: http://pawelmichalik.net/presentations/unit-testing-with-phpunit?showNotes=true
Prezentacja dostępna także w języku polskim: http://pawelmichalik.net/prezentacje/testy-jednostkowe-w-phpunit?showNotes=true
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockitoshaunthomas999
This document provides an overview of JUnit 5, including its components and features. It introduces JUnit 5 as an improvement over JUnit 4, released in 2017 to work with Java 8+. JUnit 5 consists of the Platform, Jupiter, and Vintage. The Platform provides test discovery and execution. Jupiter supports writing new tests with annotations and extensions. Vintage allows running old JUnit 3 & 4 tests on the platform. New features discussed include assertions, assumptions, display names, tags, repetition, and parameterization. It also covers using JUnit 5 with Spring tests and Mockito.
Unit testing, everyone talks about it and wants to do it but never gets around to actually start testing. Complex spaghetti code and time / budget pressures are often the reasons why nobody dives in and gets started with testing. But when the application breaks, and people loose money or worse it's often too late.
In this talk I will take you on a journey with real examples that will show you how you can set up your tests, how to test complex situations with legacy spaghetti code, test web services, database interactions and how to gradually build a solid foundation to safeguard the core code base and everything around it.
Don't you want to be confident when you walk out the office?
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests of Java code. Key aspects of JUnit include:
1. Tests are written by creating test classes that extend JUnit's TestCase class and contain test methods with names beginning with "test".
2. Tests use JUnit's assert methods like assertEquals to make assertions and determine whether the test passed or failed.
3. Annotations like @Before and @After allow setting up fixtures that run before and after each test.
4. The TestRunner class collects and runs all test cases and reports results.
5. Tests can be organized into test suites to group related tests and control execution
The document discusses unit testing and the PHPUnit testing framework. It provides an overview of what unit testing is, why it is useful, and how to get started with PHPUnit. Key points include that unit testing finds bugs early, encourages good coding practices, and makes codebases easier to change and deploy. PHPUnit is introduced as the most popular PHP testing framework. Instructions are given for installing PHPUnit via PEAR and writing basic tests, including test fixtures, assertions, and annotations. More advanced topics like mock objects, data providers, and exception testing are also covered.
JUnit is an open source unit testing framework for Java applications. It was written by Erich Gamma and Kent Beck and is part of the xUnit family of unit testing frameworks. JUnit allows developers to write test cases that test individual classes and methods. These test cases can be grouped into test suites and run automatically to ensure code meets requirements and to catch errors early in the development process. JUnit includes annotations like @Test to identify test methods and asserts to validate method output. It integrates with development tools like Eclipse to provide test results.
With Extbase - a new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process to develop clean code cost efficient in less time. Extbase is one cornerstone for a smooth transition to TYPO3 v5, another is reusable business domain knowledge in form of Generic Domain Models available in 4.x and 5.x. The Generic Domain Models will enable you to add a Semantic Web topping.
This document discusses test-driven development (TDD) and unit testing. It begins with an introduction to TDD and examples using PHPUnit. It then explores the TDD cycle, common excuses for not using TDD, and pros and cons of TDD. Next, it distinguishes unit testing from TDD and discusses unit testing frameworks like PHPUnit and SimpleTest. Finally, it provides examples of code for a simple game that could be used to learn TDD and unit testing techniques.
The document discusses implementing semantic extensions in TYPO3 using concepts from the semantic web. It introduces key concepts like RDF triples, unique identifiers for resources, and serialization formats. It then provides examples of expressing information about a person named Jochen Rau as RDF triples and serializing them in Turtle format. The goal is to develop extensions with semantic web standards in mind.
Introduction to Test-Driven Development and why using Dependency Injection as provided by FLOW3 makes it an even better development approach. Presented at the 4th International TYPO3 Conference 2008 in Berlin.
The document discusses Python's unittest framework for unit testing. It covers key concepts like test fixtures, test cases, test suites, and test runners. It also provides examples of setting up test fixtures by subclassing TestCase and initializing instance variables in the setUp method. The document recommends organizing tests into groups and using lifecycle methods like setUp, tearDown, setUpClass, and tearDownClass.
The document discusses several automated testing tools:
- PHPUnit is a unit testing framework for PHP that allows writing and running automated tests. It helps ensure code quality and finds regressions.
- Selenium is a suite of tools for automating web application testing across browsers and platforms. It includes the Selenium IDE, RC, and Grid.
- Phing is a build system based on Apache Ant for PHP projects. It uses XML build files and PHP tasks to provide an extensible and flexible build framework.
This document discusses unit and integration testing. It begins by explaining the benefits of testing, such as reducing bugs and allowing safe refactoring. It then describes different types of tests like unit, integration, and database tests. The document focuses on unit testing, explaining how to write and organize unit tests using PHPUnit. It provides examples of test assertions and annotations. It also covers mocking and stubbing dependencies. Finally, it discusses challenges like testing code that relies on external components and provides strategies for database testing.
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
The document provides an overview of test-driven development (TDD) principles and how to implement testing for front-end development. It discusses the benefits of TDD, such as avoiding bad designs and preventing regressions. It also addresses common challenges with TDD, like slowing initial velocity and ignored tests over time. The document then covers different levels of testing, including unit tests, integration tests, and functional/end-to-end tests using the testing pyramid as a framework. It provides examples of writing tests for pure and impure functions using the Jest testing framework. Finally, it discusses functional testing using Cucumber.js behavior-driven development.
Fighting Fear-Driven-Development With PHPUnitJames Fuller
This talk was designed for PHP developers with limited or no experience in unit testing. I focus on describing the problem of fear-driven-development, and how test-driven-development can be used to improve the quality of your code.
The document discusses test-driven development (TDD). It states that TDD relies on short development cycles where the developer first writes an automated test case that defines a new function or improvement. Then the developer produces code to pass that test, and refactors the new code to acceptable standards.
The document discusses test-driven development (TDD) and refactoring. It provides examples of unit test fixtures, exercising the system under test (SUT), and verifying results. It also discusses refactoring code to remove smells like duplicated code through techniques like extracting methods. The goal is to use TDD to write code that works and is clean through small, incremental changes while ensuring it continues to work by passing all tests.
Thermostat example demonstrates dependency injection principles. Initially, the naive Thermostat class directly creates its dependencies like the TemperatureSensor class. This leads to tight coupling. To decouple the classes, an interface TemperatureSensor is extracted. The dependency is then injected via the constructor rather than created internally. This allows injecting different sensor implementations and makes the Thermostat class more reusable and testable.
This document discusses PHPUnit, a unit testing framework for PHP. It covers PHPUnit installation, writing test cases, assertions, fixtures, organizing tests, and best practices for test naming, structure and design including the F.I.R.S.T. principles. Key topics include using PHPUnit to test classes, methods and exceptions, leveraging data providers, fixtures for shared test setup/teardown, and keeping tests clean with single concepts per test.
New and improved: Coming changes to the unittest modulePyCon Italia
The document discusses upcoming changes to the unittest testing framework in Python 2.7 and 3.2, including new assertion methods, type-specific equality functions, improved set and string comparison, and changes to command line behavior. Key changes are new assert methods, a delta parameter for assertAlmostEqual, deprecated aliases being removed, type-specific comparison functions, improved set and string handling, using assertRaises as a context manager, more command line options, and test discovery.
This document discusses various techniques for unit testing in Java with JUnit, including naming tests clearly, using Hamcrest matchers for assertions, writing parameterized tests, using JUnit rules, and measuring code coverage. It provides examples of how to write tests that follow best practices and leverage JUnit's capabilities for parameterized testing, timeouts, error collection, and more. It also discusses running tests in parallel and measuring code coverage in IDEs like IntelliJ and Eclipse.
This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, Rossen Stoyanchev will show attendees how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action and learn how you can get involved in the Spring MVC Test Support project.
Testing code through automated tests is important to ensure security and catch bugs early in the development process. There are different types of tests like unit tests which test individual functions and modules, and functional tests which test overall page behavior and interactions. Writing tests requires considering what to test, test organization, and dealing with limitations of testing tools.
TDD involves writing automated test cases before implementation code to define requirements. Tests are written using an "Arrange, Act, Assert" structure and frameworks like NUnit or MS Test can run the tests. The goal is to write tests that isolate units of code so they are independent and predictable. Dependency injection and fakes/mocks allow injecting simulated dependencies to keep tests clean. TDD promotes writing clean, isolated code that is thoroughly tested.
The document introduces unit testing with JUnit by walking through an example of writing tests for a Conway's Game of Life Cell class. It shows how to:
1) Write an initial test that fails to compile due to missing code.
2) Add just enough code (a no-arg Cell constructor and isAlive() method) to get the test to compile.
3) Run the test and ensure it fails as expected before the code is implemented.
4) Continue writing tests and extending the Cell class to pass all tests and achieve the desired behavior.
This document provides an overview of automated unit testing in PHP. It discusses what unit testing is, why it is important, what should be tested, when to test, and how to set up and run tests using PHPUnit. Key points include:
- Unit testing validates individual units of source code. Each test should test a single function or class.
- Tests should be run early and often to catch bugs early in development.
- PHPUnit is a popular PHP testing framework that allows creating and running automated tests. It provides assertions, fixtures, and other features to test code.
- Tests can be organized into test suites and run via the command line or configured via an XML file. Groups allow filtering tests to
Test-driven development (TDD) involves writing unit tests before writing application code. TDD promotes writing high-quality code and prevents regressions. It follows a "red-green-refactor" process of writing a failing test, making it pass by writing minimal code, and refactoring the code. Unit test frameworks allow automating tests and isolating code dependencies using techniques like stubs, fakes, and mocks. Tests should be organized into test classes and follow a lifecycle of setup, execution, and teardown.
This document discusses unit testing in Laravel. It defines a unit test as checking a single assumption about system behavior. Key reasons for writing unit tests include making development faster and preventing bugs. The document outlines excuses for not testing and best practices like when to implement testing. It describes the typical arrange-act-assert structure of tests and introduces PHPUnit and Laravel testing helpers. Examples show how to test classes, pages, databases, sessions and models using assertions and Laravel helpers.
This document provides an overview of test driven development with PHPUnit. It discusses what unit testing is, the benefits of testing, and how to get started with PHPUnit. Key topics covered include writing tests, assertions, dependencies, data providers, testing errors and exceptions, fixtures, and database testing. The document also mentions test output, incomplete/skipped tests, test doubles, code coverage analysis, and the skeleton generator.
Test-driven development with TYPO3 (T3CON10)Oliver Klee
This document discusses test-driven development for TYPO3. It emphasizes the importance of writing unit tests to verify code works as expected, ensure changes don't break existing functionality, and provide a safety net for refactoring. The TYPO3 phpunit extension allows running over 1600 tests for the Realty Manager extension in under 60 seconds. Key terms like test, assertion, testcase, testsuite are defined. The test-first approach of writing tests before code is also covered.
Everything you need to know about the TYPO3 Security Team (T3DD10)Oliver Klee
The TYPO3 Security Team handles security vulnerability reports, creates patches to fix issues, and educates users. It coordinates with extension authors to address vulnerabilities and release fixes. The team reviews reports, determines if issues are valid, and works with authors to resolve problems and communicate resolutions.
This document discusses unit testing for the TYPO3 4.x core. It notes that unit testing is faster than manual testing and can catch regressions. Over 2400 tests were written for the Seminar Manager extension that take less than 90 seconds to run. The document encourages writing unit tests to learn how parts of the core work, before fixing bugs or refactoring code. A diploma thesis is underway to write unit tests for TCEmain and other parts of the core over 6 months, which will provide more knowledge about bugs and flaws. The document concludes by asking if anyone has any questions.
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/how-axelera-ai-uses-digital-compute-in-memory-to-deliver-fast-and-energy-efficient-computer-vision-a-presentation-from-axelera-ai/
Bram Verhoef, Head of Machine Learning at Axelera AI, presents the “How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-efficient Computer Vision” tutorial at the May 2024 Embedded Vision Summit.
As artificial intelligence inference transitions from cloud environments to edge locations, computer vision applications achieve heightened responsiveness, reliability and privacy. This migration, however, introduces the challenge of operating within the stringent confines of resource constraints typical at the edge, including small form factors, low energy budgets and diminished memory and computational capacities. Axelera AI addresses these challenges through an innovative approach of performing digital computations within memory itself. This technique facilitates the realization of high-performance, energy-efficient and cost-effective computer vision capabilities at the thin and thick edge, extending the frontier of what is achievable with current technologies.
In this presentation, Verhoef unveils his company’s pioneering chip technology and demonstrates its capacity to deliver exceptional frames-per-second performance across a range of standard computer vision networks typical of applications in security, surveillance and the industrial sector. This shows that advanced computer vision can be accessible and efficient, even at the very edge of our technological ecosystem.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
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.
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
Conversational agents, or chatbots, are increasingly used to access all sorts of services using natural language. While open-domain chatbots - like ChatGPT - can converse on any topic, task-oriented chatbots - the focus of this paper - are designed for specific tasks, like booking a flight, obtaining customer support, or setting an appointment. Like any other software, task-oriented chatbots need to be properly tested, usually by defining and executing test scenarios (i.e., sequences of user-chatbot interactions). However, there is currently a lack of methods to quantify the completeness and strength of such test scenarios, which can lead to low-quality tests, and hence to buggy chatbots.
To fill this gap, we propose adapting mutation testing (MuT) for task-oriented chatbots. To this end, we introduce a set of mutation operators that emulate faults in chatbot designs, an architecture that enables MuT on chatbots built using heterogeneous technologies, and a practical realisation as an Eclipse plugin. Moreover, we evaluate the applicability, effectiveness and efficiency of our approach on open-source chatbots, with promising results.
AppSec PNW: Android and iOS Application Security with MobSFAjin Abraham
Mobile Security Framework - MobSF is a free and open source automated mobile application security testing environment designed to help security engineers, researchers, developers, and penetration testers to identify security vulnerabilities, malicious behaviours and privacy concerns in mobile applications using static and dynamic analysis. It supports all the popular mobile application binaries and source code formats built for Android and iOS devices. In addition to automated security assessment, it also offers an interactive testing environment to build and execute scenario based test/fuzz cases against the application.
This talk covers:
Using MobSF for static analysis of mobile applications.
Interactive dynamic security assessment of Android and iOS applications.
Solving Mobile app CTF challenges.
Reverse engineering and runtime analysis of Mobile malware.
How to shift left and integrate MobSF/mobsfscan SAST and DAST in your build pipeline.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
19. The phpunit extension
has it all
phpunit (TYPO3 extension)
PHPUnit (PEAR package)
Testrunner
(back-end-
module)
20. The phpunit extension
has it all
phpunit (TYPO3 extension)
PHPUnit (PEAR package)
Testrunner Testrunner
(back-end-
module) (CLI module)
21. The phpunit extension
has it all
phpunit (TYPO3 extension)
PHPUnit (PEAR package)
Testing framework for FE & DB
Testrunner Testrunner
(back-end-
module) (CLI module)
50. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
51. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
Mention the
method. setTitleSetsTitle
52. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
Mention the
method. setTitleSetsTitle
Name the setSizeWithZeroThrowsException
preconditions. hasTitleForEmptyTitleReturnsFalse
53. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
Mention the
method. setTitleSetsTitle
Name the setSizeWithZeroThrowsException
preconditions. hasTitleForEmptyTitleReturnsFalse
Dont‘t use
"works" or
"correctly".
54. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
Mention the
method. setTitleSetsTitle
Name the setSizeWithZeroThrowsException
preconditions. hasTitleForEmptyTitleReturnsFalse
Dont‘t use
"works" or measureFrubbleWorksCorrectly
"correctly".
55. Use meaningful
unit test names
Name the
behavior. classCanBeInstantiated
Mention the
method. setTitleSetsTitle
Name the setSizeWithZeroThrowsException
preconditions. hasTitleForEmptyTitleReturnsFalse
Dont‘t use
"works" or measureFrubbleWorksCorrectly
"correctly".
61. The continuous integration server
monitors the code
Checkin
hook
Repository (SVN)
SVN
continuous integration
server
62. The continuous integration server
monitors the code
Checkin
hook
Repository (SVN)
SVN
Hey, a
change!
continuous integration
server
63. The continuous integration server
monitors the code
Checkin
hook
Repository (SVN)
SVN
Hey, a
change!
continuous integration run the unit
server tests etc.
64. The continuous integration server
monitors the code
Checkin
hook
Repository (SVN)
SVN
Hey, a
change!
continuous integration run the unit Report
server tests etc.
72. The testing framework
is created quickly
/**
* @var Tx_Phpunit_Framework
*/
protected $testingFramework = NULL;
public function setUp() {
$this->testingFramework = new Tx_Phpunit_Framework('tx_news2');
}
public function tearDown() {
$this->testingFramework->cleanUp();
unset($this->testingFramework);
}
73. The testing framework
is created quickly
/**
* @var Tx_Phpunit_Framework
*/
protected $testingFramework = NULL;
public function setUp() {
$this->testingFramework = new Tx_Phpunit_Framework('tx_news2');
}
discard the FE,
public function tearDown() {
delete DB records,
$this->testingFramework->cleanUp();
unset($this->testingFramework);
delete files
}
74. The testing framework
is created quickly
/**
* @var Tx_Phpunit_Framework
*/
protected $testingFramework = NULL;
public function setUp() {
$this->testingFramework = new Tx_Phpunit_Framework('tx_news2');
}
discard the FE,
public function tearDown() {
delete DB records,
$this->testingFramework->cleanUp();
unset($this->testingFramework);
delete files
}
CREATE TABLE tx_news2_domain_model_news (
…
is_dummy_record tinyint(1) unsigned DEFAULT '0' NOT NULL,
…
75. The testing framework
can fake almost everything
76. The testing framework
can fake almost everything
$recordUid = $tf->createRecord($tableName, array $recordData = array());
77. The testing framework
can fake almost everything
$recordUid = $tf->createRecord($tableName, array $recordData = array());
$tf->changeRecord($tableName, $uid, array $recordData);
78. The testing framework
can fake almost everything
$recordUid = $tf->createRecord($tableName, array $recordData = array());
$tf->changeRecord($tableName, $uid, array $recordData);
$tf->deleteRecord($tableName, $uid);
79. The testing framework
can fake almost everything
$recordUid = $tf->createRecord($tableName, array $recordData = array());
$tf->changeRecord($tableName, $uid, array $recordData);
$tf->deleteRecord($tableName, $uid);
$tf->createRelation($tableName, $uidLocal, $uidForeign, $sorting = 0);
99. The testing framework
can fake almost everything
100. The testing framework
can fake almost everything
$recordUid = $tf->createBackEndUser(array $recordData = array());
101. The testing framework
can fake almost everything
$recordUid = $tf->createBackEndUser(array $recordData = array());
$recordUid = $tf->createBackEndUserGroup(array $recordData = array());
102. The testing framework
can fake almost everything
103. The testing framework
can fake almost everything
$path = $tf->createDummyFile($fileName = 'test.txt', $content = '');
104. The testing framework
can fake almost everything
$path = $tf->createDummyFile($fileName = 'test.txt', $content = '');
$path = $tf->createDummyZipArchive($fileName = 'test.zip', array $filesToAdd = array());
105. The testing framework
can fake almost everything
$path = $tf->createDummyFile($fileName = 'test.txt', $content = '');
$path = $tf->createDummyZipArchive($fileName = 'test.zip', array $filesToAdd = array());
$tf->deleteDummyFile($fileName);
106. The testing framework
can fake almost everything
$path = $tf->createDummyFile($fileName = 'test.txt', $content = '');
$path = $tf->createDummyZipArchive($fileName = 'test.zip', array $filesToAdd = array());
$tf->deleteDummyFile($fileName);
$path = $tf->createDummyFolder($folderName);
107. The testing framework
can fake almost everything
$path = $tf->createDummyFile($fileName = 'test.txt', $content = '');
$path = $tf->createDummyZipArchive($fileName = 'test.zip', array $filesToAdd = array());
$tf->deleteDummyFile($fileName);
$path = $tf->createDummyFolder($folderName);
$tf->deleteDummyFolder($folderName);
108. How to your test
extbase controllers
class Tx_Coffee_Controller_CoffeeControllerTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
/** @var Tx_Coffee_Controller_CoffeeController */
protected $fixture;
/** @var Tx_Fluid_View_TemplateView */
protected $view = NULL;
/** @var Tx_Coffee_Domain_Repository_CoffeeRepository */
protected $coffeeRepository = NULL;
public function setUp() {
$this->fixture = new Tx_Coffee_Controller_CoffeeController();
$this->view = $this->getMock('Tx_Fluid_View_TemplateView', array(), array(), '', FALSE);
$this->fixture->setView($this->view);
$this->objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
$this->fixture->injectObjectManager($this->objectManager);
$this->coffeeRepository = $this->getMock(
'Tx_Coffee_Domain_Repository_CoffeeRepository',
array('findAll', 'findByBrand'), array($this->objectManager)
);
$this->fixture->injectCoffeeRepository($this->coffeeRepository);
}
109. How to your test
extbase controllers
class Tx_Coffee_Controller_CoffeeControllerTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
/** @var Tx_Coffee_Controller_CoffeeController */
protected $fixture;
/** @var Tx_Fluid_View_TemplateView */
protected $view = NULL;
/** @var Tx_Coffee_Domain_Repository_CoffeeRepository */
protected $coffeeRepository = NULL;
public function setUp() {
$this->fixture = new Tx_Coffee_Controller_CoffeeController();
$this->view = $this->getMock('Tx_Fluid_View_TemplateView', array(), array(), '', FALSE);
$this->fixture->setView($this->view);
$this->objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
$this->fixture->injectObjectManager($this->objectManager);
$this->coffeeRepository = $this->getMock(
'Tx_Coffee_Domain_Repository_CoffeeRepository',
array('findAll', 'findByBrand'), array($this->objectManager)
);
$this->fixture->injectCoffeeRepository($this->coffeeRepository);
}
class Tx_Coffee_Controller_CoffeeController extends Tx_Extbase_MVC_Controller_ActionController {
/**
* Sets the view.
*
* This function is intended to be used for unit testing purposes only.
*
* @param Tx_Fluid_View_TemplateView $view the new view
*
* @return void
*/
public function setView(Tx_Fluid_View_TemplateView $view) {
$this->view = $view;
}
111. How to your test
extbase controllers
/**
* @test
*/
public function indexActionAssignsAllCoffeesToView() {
$models = $this->getMock('Tx_Extbase_Persistence_QueryResultInterface');
$this->coffeeRepository->expects($this->once())->method('findAll')
->will($this->returnValue($models));
$this->view->expects($this->at(0))->method('assign')->with('coffees', $models);
$this->fixture->indexAction();
}
112. How to your test
extbase controllers
/**
* @test
*/
public function indexActionAssignsAllCoffeesToView() {
$models = $this->getMock('Tx_Extbase_Persistence_QueryResultInterface');
$this->coffeeRepository->expects($this->once())->method('findAll')
->will($this->returnValue($models));
$this->view->expects($this->at(0))->method('assign')->with('coffees', $models);
$this->fixture->indexAction();
}
/**
* @test
*/
public function showActionAssignsModelToView() {
$model = clone new Tx_Coffee_Domain_Model_Coffee();
$this->view->expects($this->at(0))->method('assign')->with('coffee', $model);
$this->fixture->showAction($model);
}