1- What is test coverage, and why is it important?
2- Should you do 100% test coverage? What should you consider while determining the right level of test coverage?
3- How does static analysis testing differ from unit testing?
4- What are some common tools used for static analysis testing in JavaScript?
5- How can developers enforce static analysis rules across their team projects?
6- What is CI/CD and why are automated testing and CI/CD important?
7- How can Husky and GitHub Actions help enforce CI/CD practices?
Jwan Kareem, Ali Izzaldin, Mardin Luqman, Mawj M.basheer, Halwest Abubakir
1- In simple terms, it is a technique to ensure that your tests are testing your code or how much of your code you exercised by running the test.
Eliminates_ defects at early stages, Removes redundant cases
2- 100% test coverage isn't always necessary. Consider:
Code criticality
Risk tolerance
Time/resources
Business requirements
Maintenance overhead
3- static analysis testing is a preventative measure that checks code for errors without executing it, while unit testing is a corrective measure that checks the functionality of individual units of code by executing them
4- ESLint is widely used for JavaScript static analysis, offering extensive rule customization. Standard JS is opinionated like Prettier but includes rules beyond styling. JSHint is similar to ESLint but with fewer rules and customization options. PMD is a linter for Java and Salesforce Apex. LGTM provides linting based on predetermined rules, but it's limited by what you define.
5-Developers can enforce static analysis rules across their team projects by integrating static analysis tools into their continuous integration (CI) pipelines. This ensures that code is automatically checked against predefined rules whenever changes are made or new code is added. Additionally, developers can establish coding standards and guidelines, use configuration files for static analysis tools, and regularly review code to ensure compliance with the defined rules. Training sessions and documentation can also help reinforce the importance of following static analysis rules within the team.
6-CI/CD (Continuous Integration/Continuous Deployment) is a set of best practices, principles, and tools used by software development teams to automate the process of building, testing, and deploying software. It offers several benefits
7- Husky sets up Git hooks for automating tasks like linting and testing. GitHub Actions automates workflows triggered by events like commits or pull requests, facilitating CI/CD pipelines directly within GitHub. Together, they enforce CI/CD practices, maintain code quality, and automate development workflows.