The document discusses different techniques for unit testing such as using mock objects, fixtures, stubs, and dependency injection to isolate parts of a program and test them independently; it also covers concepts like test-driven development and regression testing to prevent bugs from being reintroduced with code changes. The overall message is that writing unit tests leads to better architecture and helps improve code quality.
Phactory is an alternative to database fixtures for defining test data in PHP unit tests. It allows developers to define database objects in code and dynamically create them, rather than loading static datasets. Phactory provides a lightweight ORM and works with MySQL, SQLite, and MongoDB. It supports defining object blueprints, creating objects with associations, retrieving objects, and integrating with PHPUnit for testing database code.
A way to identify trusted developer strings (aka "literals", which have been defined within the PHP script) which need to be used for HTML templates, SQL strings, CLI strings; and keep those completely separate from user controlled (attacker tainted) strings.
This document provides an introduction and overview of creating and working with entity beans in EJB. It discusses what entity beans are, how they represent data in a persistence store like a database. It then covers how to create the key interfaces, bean class, and deployment descriptor for a sample entity bean that represents a Customer entity with ID, first name, and city attributes. It shows implementing required entity bean methods like ejbCreate, ejbLoad, ejbStore, and ejbFindByPrimaryKey to load, store, and find data in the backing database. Finally, it discusses deploying the entity bean and providing a simple JSP client to call its methods.
The document discusses the evolution of the YUI JavaScript framework architecture. Some key changes include a modular design that allows discrete modules to be loaded independently, a common component foundation using attributes and events, and a Node API that provides a normalized way to interact with DOM elements.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
This document provides an overview of clean code principles and best practices. Some of the key topics covered include:
- Using meaningful variable, function, and class names.
- Avoiding flag arguments and side effects in functions.
- Preferring exceptions over returning error codes.
- Properly formatting code and comments for readability.
- Following object-oriented principles like high cohesion and single responsibility.
- Adhering to SOLID design patterns and GRASP patterns.
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
Phactory is an alternative to database fixtures for defining test data in PHP unit tests. It allows developers to define database objects in code and dynamically create them, rather than loading static datasets. Phactory provides a lightweight ORM and works with MySQL, SQLite, and MongoDB. It supports defining object blueprints, creating objects with associations, retrieving objects, and integrating with PHPUnit for testing database code.
A way to identify trusted developer strings (aka "literals", which have been defined within the PHP script) which need to be used for HTML templates, SQL strings, CLI strings; and keep those completely separate from user controlled (attacker tainted) strings.
This document provides an introduction and overview of creating and working with entity beans in EJB. It discusses what entity beans are, how they represent data in a persistence store like a database. It then covers how to create the key interfaces, bean class, and deployment descriptor for a sample entity bean that represents a Customer entity with ID, first name, and city attributes. It shows implementing required entity bean methods like ejbCreate, ejbLoad, ejbStore, and ejbFindByPrimaryKey to load, store, and find data in the backing database. Finally, it discusses deploying the entity bean and providing a simple JSP client to call its methods.
The document discusses the evolution of the YUI JavaScript framework architecture. Some key changes include a modular design that allows discrete modules to be loaded independently, a common component foundation using attributes and events, and a Node API that provides a normalized way to interact with DOM elements.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
This document provides an overview of clean code principles and best practices. Some of the key topics covered include:
- Using meaningful variable, function, and class names.
- Avoiding flag arguments and side effects in functions.
- Preferring exceptions over returning error codes.
- Properly formatting code and comments for readability.
- Following object-oriented principles like high cohesion and single responsibility.
- Adhering to SOLID design patterns and GRASP patterns.
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
The document provides an overview of Mockito, a mocking framework for Java. It discusses the basics of stubbing and verifying mock method calls. It also covers additional Mockito features like argument matchers, verifying interaction counts, annotations, stubbing void methods, spying on real objects, integration with Spring, and the Mockito JUnit runner. Code examples are provided to demonstrate stubbing, verifying, argument matchers, stubbing void methods, spying, and integration with Spring.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
The document discusses how arrays can help solve challenges in PHP development. It provides examples of using array functions like array_diff(), array_intersect(), and array_filter() to simplify common coding tasks compared to using foreach loops. Iterators are presented as another solution, providing better performance for large datasets than storing everything in arrays. The document advocates using arrays, interfaces, modules, and separation of responsibilities as best practices promoted by the Zend Framework.
Slides from my Confitura 2012 presentation. The issues discussed during the talk will be described in my new (free!) ebook - see https://github.com/tomekkaczanowski/bad-tests-good-tests
eROSE is a tool that guides programmers in Eclipse by recommending related changes based on mining associations from a software project's history. It predicts 33% of changed entities and 70% of transactions contain a changed entity within the top three recommendations. Precision averages 0.29 while recall averages 0.33 for entities and 0.44 for files. eROSE's recommendations improve over time with more data and feedback from users. It will be extended in upcoming releases to integrate annotations for risk awareness and management.
The document discusses Drupal's #states functionality for dynamically showing and hiding form elements based on user interactions. It describes the anatomy of state definitions, how dependencies between elements are defined, targeting elements using CSS selectors, built-in state names like visible and checked, and how to define custom triggers for state changes beyond default DOM events.
This document contains 20 questions about Django, ranging from easy to moderate difficulty. The questions cover topics like models, views, urls, forms, authentication, caching, and custom commands. Correct answers are provided for each multiple choice question.
EasyMock is a dynamic mock object generator that allows users to avoid writing mock objects by hand. It creates mock objects that mimic the behavior of real objects in controlled ways for testing purposes. There are different types of test doubles like stubs, spies, mocks, and fakes that serve different purposes like isolating code under test, making tests faster and deterministic, and simulating special conditions. EasyMock can be used to create mock objects, specify expected behavior using matchers, capture arguments, and verify expectations. It provides a way to test code without relying on other real dependencies.
This document provides an overview of using EasyMock, an open source Java testing framework, to create mock objects for unit testing. It discusses how mocking objects can improve testability by removing dependencies. EasyMock allows specifying expected method calls and return values to simulate object behavior. Tests can then verify mocks were used as expected. The document demonstrates creating mocks, setting expectations, replaying mocks, and verifying expectations with EasyMock.
The document provides an overview of unit testing and dependency injection using Entity Framework. It discusses how to achieve true unit testing through dependency injection and mocking dependencies. It provides examples of how to set up interfaces, manager classes, context classes and writing unit tests using Rhino Mocks and MSTest. Code coverage is also discussed as an important part of unit testing.
Demonstrate some great aspects of Mockito. Made for Mockito v1.8.5.
All examples can be found @
https://github.com/dodozhang21/MockitoExamples
Ying Zhang (Dodo) http://pure-essence.net
This document provides an introduction to JUnit, a unit testing framework for Java. It discusses why unit testing is important, how to write and organize JUnit tests, how to use assertions and mocks, and how to integrate JUnit with IDEs and build tools like Maven and Ant. Key aspects covered include the benefits of unit testing, the core components and design of JUnit, best practices for test-driven development and test maintenance, and resources for learning more about JUnit.
This document provides an overview and summary of a presentation on unit testing, test-driven development, and behavior-driven development. The presentation covers the basics of each approach, provides examples, and discusses the benefits including increased code quality, reduced defects, and more confidence in the code. It emphasizes that testing should be integrated into the development process from the start.
Effective testing with Pytest focuses on using Pytest to its full potential. Key aspects include using fixtures like monkeypatch and mocker to control dependencies, libraries like factoryboy and faker to generate test data, and freezegun to control time. Tests should be fast, readable, and maintainable by applying best practices for organization, parametrization, markers, and comparing results in an effective manner.
The document discusses UI testing techniques for handling complex user interfaces at scale. It provides an overview of different types of tests like unit tests, integration tests, and end-to-end tests. Unit tests allow testing small pieces of functionality in isolation while integration tests verify behavior of small units together. End-to-end tests focus on real user scenarios. The document also covers tools for testing like test runners, assertion libraries, spies, and DOM mocking. It emphasizes writing tests first before coding to catch bugs early (test-driven development). Overall, the document aims to help developers understand options for testing complex UIs at scale.
Secret unit testing tools no one ever told you aboutDror Helper
There are more to unit testing than using a unit testing framework – in order to succeed you want to use the right tools for the job. There are a few tools that almost no one talks about – some enabling creating of top-notch, robust unit tests. Some will help you run your tests better and faster.
In this session I’ll explain about the inevitable maintainability problems developers face when writing and maintaining huge unit testing suits and how unit level BDD, AutoMocking, and Continuous Execution can help take control over your tests.
The document provides an introduction to JUnit and Mockito frameworks for testing in Java. It covers key topics such as:
- What JUnit and Mockito are and how they are used for testing Java code
- Common JUnit annotations like @Test and how to structure test classes
- How to make assertions in JUnit tests to validate expected outcomes
- How to use Mockito to mock dependencies and define stubbed behavior
- Hands-on examples are provided to demonstrate writing tests with JUnit and Mockito
Unit testing and end-to-end (E2E) testing are important types of automated testing for JavaScript applications. Unit tests focus on testing individual functions or components in isolation to catch bugs, while E2E tests ensure that user flows work as expected by interacting with the application through a browser. The presentation discussed setting up testing frameworks like Karma and Jasmine for unit testing and Protractor for E2E testing. It also covered writing testable code, handling dependencies through dependency injection, and selecting elements and interacting with them during E2E tests.
Javascript testing is important for ensuring code quality and preventing regressions. Unit tests isolate and test small units of code through frameworks like QUnit. They should test both positive and negative cases, be run frequently, and treat code as a black box. Integration tests use Selenium to test full functionality and flows across multiple units. Automating testing through continuous integration helps catch errors early and validate changes. Test-driven development involves writing tests before code. Overall, tests require code that is independent, simply complex, and supports dependency injection.
Need(le) for Speed - Effective Unit Testing for Java EEhwilming
Needle is a lightweight framework for testing Java EE components outside of the container in isolation. It reduces the test setup code by analysing dependencies and automatic injection of mock objects. It will thus maximize the speed of development as well as the execution of unit tests.
The document provides an overview of Mockito, a mocking framework for Java. It discusses the basics of stubbing and verifying mock method calls. It also covers additional Mockito features like argument matchers, verifying interaction counts, annotations, stubbing void methods, spying on real objects, integration with Spring, and the Mockito JUnit runner. Code examples are provided to demonstrate stubbing, verifying, argument matchers, stubbing void methods, spying, and integration with Spring.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
The document discusses how arrays can help solve challenges in PHP development. It provides examples of using array functions like array_diff(), array_intersect(), and array_filter() to simplify common coding tasks compared to using foreach loops. Iterators are presented as another solution, providing better performance for large datasets than storing everything in arrays. The document advocates using arrays, interfaces, modules, and separation of responsibilities as best practices promoted by the Zend Framework.
Slides from my Confitura 2012 presentation. The issues discussed during the talk will be described in my new (free!) ebook - see https://github.com/tomekkaczanowski/bad-tests-good-tests
eROSE is a tool that guides programmers in Eclipse by recommending related changes based on mining associations from a software project's history. It predicts 33% of changed entities and 70% of transactions contain a changed entity within the top three recommendations. Precision averages 0.29 while recall averages 0.33 for entities and 0.44 for files. eROSE's recommendations improve over time with more data and feedback from users. It will be extended in upcoming releases to integrate annotations for risk awareness and management.
The document discusses Drupal's #states functionality for dynamically showing and hiding form elements based on user interactions. It describes the anatomy of state definitions, how dependencies between elements are defined, targeting elements using CSS selectors, built-in state names like visible and checked, and how to define custom triggers for state changes beyond default DOM events.
This document contains 20 questions about Django, ranging from easy to moderate difficulty. The questions cover topics like models, views, urls, forms, authentication, caching, and custom commands. Correct answers are provided for each multiple choice question.
EasyMock is a dynamic mock object generator that allows users to avoid writing mock objects by hand. It creates mock objects that mimic the behavior of real objects in controlled ways for testing purposes. There are different types of test doubles like stubs, spies, mocks, and fakes that serve different purposes like isolating code under test, making tests faster and deterministic, and simulating special conditions. EasyMock can be used to create mock objects, specify expected behavior using matchers, capture arguments, and verify expectations. It provides a way to test code without relying on other real dependencies.
This document provides an overview of using EasyMock, an open source Java testing framework, to create mock objects for unit testing. It discusses how mocking objects can improve testability by removing dependencies. EasyMock allows specifying expected method calls and return values to simulate object behavior. Tests can then verify mocks were used as expected. The document demonstrates creating mocks, setting expectations, replaying mocks, and verifying expectations with EasyMock.
The document provides an overview of unit testing and dependency injection using Entity Framework. It discusses how to achieve true unit testing through dependency injection and mocking dependencies. It provides examples of how to set up interfaces, manager classes, context classes and writing unit tests using Rhino Mocks and MSTest. Code coverage is also discussed as an important part of unit testing.
Demonstrate some great aspects of Mockito. Made for Mockito v1.8.5.
All examples can be found @
https://github.com/dodozhang21/MockitoExamples
Ying Zhang (Dodo) http://pure-essence.net
This document provides an introduction to JUnit, a unit testing framework for Java. It discusses why unit testing is important, how to write and organize JUnit tests, how to use assertions and mocks, and how to integrate JUnit with IDEs and build tools like Maven and Ant. Key aspects covered include the benefits of unit testing, the core components and design of JUnit, best practices for test-driven development and test maintenance, and resources for learning more about JUnit.
This document provides an overview and summary of a presentation on unit testing, test-driven development, and behavior-driven development. The presentation covers the basics of each approach, provides examples, and discusses the benefits including increased code quality, reduced defects, and more confidence in the code. It emphasizes that testing should be integrated into the development process from the start.
Effective testing with Pytest focuses on using Pytest to its full potential. Key aspects include using fixtures like monkeypatch and mocker to control dependencies, libraries like factoryboy and faker to generate test data, and freezegun to control time. Tests should be fast, readable, and maintainable by applying best practices for organization, parametrization, markers, and comparing results in an effective manner.
The document discusses UI testing techniques for handling complex user interfaces at scale. It provides an overview of different types of tests like unit tests, integration tests, and end-to-end tests. Unit tests allow testing small pieces of functionality in isolation while integration tests verify behavior of small units together. End-to-end tests focus on real user scenarios. The document also covers tools for testing like test runners, assertion libraries, spies, and DOM mocking. It emphasizes writing tests first before coding to catch bugs early (test-driven development). Overall, the document aims to help developers understand options for testing complex UIs at scale.
Secret unit testing tools no one ever told you aboutDror Helper
There are more to unit testing than using a unit testing framework – in order to succeed you want to use the right tools for the job. There are a few tools that almost no one talks about – some enabling creating of top-notch, robust unit tests. Some will help you run your tests better and faster.
In this session I’ll explain about the inevitable maintainability problems developers face when writing and maintaining huge unit testing suits and how unit level BDD, AutoMocking, and Continuous Execution can help take control over your tests.
The document provides an introduction to JUnit and Mockito frameworks for testing in Java. It covers key topics such as:
- What JUnit and Mockito are and how they are used for testing Java code
- Common JUnit annotations like @Test and how to structure test classes
- How to make assertions in JUnit tests to validate expected outcomes
- How to use Mockito to mock dependencies and define stubbed behavior
- Hands-on examples are provided to demonstrate writing tests with JUnit and Mockito
Unit testing and end-to-end (E2E) testing are important types of automated testing for JavaScript applications. Unit tests focus on testing individual functions or components in isolation to catch bugs, while E2E tests ensure that user flows work as expected by interacting with the application through a browser. The presentation discussed setting up testing frameworks like Karma and Jasmine for unit testing and Protractor for E2E testing. It also covered writing testable code, handling dependencies through dependency injection, and selecting elements and interacting with them during E2E tests.
Javascript testing is important for ensuring code quality and preventing regressions. Unit tests isolate and test small units of code through frameworks like QUnit. They should test both positive and negative cases, be run frequently, and treat code as a black box. Integration tests use Selenium to test full functionality and flows across multiple units. Automating testing through continuous integration helps catch errors early and validate changes. Test-driven development involves writing tests before code. Overall, tests require code that is independent, simply complex, and supports dependency injection.
Need(le) for Speed - Effective Unit Testing for Java EEhwilming
Needle is a lightweight framework for testing Java EE components outside of the container in isolation. It reduces the test setup code by analysing dependencies and automatic injection of mock objects. It will thus maximize the speed of development as well as the execution of unit tests.
This presentation introduces PHP unit testing in Yii. It covers test-driven development (TDD) principles, the different types of tests like unit tests and integration tests, how to set up PHPUnit and write tests in Yii, using fixtures to test database interactions, and invoking tests from the command line. Examples are provided of writing unit tests for models and using fixtures to load test data.
This document discusses principles for writing testable JavaScript code. It emphasizes:
1. Minimizing dependencies by writing loosely coupled code and injecting dependencies rather than tightly coupling them.
2. Testing early and often by writing code in a way that isolates dependencies so they can be easily mocked out for testing.
3. Managing both public and private dependencies, avoiding hidden dependencies, and treating browser dependencies similarly to other dependencies.
Rhino Mocks is a .NET mocking framework that allows developers to easily create and setup mock objects to test interactions using unit tests. It generates both mocks, which allow expectations to be set and verified, and stubs, which simply return preset values without verification. The document provides examples of using Rhino Mocks to generate mocks and stubs of interfaces, set expectations on mocks, and verify mock interactions using the AAA (Arrange, Act, Assert) syntax. It also distinguishes between mocks and stubs.
The document provides an introduction and overview of using Google Mock (gmock) for testing in C++. It discusses key concepts like the system under test (SUT), test doubles, mocks, stubs, and fragile tests. It then provides a tutorial example of defining a mock class for a Turtle interface to allow testing code that depends on drawing functions without executing the real drawing implementation.
Unit testing involves writing individual units of code to determine if they are functioning properly, where a unit is the smallest testable part like a method or class; it ensures code is properly designed and functions as intended when client uses the interface, but should not rely on external resources or other subsystems to avoid integration testing. Unit testing finds bugs early, allows for safe refactoring, and improves code quality and developer focus through documentation and feedback from running tests automatically.
This document discusses unit testing and why it is important for software developers. It provides an overview of unit testing, including what unit testing is, why we should do it, how the testing process works. It then gives a example of unit testing a sample photo gallery app, demonstrating how to test models, services, and view models. It also covers best practices for unit testing like mocking dependencies and using stubs to generate test data.
This document provides an overview and instructions for developing a real application called SportsStore using ASP.NET MVC. It discusses starting the domain model by adding a Product model class and creating an abstract IProductsRepository interface. It also covers setting up projects, installing packages, adding references between projects, and configuring the dependency injection container.
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mayflower GmbH
Nach dem erfolgreichen Launch einer Software gibt es immer das gleiche Dilemma: Neue Features konkurrieren mit Bugs und Anpassungen an der bestehenden Software, die aus dem operativen Betrieb kommen. Und die Gretchenfrage nach dem dringenden und dem wichtigsten stellt sich kontinuierlich und es braucht einen Mechanismus um diese zu Balancieren. Ich möchte die Auswirkungen von Maintenance parallel zur Produktentwicklung aufzeigen, die Folgeprobleme benennen und Strategien vorstellen um dieses Dilemma zu umgehen.
This document provides an overview of the Go programming language, including its history, design goals, key features, and tooling. Go was created at Google in 2007 and released as an open source project in 2009. It aims to provide simplicity, concurrency, and robustness for building large-scale distributed systems. Some of its core features include garbage collection, static typing, interfaces, goroutines for lightweight threading, and a large standard library.
Unsere Anti-Pattern Karten sind aus unserer jahrelangen Arbeit mit Kunden, und den daraus gewonnenen Erfahrungen entstanden. Sie sollen euch dabei helfen, selbst Fettnäpfchen zu erkennen, die wir schon von außen erlebt haben, oder in die wir sogar teilweise selbst schon getreten sind. Wenn ihr noch andere Anti-Patterns kennt, dann schickt sie uns unter https://mayflower.de/agile-antipattern.
Wenn der größte Teil der Logik in JavaScript stattfindet, dann findet auch der größere Teil der Sicherheitsrisiken dort sein Zuhause. Und auch Angreifer finden mit JavaScript eine interessante neue Spielwiese, denn die Sprache selbst und auch Ihre Heimat in Browser und Node.js bringen neue Probleme.
Genau da setzt der Vortrag an: die verblüffenden Unterschiede von JavaScript zu anderen Sprachen, wenn es um Security geht. Die Risiken und auch die Besonderheiten von Browsern und anderen JavaScript-Engines wie Node.js. Die Security-Implikationen von JavaScript-Frameworks bis hin zu speziellen Problemen wie mXSS, ReDOS und HTML5-Security.
Warum gilt Management bei Entwicklern als notorisch schlecht? Wie kann es kommen, dass ein Entwickler der eben noch auf die Leitung schimpfte sich selbst identisch verhält, sobald er in die Funktion rückt? Wie würde gutes Management in der IT denn aussehen? Wir berichten über unserer naiven Fehler am Anfang, unsere Erfahren auf der agilen Reise und über das, bei dem wir heute angekommen sind. Und wir haben wirklich viel falsch gemacht.
Salt and pepper — native code in the browser Browser using Google native ClientMayflower GmbH
Native client (NaCl) allows running native code securely in the browser. It uses a sandboxed execution environment and static analysis to ensure safety. Portable native client (PNaCl) compiles code to an architecture-independent format. The Pepper API provides access to browser capabilities like filesystem and networking. While currently only supported in Chrome, NaCl enables efficient execution of existing C/C++ code in the browser for tasks like audio/video processing, games, and packaging desktop applications as Chrome apps.
This document discusses JavaScript memory leaks and how to debug them. It defines a memory leak as occurring when memory is allocated but not freed by a program. In JavaScript, memory allocation happens through object creation, and garbage collection frees memory. Memory leaks can happen if objects remain referenced and cannot be collected. The document provides tips on how to use Chrome DevTools to analyze heap snapshots and timelines to find leaks, including cases around scopes, properties, closures, events, and detached DOM trees. It suggests strategies like naming functions, tracking individual objects, and handling leaky libraries.
Viele PHP-Applikationen sind über Jahre erfolgreich, haben jede Änderung mitgemacht und sind inzwischen weder wartbar noch entsprechen sie aktuellen Standards. Doch um am Markt zu bestehen braucht man neue Features, und damit einen Rewrite auf ein modernes Framework wie Zend Framework 2, Laravel 4 oder Symfony 2. Aber Rewrites schlagen häufig durch jede Deadline oder ganz fehl, und währenddessen übernimmt die Konkurrenz den Markt. Wie man aus der Rewrite-Falle kommt und verlässlich eine wartbare Version der Software herstellt – das erklärt dieser Talk mit Methoden, Beispielen und Praxiswissen.
Wenn der größte Teil der Logik in JavaScript stattfindet, dann findet auch der größere Teil der Sicherheitsrisiken dort seine Heimat. Und Angreifer finden mit JavaScript eine interessante neue Umwelt, denn die Sprache selbst und auch Ihre Heimat im Browser und Node.js bringen viele neue Probleme. Und genau da setzt der Vortrag an: die verblüffenden Unterschiede von JavaScript zu anderen Sprachen, wenn es um Security geht. Die Risiken und auch die Besonderheiten von Browsern und anderen JavaScript-Engines wie Node.js. Die Securityimplikationen von JavaScript-Frameworks bishin zu speziellen Problemen wie mXSS, ReDOS und HTML5-Security.
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...Mayflower GmbH
Soll ich Entwickler pro Stunde einkaufen? Lohnt es sich für mich, spontan ein Team zu staffen? Brauche ich einen Rockstar-Developer im Team, um die Deadline zu retten?
Woher kommt die Performance von Development-Teams? Ist es wirklich eine magische Eigenschaft von bestimmten Entwicklern, die Produkte erfolgreich macht? Oder kommt herausragende Performance von einer ganz anderer Seite?
Was Responsive Webdesign meint, ist klar: Ein Layout, das sich flexibel an die Bildschirmgröße des Clients anpasst. Für einen perfekten Auftritt auf dem Smartphone ebenso wie dem UltraHD-TV.
Was so schön klingt, birgt aber auch viele Fallstricke. Der Vortrag wird einige von ihnen Vorstellen: Von extravaganten Kundenwünschen, überraschender Browser-Inkompatibilität und der Verwendung von iFrames bis hin zu responsiven HTML-Newslettern. Abgerundet wird der Talk durch verschiedene Beispiele für den Workflow, Testing-Strategien und dem Thema SEO im Zusammenhang mit Responsive Webdesign.
Native Cross-Platform-Apps mit Titanium Mobile und AlloyMayflower GmbH
Dank der Webtechnologien stehen Ihnen viele Möglichkeiten bereit, auf dem mobilen Markt präsent zu sein. Da sind unter anderem W3C Widgets, mobile Webseiten, Webapplikationen und als native App verpackte Webapplikationen. Eine weitere Möglichkeit stellt das Titanium-Mobile-SDK dar. Das Besondere: Mit Titanium erstellte Apps sind nativ. Aus nur einer Codebasis können Sie eine native Anwendung für iOS, Android, BlackBerry und Tizen generieren, sowie eine Webapplikation. Nativ bedeutet, die Apps werden nicht nur sehr schnell ausgeführt, sondern es stehen Ihnen für eine optimale Usability auch native UI Widgets zur Verfügung. Interessant ist das SDK daher nicht nur für Webentwickler, sondern auch für Entwickler, die ihre Apps bisher aufwändig individuell nativ entwickelt haben. Mit Titanium benötigen Sie lediglich JavaScript-Kenntnisse.
Aussagen wie "Pair Programming ist langsam", "Pair Programming ist nur was für Junior Entwickler zum Übertragen von Domainwissen", "Pair Programming verbrennt zu viele Resourcen und ist nichts für mein Projekt", "Meine Tasks sind zu komplex fürs Pair Programming" oder "Im Moment haben wir keine Zeit fürs Pair Programming, wir müssen liefern (fertig werden)" werden oft als Argumente gegen Pair Programming vorgebracht.
Mit diesem Talk/Webinar möchte Martin Ruprecht den Aussagen entgegentreten und seine Erfahrungen aus den letzten Kundenprojekten weitergeben und zeigen, wann Pair Programming sinnvoll eingesetzt werden kann und warum in jedem Projekt im Pair programmiert werden sollte.
Zielgruppe:
Wenn Sie Entwickler oder Projektverantwortlicher sind, dann ist dieser Talk/dieses Webinar genau richtig für Sie.
Über Martin Ruprecht:
Martin Ruprecht arbeitet seit mehreren Jahren bei Mayflower und ist JavaScript und PHP-Entwickler. Zuvor studierte er erfolgreich Medientechnik/Medieninformatik an der FH Deggendorf. Neben seiner Tätigkeit als Entwickler bei Mayflower organisiert Martin regelmäßig Coding Dojos in München, tritt auf Konferenzen auf und hält Vorträge und Workshops zum Thema JavaScript, Testing und Qualitätssicherung in Webprojekten.
Vorstellung der Technologiedemo www.shoeism.de mit unserem LSH Algorithmus zur Ähnlichkeitssuche von hochdimensionalen Daten am Beispiel von E-Commerce Produktbildern.
Kennen Sie das? Während Sie noch fleißig wochen- und monatelang an Ihrer mobilen App konzipieren/konzipieren lassen, stehen schon die Mitbewerber auf dem Plan und haben eine ähnliche App herausgebracht. Besonders mobile Apps müssen zügig auf den Markt kommen, um Wettbewerbsvorteile in einer neuen, sich immer schneller drehenden Welt für sich entscheiden zu können. Doch welches Handwerkzeug braucht es hierzu?
Der Vortrag möchte Sie entführen in die agile Welt, in der in regelmäßigen, kurzen Zyklen neue Teilabschnitte Ihres Gesamtprojekts für Ihre Nutzerschaft veröffentlicht werden. Richtig angewendet bekommen Sie so einen Nutzersog, der Ihre Mitbewerber in den Schatten stellen wird. Warum warten, bis alle Funktionen komplett fertig sind, wenn Sie zunächst auch mit dem "Minimum Viable Product" starten können, um gleichzeitig wertvolle automatisierte Marktforschung über Nutzerfeedback für die nächsten Versionen zu erhalten? Wir stellen Ihnen hier das konzeptionelle Rüstzeug vor, das Sie hierfür benötigen.
Mit weit über 1 Million Downloads hat sich die quelloffene Piwik-Suite als zuverlässige und beliebte Alternative zu Traffic-Analysewerkzeugen wie Google Analytics etabliert. Heute lassen sich mit Piwik nahezu beliebige Statistiken zur Nutzung von Webseiten erfassen, auch das Monitoring komplexer Marketing-Kampagnen ist möglich. Das besondere an der Software: Ihr Funktionsumfang lässt sich über ein Plug-in-System nahezu beliebig erweitern.
Im Webinar zeigt Ihnen Thomas Steur, selbst Core-Mitglied im Piwik-Projektteam und Lead Developer für Piwik Mobile, wie Entwickler Piwik richtig nutzen können, was es mit der Plug-in-Entwicklung auf sich hat und worauf man im Umgang mit Echtzeit-Traffic-Daten (Stichwort: Skalierung) achten muss.
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsDianaGray10
Join us to learn how UiPath Apps can directly and easily interact with prebuilt connectors via Integration Service--including Salesforce, ServiceNow, Open GenAI, and more.
The best part is you can achieve this without building a custom workflow! Say goodbye to the hassle of using separate automations to call APIs. By seamlessly integrating within App Studio, you can now easily streamline your workflow, while gaining direct access to our Connector Catalog of popular applications.
We’ll discuss and demo the benefits of UiPath Apps and connectors including:
Creating a compelling user experience for any software, without the limitations of APIs.
Accelerating the app creation process, saving time and effort
Enjoying high-performance CRUD (create, read, update, delete) operations, for
seamless data management.
Speakers:
Russell Alfeche, Technology Leader, RPA at qBotic and UiPath MVP
Charlie Greenberg, host
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?
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...Fwdays
Direct losses from downtime in 1 minute = $5-$10 thousand dollars. Reputation is priceless.
As part of the talk, we will consider the architectural strategies necessary for the development of highly loaded fintech solutions. We will focus on using queues and streaming to efficiently work and manage large amounts of data in real-time and to minimize latency.
We will focus special attention on the architectural patterns used in the design of the fintech system, microservices and event-driven architecture, which ensure scalability, fault tolerance, and consistency of the entire system.
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!
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
Must Know Postgres Extension for DBA and Developer during MigrationMydbops
Mydbops Opensource Database Meetup 16
Topic: Must-Know PostgreSQL Extensions for Developers and DBAs During Migration
Speaker: Deepak Mahto, Founder of DataCloudGaze Consulting
Date & Time: 8th June | 10 AM - 1 PM IST
Venue: Bangalore International Centre, Bangalore
Abstract: Discover how PostgreSQL extensions can be your secret weapon! This talk explores how key extensions enhance database capabilities and streamline the migration process for users moving from other relational databases like Oracle.
Key Takeaways:
* Learn about crucial extensions like oracle_fdw, pgtt, and pg_audit that ease migration complexities.
* Gain valuable strategies for implementing these extensions in PostgreSQL to achieve license freedom.
* Discover how these key extensions can empower both developers and DBAs during the migration process.
* Don't miss this chance to gain practical knowledge from an industry expert and stay updated on the latest open-source database trends.
Mydbops Managed Services specializes in taking the pain out of database management while optimizing performance. Since 2015, we have been providing top-notch support and assistance for the top three open-source databases: MySQL, MongoDB, and PostgreSQL.
Our team offers a wide range of services, including assistance, support, consulting, 24/7 operations, and expertise in all relevant technologies. We help organizations improve their database's performance, scalability, efficiency, and availability.
Contact us: info@mydbops.com
Visit: https://www.mydbops.com/
Follow us on LinkedIn: https://in.linkedin.com/company/mydbops
For more details and updates, please follow up the below links.
Meetup Page : https://www.meetup.com/mydbops-databa...
Twitter: https://twitter.com/mydbopsofficial
Blogs: https://www.mydbops.com/blog/
Facebook(Meta): https://www.facebook.com/mydbops/
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
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.
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.
"Choosing proper type of scaling", Olena SyrotaFwdays
Imagine an IoT processing system that is already quite mature and production-ready and for which client coverage is growing and scaling and performance aspects are life and death questions. The system has Redis, MongoDB, and stream processing based on ksqldb. In this talk, firstly, we will analyze scaling approaches and then select the proper ones for our system.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...Jason Yip
The typical problem in product engineering is not bad strategy, so much as “no strategy”. This leads to confusion, lack of motivation, and incoherent action. The next time you look for a strategy and find an empty space, instead of waiting for it to be filled, I will show you how to fill it in yourself. If you’re wrong, it forces a correction. If you’re right, it helps create focus. I’ll share how I’ve approached this in the past, both what works and lessons for what didn’t work so well.
The Microsoft 365 Migration Tutorial For Beginner.pptxoperationspcvita
This presentation will help you understand the power of Microsoft 365. However, we have mentioned every productivity app included in Office 365. Additionally, we have suggested the migration situation related to Office 365 and how we can help you.
You can also read: https://www.systoolsgroup.com/updates/office-365-tenant-to-tenant-migration-step-by-step-complete-guide/
2. Wer macht UnitTests?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 2
3. Code Coverage?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 3
4. Wer glaubt, dass die Tests
gut sind?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 4
5. Kann die Qualität
gesteigert werden?
100%
0%
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 5
6. Test der kompletten
Architektur?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 6
7. MVC?
Controller
View Model
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 7
8. Wie testet Ihr eure
Models?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 8
9. Direkter DB-Zugriff?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 9
10. Keine UnitTests!
STOP
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 10
11. Integration Tests!
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 11
12. Wie testet Ihr eure
Controller?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 12
13. Routes, Auth-Mock,
Session-Mock, ...?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 13
14. Keine UnitTests!
STOP
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 14
15. Was wollen wir testen?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 15
16. Integration Regression
Testing Testing
Unit Testing
System - Integration
Testing
Acceptance
Testing
System Testing
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 16
17. The goal of unit testing is
to isolate each part of the
program and show that
the individual parts are
correct
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 17
18. Test Doubles
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 18
19. Stubs
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 19
20. Fake that returns
canned data...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 20
21. Beispiel für ein Auth-Stub
$storageData = array(
'accountId' => 29,
'username' => 'Hugo',
'jid' => 'hugo@example.org');
$storage = $this->getMock('Zend_Auth_Storage_Session', array('read'));
$storage->expects($this->any())
->method('read')
->will($this->returnValue($storageData));
Zend_Auth::getInstance()->setStorage($storage);
// ...
/*
* Bei jedem Aufruf wird nun das Mock als Storage
* verwendet und dessen Daten ausgelesen
*/
$session = Zend_Auth::getInstance()->getIdentity();
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 21
22. Mocks
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 22
23. Spy with
expectations...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 23
24. Model Mapper Beispiel
class Application_Model_GuestbookMapper
{
protected $_dbTable;
public function setDbTable(Zend_Db_Table_Abstract $dbTable)
{
$this->_dbTable = $dbTable;
return $this;
}
public function getDbTable()
{
return $this->_dbTable;
}
public function getEmail() {}
public function getComment() {}
public function save(Application_Model_Guestbook $guestbook)
{
$data = array(
'email' => $guestbook->getEmail(),
'comment' => $guestbook->getComment(),
);
$this->getDbTable()->insert($data);
}
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 24
25. Testen der save() Funktion
class Applicatoin_Model_GuestbookMapperTest extends PHPUnit_Framework_TestCase
{
public function testSave()
{
$modelStub = $this->getMock('Application_Model_Guestbook', array('getEmail', ,getComment'));
$modelStub->expects($this->once())
->method('getEmail')
->will($this->returnValue('super@email.de'));
$modelStub->expects($this->once())
->method('getComment')
->will($this->returnValue('super comment'));
$tableMock = $this->getMock('Zend_Db_Table_Abstract', array('insert'), array(), '', false);
$tableMock->expects($this->once())
->method('insert')
->with($this->equalTo(array(
'email' => 'super@email.de',
'comment' => 'super comment')));
$model = new Application_Model_GuestbookMapper();
$model->setDbTable($tableMock); // << MOCK
$model->save($modelStub); // << STUB
}
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 25
26. Stub Mock
Fake that Spy with
returns canned !== expectations...
data...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 26
27. Fixtures
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 27
28. Set the world up
in a known
state ...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 28
29. Fixture-Beispiel
class Fixture extends PHPUnit_Framework_TestCase
{
protected $fixture;
protected function setUp()
{
$this->fixture = array();
}
public function testEmpty()
{
$this->assertTrue(empty($this->fixture));
}
public function testPush()
{
array_push($this->fixture, 'foo');
$this->assertEquals('foo', $this->fixture[0]);
}
public function testPop()
{
array_push($this->fixture, 'foo');
$this->assertEquals('foo', array_pop($this->fixture));
$this->assertTrue(empty($this->fixture));
}
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 29
30. Method Stack
Ablauf
public static function setUpBeforeClass() { }
protected function setUp() { }
public function testMyTest() { /* TEST */ }
protected function tearDown() { }
protected function onNotSuccessfulTest(Exception $e) { }
public static function tearDownAfterClass() { }
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 30
31. Test Suite ...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 31
32. ...wirkt sich auf die
Architektur aus.
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 32
33. Wenn nicht...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 33
35. Was kann man machen?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 35
36. Production Code
überarbeiten
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 36
37. Dependency Injection
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 37
38. Bemerkt?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 38
39. Dependency Injection
class Application_Model_GuestbookMapper
{
protected $_dbTable;
public function setDbTable(Zend_Db_Table_Abstract $dbTable)
{
$this->_dbTable = $dbTable;
return $this;
}
public function getDbTable()
{
return $this->_dbTable;
}
public function getEmail() {}
public function getComment() {}
public function save(Application_Model_Guestbook $guestbook)
{
$data = array(
'email' => $guestbook->getEmail(),
'comment' => $guestbook->getComment(),
);
$this->getDbTable()->insert($data);
}
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 39
40. Besser aber ...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 40
41. ... Begeisterung sieht anders aus!
Titel der Präsentation I Mayflower GmbH I xx. Juni 2010 I 41
42. Was könnte noch helfen?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 42
43. TDD?
Test Driven Development
[
~~
[ ~~
~~ ~~
~~ ~~
~~ ~~
~
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 43
44. Probleme früh erkennen!
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 44
45. Uncle Bob´s
Three Rules of TDD
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 45
46. #1
“ You are not allowed to write any
production code unless it is to make a
failing unit test pass.
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 46
47. #2
“ You are not allowed to write any more of
a unit test than is sufficient to fail; and
compilation failures are failures.
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 47
48. #3
“ You are not allowed to write any more
production code than is sufficient to pass
the one failing unit test.
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 48
49. Und wieder...
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 49
51. Und jetzt?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 51
52. Things get worst
before they get
better !
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 52
53. Monate später...
Titel der Präsentation I Mayflower GmbH I xx. Juni 2010 I 53
54. Gibts noch was?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 54
55. Darf ich vorstellen:
„Bug“
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 55
56. Regression Testing
or
Test your Bugs!
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 56
57. Regression Testing
Bug
class Calculate
{
public function divide($dividend, $divisor)
1 {
return $dividend / $divisor;
}
}
2 Warning: Division by zero in /srv/phpunit-slides/Calculate.php on line 7
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 57
58. Regression Testing
Test First!
/**
* Regression-Test BUG-123
*
* @group BUG-123
*
* @return void
3 */
public function testDivideByZero()
{
$calc = new Calculate();
$this->assertEquals(0, $calc->divide(1, 0));
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 58
59. Regression Testing
Bugfix
class Calculate
{
4 public function divide($dividend, $divisor)
{
if (0 == $divisor) {
return 0;
}
return $dividend / $divisor;
}
}
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 59
60. Regression Testing
phpunit
slides$ phpunit --colors --verbose CalculateTest.php
PHPUnit 3.5.5 by Sebastian Bergmann.
5
CalculateTest
......
Time: 0 seconds, Memory: 5.25Mb
OK (6 tests, 6 assertions)
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 60
61. Regression Testing
@group
slides$ phpunit --colors --verbose --group BUG-123 CalculateTest.php
PHPUnit 3.5.5 by Sebastian Bergmann.
?
CalculateTest
.
Time: 0 seconds, Memory: 5.25Mb
OK (1 tests, 1 assertions)
/**
* Regression-Test BUG-123
*
* @group BUG-123
*
* @return void
? */
public function testDivideByZero()
{
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 61
62. Noch Fragen?
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 62
63. Quellen
I Baby: ADDROX http://www.flickr.com/photos/addrox/2587484034/sizes/m/
I Fish: ADDROX http://www.flickr.com/photos/addrox/274632284/sizes/m/
I Happy: ADDROX http://www.flickr.com/photos/addrox/2610064689/sizes/m/
I Bug: ADDROX http://www.flickr.com/photos/addrox/284649644/sizes/m/
Unit Test Fun: Mock Objects, Fixtures, Stubs & Dependency Injection I Mayflower GmbH I 02. Dezember 2010 I 63