ASP.NET Core Testing Mini Course

Software testing

Software Testing in ASP NET Core

Unit testing in ASP NET Core

Test Driven Development

Requirements

  • Programming basics

Description

ASP.NET Core Testing Tutorial – learn about testing software and writing unit tests for an ASP.NET Core Web API.

The technologies used are:

• ASP.NET Core Web API

• xUnit

The IDE used is Visual Studio 2022 preview.

The .NET version is .NET 6.

So I’m Ruben and it’s my goal to help people learn software development with C# and .NET and I do that by creating educational content about it.

I have taken a lot of online programming courses myself and while taking them I often had ideas on how I’d communicate the things they’re teaching differently.

I bundled all those ideas I had and implemented them in this course. One of them is seeing the teacher’s face. I learn better when I see a teacher’s face, so I’ll actually show my face in all the lectures. Second, I am going to write out all the code that matters, so no annoying copy pasting of important logic and third no annoying “I have made some progress off camera.”. There won’t be any gaps I’ve done off camera between lectures.

The best learning strategy I have personally found (having been in the IT field for 7 years now as a student, employee and entrepreneur) is to learn some theory and then putting that into practice as soon as possible. This really cements the new information into my brain. So I teach people using this same strategy.

This way of teaching allows my students to get a lot of value from my courses and the people paying for your skills will notice you’ll have a deep understanding of your stack. This will lead to you growing faster in your career, which in turn allows you to earn more money.

Who this course is for:

  • Software developers that want to learn more about testing, examples are shown in ASP .NET.

Course content

1 section • 6 lectures • 1h 2m total length

Main6 lectures • 1hr 3min

  • ASP.NET Core Testing Mini Course32:33
  • RESOURCES MENTIONED00:13
  • Why Learn C#, ASP.NET And Blazor?05:17
  • What are Entity Framework Core and SQLite?03:14
  • How To Debug Your Applications in Visual Studio13:17
  • Agile SCRUM software Development07:59

Introduction to Unit Testing

Course Goal: Learn the basis of unit testing and test driven development

Test Driven Development

Unit Testing with Jasmine

Requirements

  • Introduction to HTML
  • Introduction to JavaScript Development
  • Intermediate JavaScript Development

Description

Testing and debugging are places where developers spend a lot of their time. Code doesn’t always perform as expected and, with complex applications, it’s very easy to break code with minor changes. Unit tests and test-driven-development exist to help us manage expectations of our functionality and to ensure that other developers working on our code are aware when a change they made affects already existing functionality. This is very important when working on large projects with many collaborators as well as small projects with few developers.

We’ll be pre-writing tests in code that we can run whenever we make updates to our application. This will ensure that no new logic breaks old logic, and that we are certain that our programs are executing properly when given different inputs.

Course Includes:

  • 11 videos with over 90 minutes of lectures and explanations.
  • 1 external resource file.
  • 4 exercises to help you master testing concepts.

What You’ll Learn:

  • What is Unit Testing?
  • Test driven development
  • Using Assert
  • Jasmine testing framework
  • Additional Resources
  • Exercises
  • And More!

Who this course is for:

  • Anyone who wants to become familiar with unit testing and test driven development concepts
  • Intermediate JavaScript Developers
  • Advanced JavaScript Developers

Course content

7 sections • 11 lectures • 1h 25m total lengthExpand all sections

Introduction1 lecture • 1min

  • Introduction00:37

What is Unit Testing?2 lectures • 4min

  • What is Unit Testing?02:45
  • Test Driven Development01:35

Assert1 lecture • 9min

  • Example Assert Function08:31

Jasmine testing framework1 lecture • 11min

  • Introduction to Jasmine10:30

Additional Resources4 lectures • 1hr

  • Bonus Part 1: Describing Unit Testing To Students at RefactorU16:18
  • Bonus Part 2: Describing Unit Testing To Students at RefactorU11:57
  • Bonus Part 3: Describing Unit Testing To Students at RefactorU19:18
  • Bonus Part 4: Describing Unit Testing To Students at RefactorU12:43

