AspectMock is a PHP library that allows mocking of any method call, including static and private methods, without requiring code refactoring. It uses aspect-oriented programming to intercept method calls and return mock values. To use it, install via Composer, create a custom autoloader for tests, and define the class and methods to mock along with their return values. AspectMock makes it easy to mock code as written without dependency injection refactoring required by other mocking tools.
Acceptance Test Driven Development and Robot FrameworkSteve Zhang
This presentation is about using Robot Framework automation test framework to implement Acceptance Test Driven Development, BDD or Specification By Example
This slide goes from an introduction to general software testing down to testing of javascript application, explaining why test, when to test and what to test in an application. Mocha framework was used to explain how testing works in JS.
Talk Presented at #forLoopKaduna Meetup on July 1st, 2017
Acceptance Test Driven Development and Robot FrameworkSteve Zhang
This presentation is about using Robot Framework automation test framework to implement Acceptance Test Driven Development, BDD or Specification By Example
This slide goes from an introduction to general software testing down to testing of javascript application, explaining why test, when to test and what to test in an application. Mocha framework was used to explain how testing works in JS.
Talk Presented at #forLoopKaduna Meetup on July 1st, 2017
Luis Correia - Instituto de Informática - OSL19marketingsyone
Title: Open Source in Automated Testing.
By using Open Source Projects as the foundation of our internal Test Framework, it is possible to avoid vendor tool lock-in. Since the same language is spoken as the testing teams and by better understand their problems, as well as being closer to them, it is posisble to deliver more value. This talk is all about how to built a Framework that helps teams create whole automated test suits in a simple and easy way.
This documentation illustrates-
1. Effective branching of the version control system, git.
2. When and how codes are fast-forwarded.
3. Effective code review to share the concerns.
4. Improvement of codes and merging, rebasing, etc.
From a Joomla Day Midwest presentation, this focuses on unit testing in the open source Joomla project. The slides wrap around two demonstrations that cannot be included here.
We've all been faced with legacy code and often decided to rewrite, feeling it will be easier. There are many reasons this can be wrong. Adam Culp will talks about the entire journey of refactoring a legacy code base. He will begin with assessment and why, move on to planning how and when, cover execution and testing, give step-by-step examples, and even show how to manage the process effectively. Attendees will gain insight and tips on how to handle their own pile of code and refactor happy.
Microsoft Fakes help you isolate the code you are testing by replacing other parts of the application with substitute code. These substitutes are called stubs and shims and are under the control of your tests. Microsoft Fakes is ideal when you need to test legacy or “legacy” code that is either restricted for refactoring or “refactoring” practically means rewriting and cost you a lot.
Luis Correia - Instituto de Informática - OSL19marketingsyone
Title: Open Source in Automated Testing.
By using Open Source Projects as the foundation of our internal Test Framework, it is possible to avoid vendor tool lock-in. Since the same language is spoken as the testing teams and by better understand their problems, as well as being closer to them, it is posisble to deliver more value. This talk is all about how to built a Framework that helps teams create whole automated test suits in a simple and easy way.
This documentation illustrates-
1. Effective branching of the version control system, git.
2. When and how codes are fast-forwarded.
3. Effective code review to share the concerns.
4. Improvement of codes and merging, rebasing, etc.
From a Joomla Day Midwest presentation, this focuses on unit testing in the open source Joomla project. The slides wrap around two demonstrations that cannot be included here.
We've all been faced with legacy code and often decided to rewrite, feeling it will be easier. There are many reasons this can be wrong. Adam Culp will talks about the entire journey of refactoring a legacy code base. He will begin with assessment and why, move on to planning how and when, cover execution and testing, give step-by-step examples, and even show how to manage the process effectively. Attendees will gain insight and tips on how to handle their own pile of code and refactor happy.
Microsoft Fakes help you isolate the code you are testing by replacing other parts of the application with substitute code. These substitutes are called stubs and shims and are under the control of your tests. Microsoft Fakes is ideal when you need to test legacy or “legacy” code that is either restricted for refactoring or “refactoring” practically means rewriting and cost you a lot.
[DevDay 2016] Real Unit Testing with mocking framework - Speaker: Phat Vu – S...DevDay.org
Why do programmers hate writing Unit Tests? One big reason is object dependency. An object under testing may have dependencies on other complex objects, which might not have been implemented or been complicated when invoking.
Join the session refresh your thinking about Unit Testing and overview of mocking framework, as well as learn some practice/gotcha to write a real Unit Test, how to isolate the behavior of the object you want to test, how to simulate the behavior of the dependencies.
———
Speaker: Phat Vu – Scrum Master at Axon Active Vietnam
This presentation is simply for motivating developers towards test automation and test-driven development. It discusses lightly unit testing, mocking and integration testing, too.
How ANDROID TESTING changed how we think about Death - Second Editionpenanochizzo
"Irreproducible bugs become highly reproducible right after delivery to the customer". This is something that happens "almost" everyday.
It is well known that testing offers significant advantages as a development practice and helps ensure higher quality code with fewer defects.
Unfortunately, testing Android apps can be challenging, so in this session we are gonna talk about available tools and practices that could help us accomplish our goals.
How ANDROID TESTING changed how we think about Death - Second EditionFernando Cejas
"Irreproducible bugs become highly reproducible right after delivery to the customer". This is something that happens "almost" everyday.
It is well known that testing offers significant advantages as a development practice and helps ensure higher quality code with fewer defects.
Unfortunately, testing Android apps can be challenging, so in this session we are gonna talk about available tools and practices that could help us accomplish our goals.
This was a workshop given on the UTN University, for the Software Engineering students. The idea is to give a brief explanation about TDD, and how to use it.
Why should we use TDD to develop in Elixir? When we are applying it correctly? What are the differences that we can find in a code developed with TDD and in code not developed with it? Is it TDD about testing? Really? In this talk, I'll show what is TDD and how can be used it in functional programming like Elixir to design the small and the big parts of your system, showing what are the difference and the similarities between an OOP and FP environment. Showing what is the values of applying a technique like TDD in Elixir and what we should obtain applying it.
Software quality is critical to consistently and continually delivering new features to our users. This talk covers the importance of software quality and how to deliver it via unit testing, Test Driven Development and clean code in general.
This is the deck from a talk I gave at Desert Code Camp 2013.
Unit tests give developers and testers a quick way to look for logic errors in the methods of classes in Visual C#, Visual Basic, and Visual C++ projects. A unit test can be created one time and run every time that source code is changed to make sure that no bugs are introduced.
Coding Naked – Practical steps to moving towards & embracing TDD. We'll overview the normal roadblocks that people typically run in to, and practical ways to overcome those road blocks on your way to embracing Test Driven Development - make coding without tests as uncomfortable as coding naked!
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
2. So, yeah, tests are important
“Test code is just as important as production code.”
“… tests enable change”“Code, without tests, is not clean. No matter how elegant it is, no
matter how readable and accessible, if it hath not tests, it be unclean.”
“All software you write will be tested – if not by you and
your team, then by the eventual users.”
“…legacy code is simply code without tests.”
“Code without tests is bad code. … With tests we can change the
behavior of our code quickly and verifiably. Without them, we
really don’t know if our code is getting better or worse.”
From Clean Code by Robert Martin, The Pragmatic Programmer by Andrew Hunt and David Thomas, and Working Effectively With Legacy Code by Michael Feathers
3. If you have trivial methods, tests are easy
Code Test
5. “They” say use Dependency Injection and mocks
Changing the
method’s
signature requires
refactoring all
method calls.
DI does nothing
for static
method calls
https://phpunit.de/manual/current/en/test-doubles.html
6. Or you could write integration tests …
Code Test
Even with integration tests, this
path cannot be tested because it
is a time-sensitive conditional
That’s a lot of work
7. Is there a third option?
A. Refactor all of your code to use Dependency Injections so you can mock dependencies.
B. Write intricate integration tests with heavy setup and teardown
C. ??
8. C. Use AspectMock
• Allows you to mock any method call (static, private, built-in PHP)
• Does not require refactoring existing code
• Installs via Composer (and configure an autoloader for tests)
• Can return a different mock value for each individual test
• Easy to use
• Magical
10. Here’s the basic setup
• Import AspectMockTest
• In tearDown() method, run clean() to
reset the mocks between tests
• Define the class to be mocked, and the
desired results for each of its methods
• Write your test
13. So, how does it work?
• Relies on Aspect Oriented Programming
• Some concerns cut across classes (security, logging, etc.)
• Identify join points (method invocation, method return)
• Write code that provides advice at designated join points
• AOP code can target methods without cluttering those methods
• Uses PHP implementation of AOP called Go! AOP Framework
(http://go.aopphp.com)
14. Setup
1. Install via Composer
Be sure to include any path
you may mock, and exclude
all test-related paths
2. Create custom autoloader
3. Point phpunit to
special autoloader
15. Ready to try it for yourself?
Website: https://github.com/Codeception/AspectMock
Editor's Notes
Walk through both the code and the test on this
Explain what the code is doing here. Then talk about how it’s hard to test.
PHPUnit is designed to pass mocks through dependency injection.
Injecting dependencies sometimes violates separate of concerns. The calling methods shouldn’t know what calculateTax needs to do its job.
Set up what you need – a test User, location, and item. Use real TaxCode and Calendar classes, maybe with test data in those.
It takes a lot of work to set up integration tests. If using dbase, tests are slower and dbase can get littered with test data from failed tests that don’t tear down correctly
Step through test line by line, then walk through execution
Combines integrations and mocks.
Code is from a database mapper. The test is to determine if the dbase query runs correctly.
We need real values in dbase due to FK constraints on ProjectId and SiteIds
It uses values set up in the setUp function of the test, and removed in the teardown function
In this sample, we are actually mocking the results of a private method within the method under test, because it relies on values we don’t want to set up.
Remember, PHPUnit does not support mocking private methods, so we couldn’t do this in PHPUnit mocks.