Giter Club home page Giter Club logo

orsaada-sqe-workshop-2018-exercise-1's Introduction

Sample project

  • Use this project as a template.
  • Clone the project:
    • Using user/password: git clone https://github.com/aviram26/sqe-workshop-2018-sample-project.git
    • Using SSH key: git clone [email protected]:aviram26/sqe-workshop-2018-sample-project.git
  • Install all libraries run: npm install
  • For code parsing, this project uses the Esprima library.
    • See example usage in src/js/code-analyzer.js
  • Run the project:
    • From the command-line run: npm start
    • After the bundler is done, execute the index.html from your IDE (preferably WebStorm)
    • Try the parser...
  • For testing, this project uses the Mocha library.
    • From the command-line run: npm run test
    • See example test in test/code-analyzer.test.js
  • For coverage, this project uses the nyc library.
    • From the command-line run: npm run coverage
    • See the report file coverage/coverage-summary.json
  • For linting, this project uses the ESLint library.
    • From the command-line run: npm run lint
    • See the report file lint/eslint-report.json

I/O Example

The input:

function binarySearch(X, V, n){
    let low, high, mid;
    low = 0;
    high = n - 1;
    while (low <= high) {
        mid = (low + high)/2;
        if (X < V[mid])
            high = mid - 1;
        else if (X > V[mid])
            low = mid + 1;
        else
            return mid;
    }
    return -1;
}

Should produce:

Line Type Name Condition Value
1 function declaration binarySearch
1 variable declaration X
1 variable declaration V
... ... ... ... ...
2 variable declaration low null (or nothing)
... ... ... ... ...
3 assignment expression low 0
4 assignment expression high n - 1
5 while statement low <= high
... ... ... ... ...
7 if statement X < V[mid]
... ... ... ... ...
9 else if statement X > V[mid]
... ... ... ... ...
12 return statement mid

orsaada-sqe-workshop-2018-exercise-1's People

Contributors

aviram26 avatar

Stargazers

Or Saada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.