Excercises1 lecture • 0min

  • Exercises1 page

Conclusion1 lecture • 1min

  • Course Conclusion00:40

Best Practical Java TDD(Test Driven Development)with JUnit 5

Fully understand Java TDD(Test Driven Development)

Fully understand TDD Three Phases(Red-Green-Refactor) workflow

Hands-on Arithmetic Expression Implementation

Fully understand Java Stack Data Structure

Requirements

  • Java Development Experiences
  • JUnit 5 Experiences
  • Apache Maven

Description

This course is a TDD best practical tutorial, i will tutorial the TDD concepts at the second section by high level and details explain development work flow. TDD provides several benefits:

  1. It can enable faster innovation and continuous delivery because the code is robust.
  2. It makes your code flexible and extensible. The code can be refactored or moved with minimal risk of breaking code.
  3. The tests themselves were tested. A key characteristic of a test is that it can fail, and the development team verifies that each new test fails.
  4. The code that is  designed easy to test.
  5. The requirements are implemented with little to no wasted effort because only the function that will be implement.

At the third and fourth section we implement the arithmatic expression by three version

  1. string textual split
  2. regular expression
  3. Stack with infix to postfix and then evaluate

finally we will implement the result of: (13 + 4) * 2 + 3^2 = ?

Test Driven Development (TDD) is software development approach in which test cases are developed to specify and validate what the code will do.

Test-Driven Development starts with designing and developing tests for every small functionality of an application.

TDD rooted in extreme programming(XP), and is one of the best pracitice of  Agile methodology.

Who this course is for:

  • Java Developer
  • Java Develop Engineer
  • Scala/Koltin/Clojure Develop Engineer

Course content

5 sections • 19 lectures • 1h 42m total lengthExpand all sections

Introduction1 lecture • 2min

  • Course Introduction01:47

TDD(Test Driven Development) Introduction3 lectures • 8min

  • What is TDD?01:16
  • Red-Green-Refactor phase introduction02:58
  • TDD development workflow explanation03:29

TDD Practice Arithmetic Expression (Regular Expression) Version 1,26 lectures • 39min

  • Arithmetic Expression API Skeleton design03:23
  • Develop unit test code(Red Phase)05:01
  • Develop SimpleExpression let unit testing pass(Green Phase)05:40
  • Rethink the source code and test code(Refactor)10:12
  • Append more test cases re-enter Red Phase05:04
  • Enhancement source code let unit testing pass(Green Phase)09:51

TDD Practice Arithmetic Expression(Stack & Postfix)Version 38 lectures • 54min

  • Append new more complex requirements re-enter Red Phase02:30
  • Implement Stack<T> data structure08:19
  • Infix to Postfix algorithm detailed explanation09:13
  • Infix to Postfix algorithm implementation11:15
  • Infix to Postfix algorithm implementation simple validation03:15
  • Postfix expression algorithm detailed explanation05:40
  • Postfix expression algorithm implementation08:58
  • Execution test cases verify complex arithmetic expression function04:26

Appendix1 lecture • 1min

  • Course source code and ppt00:02

Introduction to Unit Testing in C#

Understand how to create and run unit tests for a library in C#

Learn how to apply unit tests to a test driven development process

Gain knowledge on what to test and what NOT to test

Hands-on lab – create unit tests and apply them to a project

Requirements

  • Some programming experience. Understand the basic of creating and assigning variables and using logic comparisons
  • Able to use Visual Studio (Community or Code – free to install and use!).
  • Able to create simple methods in C# – understanding of flow control (if-else, while, for, foreach) and assignment of values to variables.

Description

Through the use of hands-on work, you will learn how to create and work with unit tests in C# using the Visual Studio integrated development environment. Get professional tips on creating, debugging, and improving your tests in a practical way.

