In the preceding section, we explored how unit testing can be leveraged as a means to achieve code correctness. This involved compiling our TypeScript and executing it against a test framework to find hidden bugs in our implementation.
What if there was a way to do some sort of sanity check on our code even before executing it, even before compiling it? Well great news, there certainly is a way to achieve this, and most real-world projects have this sanity check performed as a part of their development process. Let's explore what this actually means.
Formally, this sanity check is known as Static Code Analysis, which essentially means performing analysis on the code statically without executing the code. This process analyzes the code syntax, its structure, and helps to ensure that it adheres to some benchmark standards we established.
This process ensures code readability and thereby maintainability. As you have learned, it makes the code easier for a newer...