Skip to content

Commit 5c54088

Browse files
authored
docs: add readme to package and update readme text (#101)
1 parent f0d45ac commit 5c54088

File tree

5 files changed

+115
-54
lines changed

5 files changed

+115
-54
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ syntest/
1010
*.md
1111
LICENSE*
1212
Dockerfile
13+
NOTICE
1314

1415
# The instrumentation files are copied from istanbul (and modified).
1516
# In the future in a big refactor the instrumentation should be redone such that these files dont have to be ignored anymore.

README.md

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,12 @@ $ cd syntest-javascript; npm install
4646
$ cd syntest-javascript; npm run build
4747
```
4848

49-
## Local development
50-
51-
Currently you need to be on the `remove-parsing-from-framework` branch of the syntest-framework.
52-
53-
```bash
54-
cd <PATH_TO_SYNTEST_FRAMEWORK>; git checkout remove-parsing-from-framework; git pull
55-
```
56-
57-
Rebuild the framework
58-
59-
```bash
60-
cd <PATH_TO_SYNTEST_FRAMEWORK>; npm run build
61-
```
62-
63-
Now install the framework into syntest-javascript
64-
65-
```bash
66-
cd <PATH_TO_SYNTEST_JAVASCRIPT>; npm install --save <PATH_TO_SYNTEST_JAVASCRIPT>
67-
```
68-
69-
You can edit `.syntest.js` to change the way the tool behaves.
49+
You can create a `.syntest.js` file to change the way the tool behaves.
7050

7151
Finally run the tool
7252

7353
```bash
74-
cd <PATH_TO_SYNTEST_JAVASCRIPT>; npm run run-ts
54+
cd <PATH_TO_SYNTEST_JAVASCRIPT>; npm run standalone
7555
```
7656

7757
The results can be found in the `syntest` folder
@@ -83,48 +63,21 @@ To start you need to be in the root of the project folder containing the code yo
8363
After installing these dependencies together with the tool, you can run the following example command.
8464

8565
```bash
86-
$ syntest-javascript --include="<PATH_TO_YOUR_SOURCE_FOLDER>/src/**/*.js" --search-time=10 --total_time=10
66+
$ syntest-javascript --target-root-directory="<PATH_TO_YOUR_SOURCE_FOLDER>/src" --total-time=10
8767
```
8868

8969
This will test all javascript code that is contained in the source folder. It will run for 10 seconds.
9070

91-
Syntest-Javascript is highly configurable and supports a bunch of options and arguments, all of them can be found by providing the `--help` option or `-h` for short. Another way of configuring the tool is by putting a .syntest.js file in the root of your project. The file should have the following structure:
71+
SynTest-JavaScript is highly configurable and supports a bunch of options and arguments, all of them can be found by providing the `--help` option or `-h` for short. Another way of configuring the tool is by putting a .syntest.js file in the root of your project. The file should have the following structure:
9272

9373
```js
9474
module.exports = {
95-
population_size: 10,
96-
max_depth: 5,
75+
"population-size": 10,
76+
"max-depth": 5,
9777
...
9878
}
9979
```
10080

101-
The tool can be run via two modes, standalone or as a truffle plugin.
102-
103-
#### Standalone
104-
105-
```bash
106-
$ syntest-javascript [options]
107-
```
108-
109-
#### As a truffle plugin
110-
111-
To run syntest-javascript as a plugin of the truffle testing library, you need to create a truffle-config.js with the following contents:
112-
113-
> This file is auto-generated when using the standalone tool.
114-
115-
```js
116-
module.exports = {
117-
test_directory: ".syntest/tests",
118-
plugins: ["syntest-javascript"],
119-
};
120-
```
121-
122-
Next, you can run the following truffle command.
123-
124-
```bash
125-
$ truffle run @syntest/javascript [options]
126-
```
127-
12881
## Documentation
12982

13083
For questions and help with how to use this tool, please see the [documentation](https://www.syntest.org).

packages/javascript/NOTICE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SynTest Javascript
2+
Copyright 2020-2023 Delft University of Technology and SynTest contributors
3+
4+
This product includes software developed at
5+
Delft University of Technology (http://www.tudelft.nl/).

packages/javascript/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# SynTest Framework - JavaScript
2+
3+
> The aim of this tool is make it easier for JavaScript developers to test their code in a more effective and efficient way.
4+
5+
A tool to generate synthetic tests for the JavaScript language
6+
7+
### What is SynTest JavaScript?
8+
9+
SynTest JavaScript is a tool for automatically generating test cases for the JavaScript language. This tool is part of the [SynTest Framework](https://www.syntest.org). This framework contains multiple tools related to the generation of synthetic tests.
10+
11+
### Overview
12+
13+
The common core contains the common interfaces for the code control-flow representation, test case structure, genes, and the implementation for the meta-heuristic search algorithms.
14+
15+
## Installation
16+
17+
#### NPM
18+
19+
The simplest way to use syntest-javascript is by installing the [npm package](https://www.npmjs.com/package/syntest/javascript).
20+
21+
```bash
22+
$ npm install @syntest/javascript
23+
```
24+
25+
You can install it in your project as shown in the snippit above or you can install the package globally by using the npm options `-g`.
26+
27+
#### From source
28+
29+
The tool can be used by cloning the project, installing its dependencies, and compiling the TypeScript:
30+
31+
- Clone the projects
32+
33+
```bash
34+
$ git clone git@github.com:syntest-framework/syntest-javascript.git
35+
```
36+
37+
- Install dependencies
38+
39+
```bash
40+
$ cd syntest-javascript; npm install
41+
```
42+
43+
- Build Syntest-javascript
44+
45+
```bash
46+
$ cd syntest-javascript; npm run build
47+
```
48+
49+
You can create a `.syntest.js` file to change the way the tool behaves.
50+
51+
Finally run the tool
52+
53+
```bash
54+
cd <PATH_TO_SYNTEST_JAVASCRIPT>; npm run standalone
55+
```
56+
57+
The results can be found in the `syntest` folder
58+
59+
## Usage
60+
61+
To start you need to be in the root of the project folder containing the code you want to create test-cases for. Next, you need to install two dev-dependencies in your project, namely [chai](https://www.npmjs.com/package/chai) and [chai-as-promised](https://www.npmjs.com/package/chai-as-promised). Both are needed to run the tests.
62+
63+
After installing these dependencies together with the tool, you can run the following example command.
64+
65+
```bash
66+
$ syntest-javascript --target-root-directory="<PATH_TO_YOUR_SOURCE_FOLDER>/src" --total-time=10
67+
```
68+
69+
This will test all javascript code that is contained in the source folder. It will run for 10 seconds.
70+
71+
SynTest-JavaScript is highly configurable and supports a bunch of options and arguments, all of them can be found by providing the `--help` option or `-h` for short. Another way of configuring the tool is by putting a .syntest.js file in the root of your project. The file should have the following structure:
72+
73+
```js
74+
module.exports = {
75+
"population-size": 10,
76+
"max-depth": 5,
77+
...
78+
}
79+
```
80+
81+
## Documentation
82+
83+
For questions and help with how to use this tool, please see the [documentation](https://www.syntest.org).
84+
85+
## Support
86+
87+
For questions and help with how to use this library, please see [SUPPORT.md](SUPPORT.md).
88+
89+
## Contributing
90+
91+
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. For more information, please see [CONTRIBUTING.md](CONTRIBUTING.md).
92+
93+
## Authors and acknowledgment
94+
95+
- Annibale Panichella (PI)
96+
- Mitchell Olsthoorn (Project Lead)
97+
- Dimitri Stallenberg (Developer)
98+
99+
## License
100+
101+
The code within this project is licensed under the [Apache-2.0 license](LICENSE).

packages/javascript/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"types": "dist/index.d.ts",
2121
"files": [
2222
"/dist",
23-
"/NOTICE"
23+
"/NOTICE",
24+
"/README.md"
2425
],
2526
"bin": {
2627
"syntest-javascript": "dist/bin.js"

0 commit comments

Comments
 (0)