The introduction uses a two iteration cycle to create unit tests that address the product code as it is being developed, giving you the basis for not only creating and improving your unit testing ability, but also pointing the way towards exercising these new concepts in BDD (Business/Behavior Driven Development) or TDD (Test Driven Development).

We do more than just talk about how to do this, we provide step-by-step labs detailing how to create your automation and how to improve it as we progress.

For this course, starter code projects are supplied, as well as finished projects you can adapt to fit your needs, or use for reference for further projects.

This course is designed this to help those who want to expand their capabilities in creating software test automation.

Whether you are a student, a manual tester, or are already a software test professional, this course can help you become more effective in your role.

Start your journey towards effective unit testing today!

Who this course is for:

  • Beginning software professionals looking to increase their skillsets
  • Software professionals who want to learn about unit tests and Test Driven Development

Course content

4 sections • 5 lectures • 32m total lengthExpand all sections

Introduction2 lectures • 5min

  • Introduction00:20
  • Setting Up04:55

Unit Testing, Iteration 11 lecture • 10min

  • Unit Testing, Iteration 110:06

Unit Testing, Iteration 21 lecture • 12min

  • Unit Testing, Iteration 212:10

Wrapping up1 lecture • 5min

  • Wrapping Up05:17

Test and Behavior Driven Development (TDD/BDD)

This course provides the fundamentals of Test Driven Development (TDD) and Behavior Driven Development (BDD), and why it’s essential for building quality applications and preventing bugs, reducing development costs and improving performance.

About this course

Testing is one of the most critical processes of the Software Development Lifecycle (SDLC) and often contributes to preventing bugs, reducing development costs, and improving performance. Two of the best methods for testing software are Test Driven Development (TDD) and Behavior Driven Development (BDD). TDD tests individual units of code while BDD tests how these units work together.

This course introduces you to the fundamentals of both TDD and BDD, You’ll discover what automated testing is and why it is essential for building robust applications resilient to failure. You’ll explore the basics of testing, including test cases, testing levels, the traditional release cycle, and the benefits, concepts and popular tools involved.

This course provides multiple real-world inspired hands-on labs to demonstrate your skills with TDD and BDD. You’ll create TDD test cases by writing test assertions and building test fixtures, and you’ll run these test cases using the Nose testing package. You’ll practice more advanced TDD methods, such as increasing code coverage, generating and using fake data, and testing mock objects. You’ll also practice setting up a BDD environment using Behave, write the feature and step files, test a web interface using Selenium, and load sample data for testing.

By the end of the course you will have the knowledge and skills to perform test driven development (TDD) and behavior driven development (BDD) testing and understand when to apply these development techniques.

At a glance

  • Institution: IBM
  • Subject: Computer Science
  • Level: Intermediate
  • Prerequisites:This course is suitable for those with basic computer and IT literacy, and those looking to increase their current knowledge of software engineering.
  • Associated programs:
    • Professional Certificate in DevOps and Software Engineering Professional Certificate
  • Language: English
  • Video Transcript: English
  • Associated skills: Test-Driven Development (TDD), Resilience, Systems Development Life Cycle, Behavior-Driven Development, Software Development Life Cycle, Test Automation, Code Coverage, Software Release Life Cycle, Selenium (Software)

What you’ll learn

  • Explain the importance of testing.
  • Describe test-driven development (TDD) and explain its benefits for DevOps.
  • Develop unit tests with test assertions and test fixtures and then run the tests.
  • Improve unit testing through advanced TDD methods including coverage reports, factories, fakes, and mock objects.
  • Summarize the steps in a typical BDD workflow.
  • Describe popular BDD tools and their benefits.
  • Conduct BDD tests using Honcho and Behave.

Syllabus

Module 1: Introduction to Testing

  • The Importance of Testing
  • Why Developers Don’t Test
  • Testing Levels and Release Cycle
  • TDD and BDD
  • Testing Case Study

