Skip to content

Instantly share code, notes, and snippets.

@hiba-machfej
Created May 9, 2024 08:52
Show Gist options
  • Save hiba-machfej/4445705bdeac1741930404d7ef863c6b to your computer and use it in GitHub Desktop.
Save hiba-machfej/4445705bdeac1741930404d7ef863c6b to your computer and use it in GitHub Desktop.

Discussion questions:

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?

@Dilan-Ahmed
Copy link

Dilan-Ahmed commented May 9, 2024

Dilan Ahmed | Aras Yousef | Barham Baper | Hanan Islam | Omar Sardar | Aland Rebwar

  1. Test Coverage is used in measuring how comprehensive or limited the source code is being tested already. in the result, it gives the percentage of code on which a test is being executed .
    The test coverage is important because of its usage we will be aware of areas in the source code that had not been covered in the test; therefore helps th e developers to concentrate on testing in the areas which in need to be tested .Also it is important for the quality testing as well as risk measurements and analytics related to the source code.

2)Aiming for getting 100% test score in testing a source code could be easily unrealstic goal . as there are many factors that avoid this kind of perfect scores so it is better to aim for a realistic practical score. it is better to aim for having great scores coming from critical aspects of the code base we have for example the functionalities , risk vulnerabilities, and other relative parts of the code which are important to deliver the main goal or purpose of the source code.

  1. the static analysis is more focused on analyzing the code we have without executing the code actually. it is more into checking the way the code is structured, predicted and possible vulnerabilities, and any other criteria of the code base. this analysis is performed during the early phase of development process. on the other hand we have unit testing which is more focues on testing the code base we have through executing the specific parts or units of the code respectively in different sections. moreover, its aim is to be the reference of the devolpers to verify the functionalitie and required performance of teh code that htey have.

  2. the static analysis can be done through having some common tools such as :
    ESLint is used for erorr detection in the code.
    JSHint is used for detecting and finding potential problems in JS code.
    JSLINT is one of the older tools yet still used widely in static analysis .
    FLOW is one of the tools and being developed by FACEBOOK which another ststic tool for finding early problems and issues we might have in the code base.

  3. Developers can easily enforce Static Analysis rules across their team projects through usinga tool like ESLint or Pylint which defines the standrads of the coode.

  4. CI/CD is Continuous Integration and Continuous Deployment which is a collection of practices sued in Software development inorder to automate the test creation and executeion with code demployment alterations .They are important for early detection of issues and problems in the code,. it also contribute in making the code be more consistent as having a consistent automated test will make sure to have a consistent code aswell

  5. both are tools that being helpful in enforcing CI/CD practices thorugh automation of tasks we hve in development and deployment. Husky is a Git Hook maanger that helps to run scripted codes automatically during any git events that we might have. Husky helps also in enforcing pre commit and pre push hooks to perform tasks such as runnting tests. on the other hand we have GitHub Actions which is more like a platform that we have for workflows automations in Github repos which allows develpers to customize the workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment