This slide explain you the concept of XUnit with Asp.Net Core Web API. This slide covers,
Understanding Testing of Application,
Unit testing with XUnit Framework to improve the software performance,
Explains how to start with Unit and Integration testing with XUnit.
This slide explain you the concept of XUnit with Asp.Net Core Web API. This slide covers,
Understanding Testing of Application,
Unit testing with XUnit Framework to improve the software performance,
Explains how to start with Unit and Integration testing with XUnit.
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.
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.
Making the Unstable Stable - An Intro To TestingCameron Presley
Does it always seem like bugs you've fixed keep coming back? Does it seem like when you fix one bug, two more crop up? What if I were to tell you there's a better way?
In this presentation, we're going to explore how to make a code base more stable by using automated testing. To start, we'll explore the business case of why you should be writing tests by looking at industry studies and personal experience. From there, we'll look at the fundamentals of testing by talking about the pros/cons of unit, integration, and UI testing. Finally, we'll look at some resources to learn how to write tests.
Intended for developers who are new to testing, by the end of this presentation, you will understand why you should write tests, and will have the concepts and tools to get started.
Prerequisites
Some knowledge with an Object-Oriented language would be beneficial, but not required.
Intelliware’s Chief Technologist, BC Holmes, provides a pragmatic overview of Agile testing. Complete with many examples, this presentation is ideal for those looking for a practical take on software testing in an Agile environment.
Agile Testing: A pragmatic overview and new entry in Intelliware’s Agile Methodology Series.
What you’ll learn in this presentation:
Intelliware’s Chief Technologist, BC Holmes, provides a pragmatic overview of Agile testing. Complete with many examples, this presentation is ideal for those looking for a practical take on software testing in an Agile environment.
The presentation covers:
- Why do we use Agile testing?
- What Agile testing isn’t
- What Agile testing is: unit testing and test-driven development (TDD)
- High-level properties of good tests
- Testing in different languages
- Test suites and code coverage
- Using mock objects to help isolate units
- Beyond unit testing
in this presentation i demonstrated all of the testings that can be done to improve the continuous delivery system in the development process of software in the end i have demonstrated what TDD is and what are it's benefits after the slides i demonstrated the TDD methodology by building a small project(a simple stack) with three rules of TDD.
Integration testing is the phase in software testing in which individual software modules are combined and tested as a group. Read complete guide of integration testing types and tools here.
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
We often come across situations when:
> We cannot figure out why our Selenium/Appium scripts fail during execution either locally or on CI.
> We need to debug scripts locally while writing them but find debugging painful and slow
Debugging the scripts is often the approach to fix them. What all different ways we can do it?
I shared about some of the good practices I have used for debugging Selenium and Appium scripts
More Related Content
Similar to Unit testing (Exploring the other side as a tester)
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.
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.
Making the Unstable Stable - An Intro To TestingCameron Presley
Does it always seem like bugs you've fixed keep coming back? Does it seem like when you fix one bug, two more crop up? What if I were to tell you there's a better way?
In this presentation, we're going to explore how to make a code base more stable by using automated testing. To start, we'll explore the business case of why you should be writing tests by looking at industry studies and personal experience. From there, we'll look at the fundamentals of testing by talking about the pros/cons of unit, integration, and UI testing. Finally, we'll look at some resources to learn how to write tests.
Intended for developers who are new to testing, by the end of this presentation, you will understand why you should write tests, and will have the concepts and tools to get started.
Prerequisites
Some knowledge with an Object-Oriented language would be beneficial, but not required.
Intelliware’s Chief Technologist, BC Holmes, provides a pragmatic overview of Agile testing. Complete with many examples, this presentation is ideal for those looking for a practical take on software testing in an Agile environment.
Agile Testing: A pragmatic overview and new entry in Intelliware’s Agile Methodology Series.
What you’ll learn in this presentation:
Intelliware’s Chief Technologist, BC Holmes, provides a pragmatic overview of Agile testing. Complete with many examples, this presentation is ideal for those looking for a practical take on software testing in an Agile environment.
The presentation covers:
- Why do we use Agile testing?
- What Agile testing isn’t
- What Agile testing is: unit testing and test-driven development (TDD)
- High-level properties of good tests
- Testing in different languages
- Test suites and code coverage
- Using mock objects to help isolate units
- Beyond unit testing
in this presentation i demonstrated all of the testings that can be done to improve the continuous delivery system in the development process of software in the end i have demonstrated what TDD is and what are it's benefits after the slides i demonstrated the TDD methodology by building a small project(a simple stack) with three rules of TDD.
Integration testing is the phase in software testing in which individual software modules are combined and tested as a group. Read complete guide of integration testing types and tools here.
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
We often come across situations when:
> We cannot figure out why our Selenium/Appium scripts fail during execution either locally or on CI.
> We need to debug scripts locally while writing them but find debugging painful and slow
Debugging the scripts is often the approach to fix them. What all different ways we can do it?
I shared about some of the good practices I have used for debugging Selenium and Appium scripts
Upgrading Mobile Tester's Weapons with Advanced DebuggingAbhijeet Vaikar
I presented this paper at Global Testing Retreat 2017 conference. This paper describes benefits, methods, and approach for performing advanced debugging of mobile web, hybrid and native apps, as an additional check in mobile testing.
These are training slides created by me to conduct training and knowledge sharing sessions for beginners in Cognizant Technology Solutions for Selenium Automation.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
Data privacy is one of the most critical issues that businesses face. This presentation shares insights on the principles and best practices for ensuring the resilience and security of your workload.
Drawing on a real-life project from the HR industry, the various challenges will be demonstrated: data protection, self-healing, business continuity, security, and transparency of data processing. This systematized approach allowed to create a secure AWS cloud infrastructure that not only met strict compliance rules but also exceeded the client's expectations.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
2. Abhijeet Vaikar
Senior Software Engineer Test @ Carousell Singapore
Co-organizer @ taqelah!
Testing software and writing test code since 8 years
LinkedIn: https://www.linkedin.com/in/abhijeetvaikar/
Twitter: @AbhijeetVaikar
Email: vaikar.abhijeet@gmail.com
3. Friendly disclaimer!
This session intends to just be an introduction to unit
testing based on my recent experiences with
learning, writing & understanding unit tests as a
tester.
4.
5. What we’ll look at
● Jump straight into code - understand a Java application
● What is a unit test?
● Types of unit tests.
● How can unit tests help?
● Code coverage
● Effective unit tests
● How are unit tests adopted in the real world?
● Should testers involve themselves with unit testing? And how?
● FAQs
7. What is a unit test
There are multiple ways developers implement their unit tests. Regardless of the approach, there are
some common characteristics.
A unit test is an automated test that:
● Verifies output of a small piece of code for a given input.
● Is fast.
● Is Isolated.
8. Mockist style
● Isolation is on the system under test - usually a class or functions in the class.
● Any dependency of a unit (class / function) is replaced with a test double (For example mocks)
● With this approach we can verify interactions too. (For eg: Verify that my class under test called a
specific function of the dependency)
● Also useful when the dependency graph is too deep/complicated.
● These tests can get tied tightly to implementation details of the code under test. Thus they can
tend to become brittle.
11. Classical style
● Isolation is on the test instead of the system under test. This means the tests need to be isolated
from each other.
● This also means tests can cover multiple classes without the need to replace every dependency
with a test double.
● We may still replace a shared dependency like a database with a test double.
● Some may call this a component test.
● Behaviour is tested rather than implementation details.
15. Comparison*
Isolation of A unit is Uses test double for
Mockist style Units A class All but immutable
dependencies
Classic style Unit tests A class or a set of
classes
Shared
dependencies
*From Unit Testing Principles Practices & Patterns by Vladimir Khorikov
16. How can unit tests help?
● Isolated tests help in figuring out root cause faster.
● Unit tests are run the earliest in the development cycle so that highlight issues (regressions)
earliest.
● Helps with sustainable growth of the project code over time.
● Help in creating a good design of the code. For example they help with decoupling of the code.
● When written first before writing product code, it enables developers to think of all possible cases.
Writing unit tests later may cause developers to miss some cases.
● With unit tests in place, a developer can push their changes faster and with confidence.
17. Code coverage metrics
● Code coverage = (number of lines of code verified by tests / total number of lines of code) * 100
● A clearer formula = (number of lines of code verified by tests / total number of eligible lines of
code) * 100
● Coverage gives an idea of what parts of the code have been tested by tests (as an extension also
what parts are not covered).
● It’s meant to be used as an indicator / guiding signal of code quality and not an absolute metric.
● Low code coverage - could mean code is not well tested, thus poor quality.
● High code coverage - does not mean code is well tested and thus high quality.
19. Effective unit tests 💪
Effective unit tests
● are easy to write and maintain.
● have proper assertions. Assertion free tests = no tests at all.
● test the areas of the codebase that really matter (for example business logic). Don't just add unit
tests for the sake of adding unit tests everywhere. For example, there's no point adding unit tests
to POJOs.
● are part of the development cycle and build pipeline i.e., they should run every time you push your
code changes to the next stage.
There is no automated way to figure out whether existing unit tests are of good quality. This needs to be done with the help of
regular reviews (individual / peer).
20. How are unit tests adopted in the real world?
● Following a mix of both classic and mockist style approach.
● Many prefer writing tests first before writing the implementation code.
● Unit tests are integrated into the build pipeline. They run whenever their code is built on a pull
request.
● Some developers also add a pre-commit hook to run unit tests on their machine locally even before
pushing their code to remote version control.
● Many adopt a quality gate where if unit tests fail they are not allowed to merge their code for
deployment. Same applies for code coverage violation.
● Unit tests are not just written for product code but also for test automation frameworks!
● A lot of developers focus more on integration tests rather than writing unit tests.
● Some developers religiously write unit tests and maintain a high code coverage.
● Some developers do not write any unit tests at all.
● Parameterised / data driven unit tests are also written (Popular in the GoLang dev community)
21. Should testers be involved in unit testing? And how?
YES.
How?
● Write unit tests for your core components of test automation framework. Add them to your framework’s build
pipeline.
● Start conversations with your developers (frontend, backend both) to seek information:
○ Whether they write unit tests or not? If not, why not? If yes, how? What are the tools used?
○ What is the current code coverage of the product code? If low, why is it low? If high, is it a good test suite?
○ Are unit tests run as part of the product code’s build pipeline? If no, why not? If yes, do we block PRs when
unit tests fail?
○ Do we add unit tests to existing suite when a bug is found?
○ If a feature is deployed without unit tests, do they consider to add unit tests as a backlog/tech debt?
22. What does it mean to write unit tests for test automation
framework?🤔
Driver management Test Data handlers
Cloud service
handlers
Testcase
management
system handlers
Configuration
handlers
All classes that
support correct
functioning of the
test framework
Page Objects
Test classes /
Feature files / Test
specs
Reporting handlers
Write unit tests
Don’t write unit
tests
A test framework is also a software product
used by engineers.
23. FAQs❓
Q: Do unit tests find bugs?
A: Yes they do especially the obvious ones (provided they are written in the first place and the tests are
testing the right thing). If no unit tests are written, naturally no bugs will be found (at that level)! 😉
Q: Does that mean we should not focus on further levels of testing? (integration, end-end)?
A: Absolutely not. Regardless of whether unit tests are being written or not, it’s extremely important to
perform integration and end-end tests. We should not expect unit tests to find all bugs.
Q: Since they are unit tests and written by developers, should they cover just basic positive and
negative cases?
A: No. They should cover as many cases as possible.
24. Learning resources📚
Unit Testing - Principles, Practices and Patterns by Vladimir Khorikov (Book highly recommended)
Effective Unit Testing - A talk by Eliotte Rusty Harold (YouTube video)
TDD - Where Did it all go wrong - A talk by Ian Cooper (YouTube video)
Demo example created for this session (GitHub) - You can fork and write more unit tests against the code.