Module 2: Introduction to Test Driven Development

  • Benefits of Test Driven Development
  • Tools for TDD
  • Running Tests with Nose
  • Running Tests with Nose Demo
  • Hands-on Lab: Running Tests with Nose
  • Anatomy of a Test Case
  • Writing Test Assertions
  • Writing Test Assertions Demo
  • Hands-on Lab: Writing Test Assertions
  • Test Fixtures
  • Creating Initial State Using Test Fixtures Demo
  • Hands-on Lab: Creating an Initial State Using Test Fixtures

Module 3: Advanced Methods for Test Driven Development

  • Test Coverage
  • Running Test Cases with Coverage Demo
  • Hands-on Lab: Running Test Cases with Coverage
  • Factories and Fakes
  • Factories and Fakes Demo
  • Hands-on Lab: Using Factories and Fakes
  • Mocking
  • Mocking with Patch
  • Mocking with Mock Objects
  • Mocking with Mock Objects Demo
  • Hands-on Lab: Mocking Objects
  • Practicing Test Driven Development
  • Practicing Test Driven Development Demo
  • Hands-On Lab: Practicing Test Driven Development

Module 4: Introduction to Behavior-Driven Development

  • What is Behavior Driven Development
  • Benefits of BDD
  • BDD Workflow and Gherkin Syntax
  • Example of BDD
  • Tools for Behavior Driven Development
  • Overview of Behave
  • Environment Setup
  • Environment Setup Demo
  • Hands-on Lab: Setting up an Environment
  • Writing Feature Files
  • Writing Feature Files Demo
  • Hands-on Lab: Writing Feature Files
  • Selenium
  • UI Considerations
  • Writing Step Files
  • Writing Step Files Demo
  • Hands-on Lab: Writing Step Files
  • Loading Test Data with Behave
  • Loading Test Data with Behave Demo
  • Hands-on Lab: Loading Test Data with Behave

Module 5: Running Behave for Behavior Driven Development

  • Generating Steps with Behave
  • Generating Steps with Behave Demo
  • Hands-on Lab: Generating Steps with Behave
  • Implementing Your First Steps
  • Implementing Your First Steps Demo
  • Hands-on Lab: Implementing Your First Steps
  • Working with the Context
  • Working with the Context Demo
  • Hands-on Lab: Working with the Context
  • Using Variable Substitution
  • Using Variable Substitution Demo
  • Hands-on Lab: Using Variable Substitution
  • BDD in Practice

Module 6: Final Project

Introduction to Test Driven Development (TDD)

About this Course

Successful developers need to not only build the right software but build it right. To know your software works correctly, you need to test each unit of code. One of the best methods for this unit-level testing is test driven development.

This course provides a detailed overview of test driven development (TDD). First, you’ll learn what automated testing is and why it is essential for building robust applications resilient to failure. You’ll explore the basics of testing, including test cases, testing levels, and the traditional release cycle. You’ll learn about TDD and its complement, behavior driven development (BDD): TDD tests individual units of code while BDD tests how these units work together. Then you’ll examine TDD in detail. You’ll explore TDD’s benefits, concepts, and popular tools, and you’ll hone your new testing skills through hands-on labs. You’ll create TDD test cases by writing test assertions and building test fixtures, and you’ll run these test cases by using the Nose testing package. You’ll then practice more advanced TDD methods such as increasing code coverage, generating and using fake data, and testing mock objects.

This course is part of multiple programs

This course can be applied to multiple Specializations or Professional Certificates programs. Completing this course will count towards your learning in any of the following programs:

  • IBM DevOps and Software Engineering Professional Certificate
  • IBM Applied DevOps Engineering Professional Certificate

