Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed the Stryker Mutator and ran the default mutation test (Dynamic tool) #33

Open
wants to merge 5 commits into
base: f24
Choose a base branch
from

Conversation

HeidiTao
Copy link

@HeidiTao HeidiTao commented Oct 24, 2024

Followed the quick start guide for Stryker Mutator, a dynamic analysis tool that performs mutation tests.

Concrete evidence of tool installation

  1. Running npm init stryker in terminal:
P3A-npmInstallStryker
  1. Stryker in packag.json (file not part of this PR due to being in gitignore)
P3A-packageJsonStryker
  1. Config file generated after initialization
P3A-strykerConfig
  1. node_modules folder generated
    image

Artifacts that demonstrate tool running on repository

P3A-strykerRun

@HeidiTao HeidiTao self-assigned this Oct 24, 2024
@HeidiTao HeidiTao added the enhancement New feature or request label Oct 24, 2024
@coveralls
Copy link

coveralls commented Oct 24, 2024

Pull Request Test Coverage Report for Build 11494755977

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 82.667%

Files with Coverage Reduction New Missed Lines %
src/meta/errors.js 1 83.72%
Totals Coverage Status
Change from base Build 11492017180: 0.003%
Covered Lines: 22341
Relevant Lines: 25603

💛 - Coveralls

@HeidiTao
Copy link
Author

HeidiTao commented Oct 24, 2024

Commented out the illegal return line in file src/cli/index.js;
Re-ran Stryker test with the following output:

P3A-removedIllegalReturn

…itly ignoring files under the build directory
@HeidiTao
Copy link
Author

HeidiTao commented Oct 24, 2024

After ignoring the files under build, less files were being passed into the list of possible files being mutated.

New error is TypeError: Cannot set properties of undefined (setting 'require')
image

Copy link

@sherryzhuge1 sherryzhuge1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link

@John-Crawshaw John-Crawshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

@Victor-Crawshaw Victor-Crawshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link

@alx-zhu alx-zhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@HeidiTao
Copy link
Author

I've tried more edits in the config and error-reported files, but the npx stryker run command still returns errors. According to a TA at Office Hour, this PR is sufficient for checkpoint.

@HeidiTao
Copy link
Author

HeidiTao commented Nov 1, 2024

A few additional attempts were made to run Stryker without error.

  • From the undefined require error, I tried using import and export to replace the require function. However, since most of the NodeBB code still uses CommonJS which relies on require, I changed them back.
  • Since Stryker requires all unit tests to pass before it runs tests with its mutants, all the failed test cases are stopping Stryker's initial run to be successful. For example,
    image
    image
  • I am in the progress of manually commenting out the test cases that were reporting errors. Since the total number of test cases keeps increasing after failed ones are commented out, I am also simultaneously searching for other more efficient ways to solve this problem. (e.g., Mocha test run total number increased to 1682)
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants