When you write software, before you release it to the customer, hopefully it will undergo testing.
Kinds of tests
There’s a few kinds of testing that can be performed
- Manual testing - For example you have created a website. So you have the customer (or tester, or BA) walk through the software and test it to see if it will do what you need.
- Automated testing - Modern websites have some form of automated testing in place. For example, if you were writing an API, you might have a project whose purpose is to test that API. This might be used by the developer, or during a build process.
Automated testing comes in many flavors
Test Processes
I have heard of a vendor that has a process.
- When a bug is reported, duplicate that bug in the testing process.
- after the bug has been duplicated in the automated test process, fix the problem.
- Run the bug fix through the automated test process. If the bug still persists, then repeat from the last bullet.
Many programmers will setup a test project to test their code for changes.
Testing Programs
Common test programs include
- MSTest - this program is used to test API’s for other programmer interfaces. It’s a type of project commonly found in Visual Studio.
What do you test
One goal, is to setup automated testing to have 100 percent code coverage. Many people think this is not possible.
Some people will setup automated testing on the service layer.
Some people will setup automated testing on different layers. They make use of Mock objects. For example if you wanted to test the API layer, and the API counts on the Service layer, then one way to just test the API layer is to configure the test so that the Service Layer is running Mock objects. This is common in an environment where dependancy injection is used - which happens a lot with Asp.Net Core programming. The API layer probably is injected with a Service layer, so for testing, you create a mock service layer, and inject that instead.