Almost every development team is facing questions, like: How to enhance the quality of our code? How can I speed up the development process without having a degradation in the code quality?
It's important to understand: tests don't Improve quality, developers do.
Pre-work - Writing tests first give you a clearer view on your API design.
It makes you think of the special cases in your algorithm.
Do you as a developer understand the problem enough to articulate in code all critical component requirements ?
You cannot remember all features that need testing. After making a change to refactor as an example: add new features, remove features and so on...
Automatically prevent broken builds from being deployed to production by testing.
Client tests focus on testing the usability and responsiveness of an application, whereas the back-end unit testing frameworks, focus on testing business logic and other micro-services. You should test them both !
L0 - Broad class of fast in-memory unit tests. A L0 test is a unit test to most people. That is a test that depends on code in the assembly under test and nothing else.
L1 - A L1 test might require the assembly plus SQL or the file system.
L2 - Functional tests run against "testable" service deployment. It is a functional test category that requires a service deployment but may have key service dependencies stubbed out in some way.
L3 - This is a restricted class of integration tests that run against production. They require a full product deployment.
Other Types of Testing that I will not talk about it in this article are:
This terminology means that we want more L0/L1 tests compare to the L2/3 tests. We want more unit tests, easy to write, easy to maintain and less overhead.
Function coverage - Has each one of your functions in your program been called?
Statement coverage - Has each statement in the program been executed?
Branch coverage - Has each branch of each control structure, such as in 'if' and 'case' statements been executed? For example, given an 'if' statement, have both the true and false branches been executed?
Condition coverage - Has each Boolean sub-expression evaluated both to true and false?
Review the Most common Frameworks and testing environments (There are many more, focus on the common ones)
First you must distinguish between the Test Framework to the Runner environment itself.
is the default test runner for Angular applications. Karma includes the option to test the code on several browsers and even devices to ensure smooth operation of the code on the supported platforms.
WebDriver is the most widely accepted automation testing framework for web-applications, mainly for UI tests and for end to end tests.
framework dedicated to testing Angular applications. It is an end to end automation testing framework dedicated for testing your angular application on a real browser. It means that it is making automated interaction just like the real user.
builds on top of DOM Testing Library by adding APIs for working with React components. Comes to solve the problem while you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your test base to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down!
References & Links: