From the course: Advanced ASP.NET Core: Unit Testing

Application testing strategies - ASP.NET Core Tutorial

From the course: Advanced ASP.NET Core: Unit Testing

Start my 1-month free trial

Application testing strategies

- When we think about security in our Apps the first thing that comes to mind is Authentication and Authorization. So we make sure that we keep unauthorized users away from our app. And that's a great practice but there is more to building robust applications. There might also be authenticated users with good intentions that might break our app. But how is that possible? When we as developers write code, a lot of times we write code that does not take into consideration all the use cases. For example when creating forms, we assume that users will enter the right data, but it's common for the users to not use our apps the way we expect them to do. For example in a field where you expect them to write a positive number they might enter a negative one. All these unpredicted cases introduce Bugs to our apps and Buggy apps create angry customers and angry customers create a lot of headache and lower revenue. So what should we do to make sure that we develop stable apps and which are the core strategies for doing so. The Testing Pyramid or the Testing Triangle is a strategy guide for implementing software testing, which is a strategy used to make sure that our app works as expected before we deployed to production. In this Pyramid we have five levels starting from the bottom to the top. We start with Unit Testing a Unit Testing is testing a single unit of an application, a unit is the smallest testable part of any software. It usually has one or a few inputs and usually a single output. In Object Oriented Programming the smallest unit is a method. The next level is the Integration Test, integration test is a level of software testing where you divisional units are combined and tested as a group. The purpose of this level of testing is to expose fault in the interaction between integrated units. Here we can test if two classes or two modules interact as expected with each other. Acceptance Test is another level and the purpose of this test is to evaluate the system's compliance with the business requirements and assess whether it's acceptable for delivery. The purpose of acceptance tests is to evaluate the system's compliance with the business requirements and assess whether it's acceptable for delivering. The highest level of automated tests are the UI Tests, these tests actually drive the Web Browser in an automated fashion performing mouse clicks typing text and clicking links. The UI Tests are great to check if the app works as expected. So for example when the user clicks a link, When the user clicks on a button, when the user types a text etc, but the automated tests cannot tell you what the user experience of your website is like. That's why it's important to get a real variety of typical users to look at your website. And for that we have the Manual Tests, the problems that manual testers are able to find are different from the ones you will find using Unit Integration or any other tests.

Contents