The document provides guidelines for writing effective unit tests, including why they are important (ensuring code works as expected, protecting work from accidental breaks, serving as documentation), what should be tested (models, services, commands, utilities), when they should be written (before or after code via test-driven development), and how to write good tests (automated, repeatable, single-purpose, readable, isolated, avoiding duplication).
A short presentation slide deck I gave to interns we have this summer of 2019 on (unit) testing in software development. This is not a code-centric slide deck and just looking at the slides loses some context without being there in person, or having discussions, etc.
A short presentation slide deck I gave to interns we have this summer of 2019 on (unit) testing in software development. This is not a code-centric slide deck and just looking at the slides loses some context without being there in person, or having discussions, etc.
An introduction to unit testing using Visual Studio, C#, xUnit.net, and Moq. What it is, what is isn't, why we don't do it, how to design for testability, what to test, test driven development, unit testing frameworks, mocking libraries, how to get started.
Lets break some code. In this workshop we will be going over some of the fundamental concepts of software testing and take a hands on approach to writing Unit and Integration tests. We will cover topics such as mocking, stubbing, database patching and how this can all fit into a continuous integration environment like Jenkins.
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.
An introduction to unit testing using Visual Studio, C#, xUnit.net, and Moq. What it is, what is isn't, why we don't do it, how to design for testability, what to test, test driven development, unit testing frameworks, mocking libraries, how to get started.
Lets break some code. In this workshop we will be going over some of the fundamental concepts of software testing and take a hands on approach to writing Unit and Integration tests. We will cover topics such as mocking, stubbing, database patching and how this can all fit into a continuous integration environment like Jenkins.
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.
Ever tried doing Test First Test Driven Development? Ever failed? TDD is not easy to get right. Here's some practical advice on doing BDD and TDD correctly. This presentation attempts to explain to you why, what, and how you should test, tell you about the FIRST principles of tests, the connections of unit testing and the SOLID principles, writing testable code, test doubles, the AAA of unit testing, and some practical ideas about structuring tests.
Test-Driven Development is about approaching software development from a test perspective and knowing how to use the tools (e.g. JUnit, Mockito) to effectively write tests.
Source code examples @...
https://github.com/codeprimate-software/test-driven-development
DevOps and continuous delivery can improve software quality and reduce risk by offering opportunities for testing and some non-obvious benefits to the software development cycle. By taking advantage of cloud computing and automated deployment, throughput can be improved while increasing the amount of testing and ensuring high quality. This article points out some of these opportunities and offers suggestions for making the most of them.
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.
.NET Fest 2019. Arnon Axelrod. Test automation for developersNETFest
Traditionally developers only write unit tests (hopefully!) and QA engineers write System tests, with Selenium or some other tool. However, while this separation has some reasons, it's also a bit arbitrary and unhealthy. In this talk we'll discuss why you should be involved in all kinds of test automation and discuss best practices for utilizing the test automation to improve the development lifecycle, as well as both the internal and the external quality of your code.
We investigate one of the most popular approaches to creating software: test driven development. From the basic understanding why tests are important to a new software development paradigm, where you start with tests and them do the implementation. We glance over different areas of testing and see how one should really do the software testing in different situation.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
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.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
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.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
2. Why?
It’s such a pain.
there is never enough time!
@jhooks | 2010 | joelhooks.com
3. Sanity.
Developers want a productive environment where
things work as expected.
Unit test can help create this environment at the code level.
@jhooks | 2010 | joelhooks.com
4. Protect your work.
We work hard on the functionality that we add to the
application.
Unit tests serve as a guard against accidental “harm” of code.
@jhooks | 2010 | joelhooks.com
5. Developer documentation.
Well written unit test provide excellent documentation
for other developers.
Unit tests describe how a piece of logical code should work in a way that English
language docs often can’t.
@jhooks | 2010 | joelhooks.com
6. Collective ownership.
Code that is protected can be worked on by anybody
with greater assurance that nothing will be accidentally
broken.
@jhooks | 2010 | joelhooks.com
7. Fearless refactoring.
Code can be constantly improved upon with less fear
of accidental breakage.
Unit tests verify that changes don’t break the existing logic.
@jhooks | 2010 | joelhooks.com
8. What should be tested?
Models
Service classes
Commands
Utility classes
any other logical code
@jhooks | 2010 | joelhooks.com
9. When to write tests...
Before you write the code?
After you write the code?
@jhooks | 2010 | joelhooks.com
10. Test Driven Development
10 Ways to Improve Your Code - Neal Ford
@jhooks | 2010 | joelhooks.com
11. Less fear.
Writing unit tests firsts lets you focus on the
functionality you are adding.
Write the test. Write the code. Tests pass. Done.
@jhooks | 2010 | joelhooks.com
12. Ensure test coverage.
Tests written before production code ensures that the
production code is tested.
Tests are not an afterthought.
@jhooks | 2010 | joelhooks.com
13. Reduces tedium of testing.
Wait... What?!
Writing tests before the production code eliminates the need for a massive testing
effort after the code is written.
@jhooks | 2010 | joelhooks.com
14. Guarantees testable code.
Testing first ensures that the production code can be
tested.
Testing after often results in the discovery that the code isn’t testable without
refactoring. Refactoring that isn’t protected by tests.
@jhooks | 2010 | joelhooks.com
15. TDD is not a guarantee.
Like most practices, TDD is no guarantee of quality or
success in development.
It is a tool.
@jhooks | 2010 | joelhooks.com
16. So when should I test?
Test driven development is not required.
Try it out. It can be painful to start, but once you get a rhythm going the benefits
are very real.
@jhooks | 2010 | joelhooks.com
17. What is a good unit test?
automated
repeatable
run by anybody
future use
fast
single push
easy
@jhooks | 2010 | joelhooks.com
18. Unit tests are by developers for developers.
Quality over quantity please.
@jhooks | 2010 | joelhooks.com
19. Trustworthy
Developers will run and use tests they trust.
A trustworthy test is free of bugs and does what it says it does.
@jhooks | 2010 | joelhooks.com
20. Tests are written to last.
Most tests are not meant to be temporary. They
change for very specific reasons
Bugs in production code
Bugs in the test
API updates in the production code
Test is no longer valid or is not needed
To eliminate duplication
@jhooks | 2010 | joelhooks.com
21. There is no logic in the test.
Logic in a unit tests makes the test harder to read and
understand. There is more likely to be bugs in the test.
It can also make the test harder to name.
There should be no switch, if, or else statements.
There should be no for each, for, or while statements.
The test is a series of method calls with no control flow.
@jhooks | 2010 | joelhooks.com
22. Only one thing is tested.
A unit test is testing a single behavior. Testing multiple
things makes a test hard to understand.
Assert only one thing.
Should be easy to name (you don’t need an and in the name).
When it fails, it is clear what actually failed.
@jhooks | 2010 | joelhooks.com
23. Maintainable
Unmaintainable tests are ignored and are often
simply removed from the suite.
Unmaintainable tests cannot be trusted.
@jhooks | 2010 | joelhooks.com
24. Test the API
Unit tests are written against the public contract of the
unit being tested. We shouldn’t be trying to test
private methods.
Private and protected methods can affect the outcome of public methods.
Does it make sense to make a private method public?
Test the results of the public API that uses private methods
Is the private method pure utility? Would it makes sense as a static method of a
utility class?
@jhooks | 2010 | joelhooks.com
25. Avoid duplication (DRY)
Avoiding the duplication of code in unit tests is as, if
not more, important than it is with production code.
Create helper methods like factories to assist in setup of common items
Use setup methods for setup of items common to all test methods in the case
Setup should be as short, simple, and as easy to read as possible
@jhooks | 2010 | joelhooks.com
26. Tests should be isolated.
Don’t try to use Parsley, configure and access remote
services, or otherwise try to simulate the broader
application in a unit test.
Are test methods constrained to a linear order of execution?
Is the test calling other test methods?
Do tests share global state?
Test behaviors, not workflows.
If shared state can’t be avoid, be sure to reset it in the teardown.
@jhooks | 2010 | joelhooks.com
27. Avoid multiple asserts.
Unit tests are testing specific single behaviors. It seems
like more work because results might be related, but
the results should be verified independently.
Give each assertion its own test
Give each test a meaningful name
This makes failures easy to understand and fix
@jhooks | 2010 | joelhooks.com
28. Avoid over-specification.
Tests shouldn’t make assumptions about the
implementation of behavior, instead they should focus
on the results of the behavior.
Does the test specify purely internal behavior of the unit?
Is the test using complicated mock objects when simple stubs would be enough?
Does the test assume specific results when it isn’t required?
@jhooks | 2010 | joelhooks.com
29. Readable
Code in tests is easy to understand quickly. What is
being tested is recognizable instantly without
deciphering or translation.
Readable tests are more trustworthy and maintainable.
@jhooks | 2010 | joelhooks.com
30. Standard test names.
If all tests are named in the same pattern they will be
easy to read..
methodUnderTest_descriptionOfState_expectedBehavior()
@jhooks | 2010 | joelhooks.com
31. Good variable names.
As with all code, good variable names can help
greatly in making the code readable.
Avoid abbreviations
Use static constants instead of hardcoded values
@jhooks | 2010 | joelhooks.com
32. Consistent test structure.
Setup -> Action -> Assert
[Test]
public function doSomeWork_workWasDone_isTrue()
{
//setup
var aDependency:ISomeDependency = new SomeDependency();
//execute behavior
aDependency.doSomeWork();
//verify expected state is valid
assertThat(allTestsNeedThis.workWasDone, isTrue());
}
@jhooks | 2010 | joelhooks.com