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.
Unit testing is a method where developers write code to test individual units or components of an application to determine if they are working as intended. The document discusses various aspects of unit testing including:
- What unit testing is and why it is important for finding defects early in development.
- Common unit testing techniques like statement coverage, branch coverage, and path coverage which aim to test all possible paths through the code.
- How unit testing fits into the software development lifecycle and is typically done by developers before handing code over for formal testing.
- Popular unit testing frameworks for different programming languages like JUnit for Java and NUnit for .NET.
The document provides examples to illustrate white box testing techniques
Test Driven Development (TDD) is a software testing methodology where developers write automated test cases before writing any code. It involves writing a failing test case for new functionality, then writing the minimum amount of code to pass that test, and refactoring the code. Key steps are to add a test, run all tests and see the new one fail, write code to pass the test, run tests to succeed, and refactor code while maintaining tests. Benefits include instant feedback, better code quality, and lower rework effort. Limitations include difficulty testing certain types of code like GUIs. Unit testing tests individual units of code in isolation through mocking of external dependencies.
Test driven development and unit testing with examples in C++Hong Le Van
油
Test-driven development (TDD) relies on short development cycles of writing a failing test case, producing code to pass that test, and refactoring the code. Unit testing tests individual units of code by isolating each part and showing they work correctly. Boost.Test is a popular C++ unit testing framework that allows organizing tests into suites and fixtures, and provides assertions and output of results. A minimal Boost.Test example defines a test case using BOOST_AUTO_TEST_CASE that contains an assertion like BOOST_CHECK_EQUAL to test that 2+2 equals 4.
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...AgileNetwork
油
- Writing automated tests takes a significant amount of time and effort, often resulting in test code that is twice or three times the size of the actual code being tested. This occurs because tests are written in isolation and dependencies must be mocked.
- A better approach is to write tests that focus on behaviors and public interfaces rather than implementation details. Tests should not break when implementation details change, only when public behaviors change. This allows for easier refactoring of code without breaking tests.
- Rather than focusing solely on unit tests, more effort should be put into system level testing which typically finds twice as many bugs. Tests can also be improved by designing them more formally and moving assertions directly into the code being tested.
The document discusses various aspects of unit testing including definitions, benefits, naming standards, and best practices. It provides definitions for terms like error, defect, failure. It outlines the benefits of unit testing like finding bugs early, enabling code refactoring. It discusses what should be tested like boundaries, error conditions. It also provides examples of good test names and guidelines for structuring and naming unit tests.
The document discusses various aspects of unit testing including definitions, benefits, naming standards, and best practices. It provides definitions for terms like error, defect, failure. It outlines the benefits of unit testing like finding bugs early, enabling code refactoring. It discusses what should be tested like boundaries, error conditions. It also provides examples of good test names and guidelines for structuring and naming unit tests.
The document discusses unit testing and provides guidance on effective unit testing practices. It defines key terms like error, defect, and failure. It outlines the benefits of unit testing like finding defects earlier and maintaining stable code. It discusses naming conventions and frameworks for unit tests. It provides examples of different types of unit tests and guidelines for writing good unit tests that are independent, fast, and test all functionality. The document emphasizes testing boundary conditions and errors as well as documenting test cases.
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.
The document discusses testing concepts such as code with tests vs without tests, test-oriented development, and different types of testing including unit testing, integration testing, and acceptance testing. It provides examples of test-driven development (TDD) and behavior-driven development (BDD) processes. The document also discusses tips for testing, including only testing what is necessary and identifying the appropriate types of testing for an application. Frameworks and tools for test automation and continuous integration are also mentioned.
stackconf 2024 | Test like a ninja with Go by Ivan Presenti.pdfNETWAYS
油
Not tested? Not done! Yet another talk about tests? I aim to present you with the techniques and tools you might use to build efficient and reliable tests. Well use Go, which provides a great testing experience. Ill show you overlooked techniques such as benchmarking, fuzzing, etc. Plus, Ill introduce you to the most popular libraries and packages used to test Go code.
The document discusses unit testing and provides guidance on how to effectively implement unit testing. It defines unit testing as testing individual units or components of software code to verify they are functioning as intended. The document outlines best practices for unit testing such as writing test cases that cover valid, invalid, and boundary conditions. It also recommends testing frameworks like JUnit that can automate running test cases. Overall, the document advocates for developing a rigorous unit testing strategy and practicing habits like writing tests first and continuously running tests to improve code quality.
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.
This document provides information about an upcoming presentation on effective unit testing in MuleSoft. The presentation will be given by Josh Erney, a MuleSoft Ambassador with over 5 years of experience developing and architecting MuleSoft solutions. The presentation will focus on 5 key steps for effective unit testing: 1) Understanding the value of unit tests, 2) Asserting code meets interface contracts, 3) Writing testable code, 4) Removing noise from tests, and 5) Prioritizing valuable tests over code coverage. The presenter will provide examples and tips for writing high-quality unit tests that reduce maintenance costs and increase development velocity. Attendees will learn how to identify important tests, write testable code, and focus
Intelliwares 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 Intelliwares Agile Methodology Series.
What youll learn in this presentation:
Intelliwares 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 isnt
- 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
Unit testing involves writing automated tests to test code. Automated tests are repeatable and help catch bugs before deploying code. The main benefits of unit testing are that it allows developers to test code frequently and in less time, catch bugs before deploying, deploy with confidence, reduce bugs in production, and refactor code with confidence.
There are different types of tests including unit tests, integration tests, and end-to-end tests. Unit tests isolate a unit of code without external dependencies and execute fast but provide less confidence. Integration tests involve external dependencies and provide more confidence but take longer. End-to-end tests drive the application through its UI and provide great confidence but are slow.
Good unit tests
The document discusses Test Driven Development (TDD). It describes the TDD cycle of writing an initially failing test, then code to pass the test, and refactoring. It proposes adopting TDD practices like writing tests for components before code and using continuous integration. It also discusses using code analysis tools in integration and avoiding tests sharing developer blind spots. Shortcomings discussed are difficulty testing interfaces and risk of false security from tests.
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.
The document discusses unit testing and test-driven development (TDD). It provides an overview and agenda for the topics, including definitions of unit testing and TDD. It addresses common misconceptions about unit testing and TDD. Benefits of unit testing include making code easier to maintain and understand through automated testing. TDD helps with understanding problems and designing code with test coverage. The document emphasizes the importance of writing good, trustworthy, and maintainable unit tests.
Test-driven development (TDD) is a process where test cases are created to validate requirements before functional code is written. The primary goals of TDD are to help specify requirements and design and to produce clean, bug-free code through a short development cycle of writing tests then code to pass those tests. Good unit tests for TDD should run fast, isolate dependencies, clearly define their scope, not require special setup, and clearly indicate their intention. In Golang, the testing package and go test command provide tools for writing and running tests, and go test can measure test coverage.
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) (20)
The document discusses unit testing and provides guidance on effective unit testing practices. It defines key terms like error, defect, and failure. It outlines the benefits of unit testing like finding defects earlier and maintaining stable code. It discusses naming conventions and frameworks for unit tests. It provides examples of different types of unit tests and guidelines for writing good unit tests that are independent, fast, and test all functionality. The document emphasizes testing boundary conditions and errors as well as documenting test cases.
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.
The document discusses testing concepts such as code with tests vs without tests, test-oriented development, and different types of testing including unit testing, integration testing, and acceptance testing. It provides examples of test-driven development (TDD) and behavior-driven development (BDD) processes. The document also discusses tips for testing, including only testing what is necessary and identifying the appropriate types of testing for an application. Frameworks and tools for test automation and continuous integration are also mentioned.
stackconf 2024 | Test like a ninja with Go by Ivan Presenti.pdfNETWAYS
油
Not tested? Not done! Yet another talk about tests? I aim to present you with the techniques and tools you might use to build efficient and reliable tests. Well use Go, which provides a great testing experience. Ill show you overlooked techniques such as benchmarking, fuzzing, etc. Plus, Ill introduce you to the most popular libraries and packages used to test Go code.
The document discusses unit testing and provides guidance on how to effectively implement unit testing. It defines unit testing as testing individual units or components of software code to verify they are functioning as intended. The document outlines best practices for unit testing such as writing test cases that cover valid, invalid, and boundary conditions. It also recommends testing frameworks like JUnit that can automate running test cases. Overall, the document advocates for developing a rigorous unit testing strategy and practicing habits like writing tests first and continuously running tests to improve code quality.
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.
This document provides information about an upcoming presentation on effective unit testing in MuleSoft. The presentation will be given by Josh Erney, a MuleSoft Ambassador with over 5 years of experience developing and architecting MuleSoft solutions. The presentation will focus on 5 key steps for effective unit testing: 1) Understanding the value of unit tests, 2) Asserting code meets interface contracts, 3) Writing testable code, 4) Removing noise from tests, and 5) Prioritizing valuable tests over code coverage. The presenter will provide examples and tips for writing high-quality unit tests that reduce maintenance costs and increase development velocity. Attendees will learn how to identify important tests, write testable code, and focus
Intelliwares 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 Intelliwares Agile Methodology Series.
What youll learn in this presentation:
Intelliwares 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 isnt
- 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
Unit testing involves writing automated tests to test code. Automated tests are repeatable and help catch bugs before deploying code. The main benefits of unit testing are that it allows developers to test code frequently and in less time, catch bugs before deploying, deploy with confidence, reduce bugs in production, and refactor code with confidence.
There are different types of tests including unit tests, integration tests, and end-to-end tests. Unit tests isolate a unit of code without external dependencies and execute fast but provide less confidence. Integration tests involve external dependencies and provide more confidence but take longer. End-to-end tests drive the application through its UI and provide great confidence but are slow.
Good unit tests
The document discusses Test Driven Development (TDD). It describes the TDD cycle of writing an initially failing test, then code to pass the test, and refactoring. It proposes adopting TDD practices like writing tests for components before code and using continuous integration. It also discusses using code analysis tools in integration and avoiding tests sharing developer blind spots. Shortcomings discussed are difficulty testing interfaces and risk of false security from tests.
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.
The document discusses unit testing and test-driven development (TDD). It provides an overview and agenda for the topics, including definitions of unit testing and TDD. It addresses common misconceptions about unit testing and TDD. Benefits of unit testing include making code easier to maintain and understand through automated testing. TDD helps with understanding problems and designing code with test coverage. The document emphasizes the importance of writing good, trustworthy, and maintainable unit tests.
Test-driven development (TDD) is a process where test cases are created to validate requirements before functional code is written. The primary goals of TDD are to help specify requirements and design and to produce clean, bug-free code through a short development cycle of writing tests then code to pass those tests. Good unit tests for TDD should run fast, isolate dependencies, clearly define their scope, not require special setup, and clearly indicate their intention. In Golang, the testing package and go test command provide tools for writing and running tests, and go test can measure test coverage.
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
Breaking free from static abuse in test automation frameworks and using Sprin...Abhijeet Vaikar
油
The document discusses avoiding abuse of static methods in test automation frameworks. It provides examples of issues with static methods like concurrency problems and mutable state. It recommends using object-oriented principles and dependency injection frameworks instead. Dependency injection allows injecting dependencies into objects rather than hardcoding them, improving test isolation, readability and maintainability. The document gives examples of implementing dependency injection with Spring by using annotations like @Autowired and @Component. It also provides references for more information on inversion of control, dependency injection and static methods.
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.
This document provides an overview of MongoDB administration commands and CRUD operations. It discusses how to select databases, show collections, import/export data, and perform basic CRUD operations like insert, find, update, and remove in MongoDB. It also covers additional find methods like logical operators, array operations, and accessing embedded documents. Methods for updating include $set, $inc, $unset, and multi updates.
MongoDB is a non-relational database that stores data in JSON-like documents with dynamic schemas. It features flexibility with JSON documents that map to programming languages, power through indexing and queries, and horizontal scaling. The document explains that MongoDB uses JSON and BSON formats to store data, has no fixed schema so fields can evolve freely, and demonstrates working with the mongo shell and RoboMongo GUI.
These are training slides created by me to conduct training and knowledge sharing sessions for beginners in Cognizant Technology Solutions for Selenium Automation.
iTop VPN Latest Version 2025 Crack Free Downloadlr74xqnvuf
油
Click this link to download NOW : https://shorturl.at/zvrcM
iTop VPN Latest Version 2025 Crack is a popular VPN (Virtual Private Network) service that offers privacy, security, and anonymity for users on the internet. It provides users with a way to protect their online activities from surveillance, bypass geo-restrictions, and enhance their security while browsing the web.
Discover how AI-powered chatbots enhance employee support by streamlining HR tasks, reducing administrative burdens, and providing real-time assistance. Learn about their integration with platforms like WhatsApp and MS Teams for a seamless experience.
In 2025, AI-powered cyber threats are growing, but so are AI-driven security measures! Heres how were fighting back:
AI-Powered Fraud Detection Spot & stop attacks in real-time
Behavioral Biometrics AI learns user behavior & detects anomalies
Adaptive Security Models Auto-adjust security levels based on risk
AI-Powered Encryption Data stays safe, even in transit
At iProgrammer, we build intelligent, AI-driven security solutions to keep your app one step ahead of cyber threats!
How secure is your app? Lets talk!
https://www.iprogrammer.com/mobile-app-development-service/
Adobe InDesign Crack Full Version Free Download 2025sannnasaba545
油
艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Free download Adobe InDesign CC Pre-activated offline installer for Windows PC. It has everything you need to make posters, books, digital magazines, eBooks, interactive PDFs, etc.
OutSystems User Group Utrecht February 2025.pdfmail496323
油
We'll first explore how to Transition from O11 to ODC with Solange Ferreira (OutSystems). After that, Remco Dekkinga (Evergreen IT) will jump into Troubleshooting.
¥ 艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Wondershare Filmora 14.3.2 Crack is an excellent software for video editing. It is beneficial in perfect video editing with industry standards.
Why Hire Python Developers? Key Benefits for Your BusinessMypcot Infotech
油
Python developers bring expertise in building scalable, secure, and high-performance applications. They enhance productivity with clean, efficient code, ensuring faster development and seamless integration. With strong community support and versatility across industries, they drive innovation and cost-effective solutions. Boost your business growthhire Python developers today!
For more information please visit here https://www.mypcot.com/hire-python-developer
Metaverse Meetup: Explore Mulesoft MAC ProjectGiulioPicchi
油
Ever heard of AI? We have! Espacially Andrea Canale, an Integration Architect ready to shed light on The MAC Project: an open-source initiative for integrating AI with MuleSoft. He'll show its key features and learn how to leverage AI capabilities to drive automation and enhance decision-making.
A Brief Introduction About Raman BhaumikRaman Bhaumik
油
Raman Bhaumik is a driven Junior Software Developer with over three years of experience crafting efficient web applications. With expertise in Java, Python, JavaScript, SQL, and frameworks like React, Django, and Node.js, Raman is dedicated to improving system performance. She is passionate about mentoring young developers through coding workshops.
How John started to like TDD (instead of hating it) - TED talkNacho Cougil
油
John, a typical developer, used to dread writing tests, finding them boring and unnecessary. Test Driven Development (TDD)? Even worsehe couldnt see how it worked outside of basic exercises. But something clicked. Through his journey, John discovered the magic of writing tests before the production code: fewer bugs, quicker feedback, and cleaner code. Now, hes hooked and wont code any other way. This is the story of how TDD turned a skeptic into a believer.
PS: Think of John as a random person, as if he was even the speaker of this talk !
---
Presentation shared at Talent Arena '25
Feedback form:
http://tiny.cc/how-john-tdd-feedback
Examples of (bad) consequences of a lack of software quality and some solutions. This presentation presents some examples of (bad) consequences of a lack of software quality, in particular how poor software quality led to the direct deaths of 89 people. It then provides some background on software quality, especially the concept of Quality Without a Name. It then discusses many principles, their usefulness, and their positive consequences on software quality. Some of these principles are well-known in object-oriented programming while many others are taken from the book 97 Programmers. They include: abstraction, encapsulation, inheritance, types, polymorphism, SOLID, GRASP, YAGNI, KISS, DRY, Do Not Reinvent the Wheel, Law of Demeter, Beware of Assumptions, Deletable Code, coding with reason, and functional programming. They pertain to dependencies, domains, and tools. Concrete application on a real-world software systems, with examples and discussions.
(In details: Beautify is Simplicity, The Boy Scout Rule, You Gotta Care About the Code, The Longevity of Interim Solutions, Beware the Share, Encapsulate Behaviour not Just State, Single Responsibility Principle, WET Dilutes Performance Bottlenecks, Convenience Is Not an -ility, Code in the Language of the Domain, Comment Only What the Code Cannot Say, Distinguish Business Exception from Technical, Prefer Domain-specific Types to Primitive Types, Automate Your Coding Standards, Code Layout Matters, Before You Refactor, Improve Code by Removing It, Put the Mouse Down and Step Away from the Keyboard)
艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Free Download Adobe Illustrator CC Pre-Activated Offline Installer + Portable for Windows PC. The industry-standard vector graphics software lets you create logos, icons, drawings, typography, and illustrations for print, web, video, and mobile.
Advance Website Helpdesk Customer Support Ticket Management OdooAagam infotech
油
Effortlessly manage tickets via email, admin, or website forms, and take advantage of features like merging, reopening, and assigning by type. Create orders and invoices directly from tickets, send updates via WhatsApp, and track progress with timesheetseverything you need, all in one place.
Get the App here : https://bit.ly/4fJjGm8
Key features of advanced website helpdesk odoo module :
Dashboard For Tickets Tracking
Helpdesk Tickets List
Helpdesk Tickets Filter
advanced helpdesk SLA Policy
Assign Tickets Via Ticket Type, Team
Helpdesk Multi language support
And more.....
Just visit our app link and explore more new interesting features of Advanced website helpdesk odoo module
App download now :
Odoo 18 : https://bit.ly/4fJjGm8
Odoo 17 : https://bit.ly/3tEBcWg
Odoo 16 : https://bit.ly/3FEH6K6
Odoo 15 : https://bit.ly/3yTpJ4H
Odoo 14 : https://bit.ly/3ywuIbj
Odoo 13 : https://bit.ly/3rIXMZ8
Ask us for free Demo ? business@aagaminfotech.com
Want to discuss: http://www.aagaminfotech.com
Explore more odoo Apps: https://bit.ly/3y02ofI
AI/ML Infra Meetup | How Uber Optimizes LLM Training and FinetuneAlluxio, Inc.
油
AI/ML Infra Meetup
Mar. 06, 2025
Organized by Alluxio
For more Alluxio Events: https://www.alluxio.io/events/
Speaker:
- Chongxiao Cao (Senior SWE @ Uber)
Chongxiao Cao from Uber's Michelangelo training team shared valuable insights into Uber's approach to optimizing LLM training and fine-tuning workflows.
ElasticSearch Course that goes from the basic and quickly dives deep in the most important topics to build efficient cluster: model data, search quicly, aggregate and process data, distribute and manage data as well as cluster management.
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Shubham Joshi
油
Software test automation is transforming the way teams ensure product quality, making testing faster, more efficient, and highly reliable. This guide covers everything from the basics to advanced concepts, helping both beginners and experts optimize their testing processes. Youll explore various automation tools, frameworks, and best practices to improve test accuracy and speed up development cycles. With software test automation, organizations can minimize manual effort while enhancing test coverage. Whether you're just starting out or refining your existing automation strategies, this guide provides actionable insights and real-world examples to help you achieve success in automated testing.
Click this link to download NOW : https://shorturl.at/zvrcM
LDPlayer 9.1.20 Latest crack is a powerful and user-friendly Android emulator that offers great performance and features for both casual users and gamers. With high performance, multi-instance support, customizable controls, and strong compatibility with Android apps and games, It is an excellent choice for anyone looking to run Android software on a PC.
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.
5. What well 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:
Veri鍖es 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
speci鍖c 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 鍖guring 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 鍖rst 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 con鍖dence.
17. Code coverage metrics
Code coverage = (number of lines of code veri鍖ed by tests / total number of lines of code) * 100
A clearer formula = (number of lines of code veri鍖ed 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).
Its 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. E鍖ective 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 鍖gure 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 鍖rst 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 frameworks 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 codes 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
Con鍖guration
handlers
All classes that
support correct
functioning of the
test framework
Page Objects
Test classes /
Feature 鍖les / Test
specs
Reporting handlers
Write unit tests
Dont write unit
tests
A test framework is also a software product
used by engineers.
23. FAQs
Q: Do unit tests 鍖nd bugs?
A: Yes they do especially the obvious ones (provided they are written in the 鍖rst 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, its extremely important to
perform integration and end-end tests. We should not expect unit tests to 鍖nd 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.