WHAT YOU WILL LEARN

  • Explain the importance of testing 
  • Describe test-driven development (TDD) and explain its benefits for DevOps
  • Develop unit tests with test assertions and test fixtures and then run the tests
  • Improve unit testing through advanced TDD methods including coverage reports, factories, fakes, and mock objects

SKILLS YOU WILL GAIN

  • Test Case
  • Software Testing
  • Behavior-Driven Development
  • Automated Testing
  • Test-Driven Development

Syllabus – What you will learn from this course

WEEK1

1 hour to complete

Introduction to Testing

This module provides an overview of software testing. You will learn about the importance of testing through an example: the development of the Apollo 11 Lunar Module’s guidance system. You will discover the numerous problems that occur when developers do not test their code. Then you will explore the four levels of testing and find out when each appears in the traditional release cycle. You will learn what test driven and behavior driven development are and why both are essential for effective testing. You will discover the purpose of test cases and witness their value through a demonstration.

6 videos

  • Course Introduction3m
  • The Importance of Testing8m
  • Why Developers Don’t Test 3m
  • Testing Levels and Release Cycle5m
  • TDD and BDD4m
  • Testing Case Study8m

2 readings

  • Course Introduction2m
  • Summary & Highlights 2m

2 practice exercises

  • Practice Quiz: Introduction to Testing15m
  • Graded Quiz: Introduction to Testing30m

WEEK2

4 hours to complete

Introduction to Test Driven Development

This module provides an overview of test driven development (TDD). You will learn what TDD is and discover the three basic steps in the TDD workflow, also known as the Red/Green/Refactor workflow. You will find out why TDD is important for DevOps and all automated testing. You will also discover popular testing tools for TDD and closely examine the features of several such tools for Python. This module also covers essential methods for performing TDD. You will explore two ways to run TDD tests: Python’s built-in test runner called unittest and the more feature-rich module called Nose. You will learn what assertions are and how to use them to test code. You will discover why you need to include both happy and sad paths in your test module. You will also find out what test fixtures are and how to use them to establish an appropriate initial state for each test.

9 videos

  • Benefits of Test Driven Development4m
  • Tools for TDD 4m
  • Running Tests with Nose3m
  • Running Tests with Nose Demo 8m
  • Anatomy of a Test Case7m
  • Writing Test Assertions 8m
  • Writing Test Assertions Demo13m
  • Test Fixtures7m
  • Creating Initial State Using Test Fixtures Demo 15m

2 readings

  • Summary & Highlights2m
  • Summary & Highlights 2m

3 practice exercises

  • Practice Quiz: Introduction to Test Driven Development15m
  • Practice Quiz: Methods for Test Driven Development21m
  • Graded Quiz: Methods for Test Driven Development30m

WEEK3

5 hours to complete

Advanced Methods for Test Driven Development

This module covers advanced methods for TDD. You will learn about test coverage: why it’s important, how to increase it by using test coverage reports, and why you should keep testing even at full test coverage. You will discover the value of testing against fake data and how to use factories to generate this data. You will also explore mocking, a process for mimicking the behavior of real objects, and you will find out the testing situations for which mocking is useful. You will learn how to use two common methods for mocking: patching a function call and mocking entire objects.

10 videos

  • Test Coverage 7m
  • Running Test Cases with Coverage Demo 18m
  • Factories and Fakes9m
  • Factories and Fakes Demo 17m
  • Mocking 4m
  • Mocking with Patch9m
  • Mocking with Mock Objects9m
  • Mocking with Mock Objects Demo16m
  • Practicing Test Driven Development5m
  • Practicing Test Driven Development Demo15m

1 reading

Summary & Highlights2m

2 practice exercises

  • Practice Quiz: Advanced Methods for Test Driven Development15m
  • Graded Quiz: Advanced Methods for Test Driven Development30m

WEEK4

1 hour to complete

Final Exam and Course Wrap-Up

2 readings

  • Congratulations & Next Steps3m
  • Team & Acknowledgements1m

1 practice exercise

Final Exam45m