{"id":21644546,"url":"https://github.com/samsung/mimic","last_synced_at":"2025-10-11T01:44:38.483Z","repository":{"id":24303258,"uuid":"27698774","full_name":"Samsung/mimic","owner":"Samsung","description":"Synthesizer for JavaScript API models ","archived":false,"fork":false,"pushed_at":"2023-04-07T10:37:49.000Z","size":810,"stargazers_count":17,"open_issues_count":1,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T18:25:32.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samsung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-12-08T05:11:21.000Z","updated_at":"2023-08-27T10:20:36.000Z","dependencies_parsed_at":"2025-04-11T18:25:33.320Z","dependency_job_id":"608e4f3a-1e8e-4427-a8c7-d21ff222c602","html_url":"https://github.com/Samsung/mimic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Samsung/mimic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samsung%2Fmimic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samsung%2Fmimic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samsung%2Fmimic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samsung%2Fmimic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samsung","download_url":"https://codeload.github.com/Samsung/mimic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samsung%2Fmimic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005939,"owners_count":26083986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T05:40:50.618Z","updated_at":"2025-10-11T01:44:38.454Z","avatar_url":"https://github.com/Samsung.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mimic: Computing Models for Opaque Code\n\nMimic is a research prototype to automatically compute models for JavaScript functions whose source code is not available or not easily processed by automatic tools.  Our research paper at the ACM SIGSOFT Symposium on the Foundations of Software Engineering 2015 conference gives some more details, and is freely available:\n\n- [Mimic: Computing Models for Opaque Code](http://stefanheule.com/publications/fse15-mimic/).\n\n## Installation\n\nThis project requires `node`, its package manager `npm`, as well as `grunt` to run.  It also requires `python` and `make`.  Make sure they are installed first (Ubuntu and alike):\n\n    sudo apt-get install nodejs-legacy npm make\n    sudo npm install -g grunt-cli\n\nThen, install all dependencies via `npm`:\n\n    npm install\n\nFinally build the project:\n\n    make\n\nYou may want to make sure that all tests pass to verify the build by running `make test`.\n\nNote: We have mostly tried running this prototype on Ubuntu.  A quick test on OS X seemed to have trouble installing some of the dependencies.\n\n## Usage\n\nTo run the model synthesis, the script `mimic` can be used.  It's usage is as follows:\n\n    \u003e ./mimic --help\n    usage: run.py [-h] [-t \u003cn\u003e] --function \u003cbody\u003e --arguments \u003carglist\u003e\n                  [\u003carglist\u003e ...] [--argnames \u003cnames\u003e] [--args \u003cargs\u003e]\n                  [--metric \u003cm\u003e] [--out OUT] [--nocolor] [--debug]\n                  [--parallel_t0 \u003ct0\u003e] [--parallel_f \u003cf\u003e]\n\n    Run Mimic to compute models for opaque code\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -t \u003cn\u003e, --threads \u003cn\u003e\n                            Number of threads (-1 = 1/2 of cores available)\n                            (default: -1)\n      --function \u003cbody\u003e     The function body of the opaque code (as JavaScript\n                            source code) (default: None)\n      --arguments \u003carglist\u003e [\u003carglist\u003e ...]\n                            One (or more) initial inputs to the opaque code as a\n                            comma-separated list (default: None)\n      --argnames \u003cnames\u003e    The name of the arguments (default: arg0, arg1, arg2,\n                            arg3, arg4, arg5, arg6)\n      --args \u003cargs\u003e         Arguments to be passed to mimic-core (default: )\n      --metric \u003cm\u003e          The metric to use (0 for default, 1 for naive metric)\n                            (default: 0)\n      --out OUT             Location where the resulting function should be\n                            written to (default: result.js)\n      --nocolor             Don't use any color in the output (default: False)\n      --debug               Output debug information, and only do a single run of\n                            mimic-core (default: False)\n      --parallel_t0 \u003ct0\u003e    The timeout to be used in the first phase (default: 3)\n      --parallel_f \u003cf\u003e      The factor with which to increase the timeout (based\n                            on a single thread, and scaled appropriately for more\n                            threads) (default: 1.025)\n\nAs an example, the following command synthesizes code for the identify function:\n\n    ./mimic --function \"return x\" --argnames \"x\" --arguments \"1\" \"2\"\n\nMimic works by running multiple instances of `mimic-core` internally, each with a different random seed, and stops as soon as one of them succeeds.  To understand the tool a little better, it is possible to run `mimic` with the option `--debug`, which will only launch a single copy of `mimic-core`, and output various information along the way.  For example:\n\n    ./mimic --function \"return x\" --argnames \"x\" --arguments \"1\" \"2\" --debug\n\nIt is also possible to run `mimic-core` directly.  Furthermore, we have collected a few examples from the array standard library, and the script `scripts/example.py` can be used to conveniently access them.  For instance, the following command synthesizes a JavaScript model for the Array.prototype.pop function:\n\n    scripts/example.py pop\n\nFinally, there are two more useful scripts included: `scripts/experiment.py` repeats runs of mimic for all examples and gathers statistics.  The script `scripts/process.py` can then be used to analyze that information.  Pass `--help` to them to get more information on how to use them.\n\n## Tests\n\nTests are written using mocha, and can be run by the following command:\n\n    make test\n\nLicense\n-------\n\nThe model synthesis code is distributed under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsung%2Fmimic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamsung%2Fmimic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsung%2Fmimic/lists"}