This document discusses testing with mock objects and provides guidance on their use. It notes that mocks are used to test in isolation by removing dependencies, and that mocks simulate object interaction while stubs simulate object state. Examples are given of scenarios where mocks are useful, such as distributed development and non-deterministic outcomes. The document recommends using mocks for developer tests but not acceptance tests, and lists some useful mocking patterns and resources for learning more.
Mocking allows you to test classes and methods in isolation by replacing their collaborators with mock objects that simulate the normal environment. EasyMock is a framework for creating mock objects that uses a record/replay approach where you first define the expected behavior of mock objects and then replay the code under test to verify it behaves as expected. Mock objects can be normal, strict, or nice depending on how strictly they enforce the expected behavior and order of method calls.
PHPUnit is the most famous unit test framework for PHP. Mocks help programmers and testers to replace (mock) external dependencies during unit test development.
Utilizing some of the advanced features of PHPUnit testing. This presentation was given at the 2008 DC PHP conference.
About a week ago, I published the "Three Interviews About Static Code Analyzers" article at Habrahabr. This article presents opinions of three experienced programmers from the companies Acronis, AlternativaPlatform and Echelon Company concerning software development methodologies as well as some of their ideas about using static code analyzers. Since the article was sponsored by the OOO "Program Verification Systems" company, developer of the PVS-Studio static analyzer, I asked Andrey Karpov (CTO) to answer some questions too. In particular, I asked him to comment upon the most interesting aspects and ideas of all the three interviews and say a few words for colleagues and readers, too. Here's what we've got - one more interesting interview.
This document discusses 10 ways to improve programming code through practices like composing methods, test-driven development, static analysis, and questioning assumptions. It encourages techniques like short single-purpose methods, writing tests before code, using tools like FindBugs, avoiding unnecessary complexity, and continually learning language nuances. Examples show refactoring code to follow these practices. Resources are provided on related topics like pair programming and anti-object-oriented design.
The document discusses and compares two popular ActionScript frameworks: PureMVC and Robotlegs. It provides an overview of why frameworks are used, describes some common design patterns implemented in frameworks, and highlights key features and strengths/weaknesses of PureMVC and Robotlegs.
This document provides an overview of various concepts in software engineering, including implementation, testing, debugging, development rules, and sayings around software development. It discusses principles like debugging and maintenance taking more time than implementation, data structures being more important than codes/algorithms, avoiding premature optimization, and releasing software often for early feedback. It also covers topics such as unit testing, avoiding obese code, intellectual property, management approaches, software development methodologies, and different types of testing.
Some time ago, when refactoring code or adding business logic, my tests failed -> leaving me unsure if I did break something or not. How to write tests, where you can completely change the implementation and verify that it still works without breaking any test? Feels like a utopia? Come and see how to do this with "real" project example! Github project: https://github.com/gmiejski/dvd-rental-tdd-example
As a guest speaker in NCU, I gave a talk about some best practices of JavaScript programming to college students. It covers basic JavaScript elements and some common pitfalls while dealing with asynchronous programming.
ThoughtWorks Luminary and Conference Presenter Extraordinaire Neal Ford will be presenting: Emergent Design & Evolutionary Architecture Most of the software world has realised that Big Design Up Front (BDUF) doesn’t work well in software. But lots of developers struggle with this notion when it applies to architecture and design, surely you can’t start coding, right? You need some level of understanding before you can start work. This seminar will explore the current thinking about Emergent Design and Evolutionary Architecture, including: • Proactive approaches with test driven development • Reactive approaches including both refactoring and composed methods • Strategies and techniques for allowing design to emerge from projects as they proceed, keeping your code in sync with the problem domain • Real world examples of these techniques in action Neal Ford, Software Architect and Meme Wrangler, ThoughtWorks Neal is an acclaimed international speaker and expert on designing and building of large-scale enterprise applications. Neal has spoken at over 100 conferences worldwide, delivering more than 600 talks. Neal is also the designer and developer of applications, instructional materials, magazine articles, courseware, video/DVD presentations and author and/or editor of 6 books spanning a variety of technologies, including the most recent The Productive Programmer.
Presentation I gave at the Houston TechFest Sept 2009. This presentation goes over Extension Methods, Lambdas, Expression Trees, and Fluent Interfaces. I also show examples from popular frameworks using these techniques.
Neal Ford of ThoughtWorks discusses emergent design and evolutionary architecture. He argues that software design emerges from the code itself, rather than predefined documentation or specifications. Effective abstractions and patterns are discovered through refactoring code written with test-driven development. This approach helps reduce accidental complexity and allows the design to evolve in response to new information and changing requirements.
Neal Ford of ThoughtWorks discusses emergent design and evolutionary architecture. He argues that software design emerges from the code itself, rather than predefined documentation or specifications. Design is a process of discovering effective abstractions and patterns by refactoring code through practices like test-driven development. Architectural considerations involve balancing essential versus accidental complexity, technical debt, and flexibility to evolve designs over time in response to changing needs.
The document discusses different types of polymorphism in C++, including runtime polymorphism using virtual methods and compile-time polymorphism using templates. It notes that templates can provide polymorphism without the performance overhead of virtual methods, but may increase compile times. Both techniques have advantages and can be combined effectively in some cases to leverage their respective benefits.
This document summarizes 10 ways to improve code based on a presentation by Neal Ford. The techniques discussed include composing methods to perform single tasks, test-driven development to design through tests, using static analysis tools to find bugs, avoiding singletons, applying the YAGNI principle to only build what is needed, questioning conventions, embracing polyglot programming, learning Java nuances, enforcing the single level of abstraction principle, and considering "anti-objects" that go against object-oriented design. Questions from the audience are then addressed.