Luka
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Introduction This repo contains all the necessary files to obtain the groundtruth for the following dead code eliminations tools, [Muzeel](https://github.com/S2-group/Lacuna) and [UFFRemover](https://github.com/lkrumpak/UFFRemover). Additionally, you will find the necessary files to evaluate the performance of [Lacuna](https://github.com/S2-group/Lacuna), a dead code elimination tool, on a set of 39 web applications. These applications originate from the [TodoMVC project](https://todomvc.com/). However, the repository has not been updated for a few years, so we took the time to update the necessary dependencies to be able to execute the web applications on modern hardware (see Requirements Section). The LacunaV2 directory is a copy of Lacuna, while the LacunaV2-evaluator contains the files and scripts that execute Lacuna and generate performance metrics and statistics for Lacuna for each subject and across all subjects. # Requirements The following repo is a modified version of the original [Lacuna Evaluation](https://github.com/S2-group/Lacuna-evaluation). The purpose of this repo is to re-generate the ground truth and lacuna results using modern software and harware specifications: - node version: 18.12.1 - npm version: 8.19.2 - python: 3.10.9 - Hardware: Macbook pro (M1 chip), 16GB ram - Chrome: 108.0.0 # How it works The ground truth values of the todomvc project are gathered with the help of extensive test-cases and the [dynamic-deadfunction-detector](https://github.com/Kishanjay/dynamic-deadfunction-detector) repo; which automatically logs all alive functions. # Setup ## Install dependencies In a terminal, run the following command: ``` bash setup.sh ``` or ``` ./setup.sh ``` This script installs all required dependencies for this project ## Host the target web applications Now that all the dependencies of the target web applications have been installed, it is time to host them, before obtaining the groundtruth or executing Lacuna on the selectied web applications. To achieve this, run the following command within the todomvc folder: ``` gulp test-server ``` **_NOTE:_** We recommend runing the command in a seperate terminal or you can use something like [tmux](https://github.com/tmux/tmux). # Execution Lets get down to business. ## Step 1. Acquire the Ground Truth Values [OPTIONAL] **_NOTE:_** This step is optional as the values from the ground truth are already provided. The values can be found at `todomvc\examples.groundtruth` If you wish to acquire the ground truth values yourself, then first step is to instrument the examples with the following command: ``` node todomvc_instrumenter.js ``` Once the files are intrumented you will now see a new folder "examples.instrumented" within todomvc. In order to proceed we recommend renaming the original examples folder to "examples.original" becuase we now need to rename "examples.instrumented" to "examples". Once the folders have been renamed you may proceed. **_NOTE:_** To get the _alive_functions the following commands need to be run in seperate terminals or with tmux. In the "scripts" folder run: ``` node todomvc_instrumentation_server.js ``` And finally within the "todomvc/tests" folder run: ``` npm run test ``` **_NOTE:_** Running the tests ensure that all functions of the website are run. That being said this will a while and you wont be able to use your computer in the meantime, so now is the time to go grab a coffee! Also, in order to run the tests you must have chrome installed. Depending on the date of execution the chromedriver might need changing as this depends on the current version of chrome installed on your system ## Step 2. Normlise all the scripts that are tested In this step, a normalised version of each application is created, meaning no inline scripts and no externally hosted scripts exist after its execution. These new versions are stored in a new directory within the todomvc directory, called examples.normalised. To normalise the target applications, run the following command in the terminal: ``` node ./scripts/todomvc_lacuna_normalizer.js ``` This command assumes that the target web applciations exist one level above the directory in which this README is located. If this is not the case and you would like to adjust the path to the target subjects, you would need to adjust the *TODOMVC_DIR* value within *todomvc_lacuna_normalizer.js*. ## Step 3. Acquire the Lacuna analyser results In a terminal, run the following command: ``` python3 execute_lacuna.py ``` This script utilises the combination of the TAJS and dynamic analysers, available to Lacuna, to determine which functions are dead and alive. If this combination fails to produce results for any reason (or the process takes more than 30 minutes), then Lacuna is run on the current subject using only the dynamic analyser. When this scirpt completes, the Lacuna results for all, alive, and dead functions have been generated. For each subject, these results can be found in the *lacuna.log* file, located in the subject's top level directory (e.g. in "todomvc/examples.lacunized/ampersand/lacuna.log" for the ampersand subject). Additionally, any errors occured during the exeuction of the script are written in the *lacuna_execution_errors.csv* file. If no such file was produced, no errors were encountered during the operation of this step. ## Step 4. Performance metrics and statistics generation Once Lacuna has completed its execution on the target subjects, the performance metrics of precision, recall, and accuracy can be computed for each tool in this step. To get these metric values, along with descriptive statistcs for Lacuna across all subjects, run the following command: ``` python3 data.py ``` The results of this script can be found within the files *_statistics_.csv* and *_descriptive_stats_.csv*.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully