npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@syntest/solidity

v0.2.1

Published

SynTest Solidity is a tool for automatically generating test cases for the Solidity platform

Downloads

16

Readme

SynTest Framework - Solidity

The aim of this tool is make it easier for Solidity contract developers to test their contracts in a more effective and efficient way.

publish npm (scoped) node-current (scoped)

What is SynTest Solidity?

SynTest Solidity is a tool for automatically generating test cases for the Solidity platform. This tool is part of the SynTest Framework. This framework contains multiple tools related to the generation of synthetic tests.

Overview

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.

Installation

NPM

The simplest way to use syntest-solidity is by installing the npm package.

$ npm install @syntest/solidity

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.

From source

The tool can be used by cloning the project, installing its dependencies, and compiling the TypeScript:

  • Clone the projects
$ git clone [email protected]:syntest-framework/syntest-solidity.git
  • Install dependencies
$ cd syntest-solidity; npm install
  • Build Syntest-Solidity
$ cd syntest-solidity; npm run build

Building the docker image

docker build -t syntest-solidity:0.1.0 . --no-cache --build-arg REGISTRY_TOKEN={your_access_token}
docker run -it syntest-solidity:0.1.0 MetaCoin.sol "$(cat ./contracts/MetaCoin.sol)"

Local development

To be able to make quick changes to the syntest-framework and then test it in the syntest-solidity project use npm link:

cd <PATH_TO_SYNTEST_FRAMEWORK>; npm link
cd <PATH_TO_SYNTEST_SOLIDITY>; npm link @syntest/core

This creates a symbolic link to the local syntest-framework instance in the node modules folder of syntest-solidity.

Usage

To start you need to be in the root of the project folder containing the contracts you want to create test-cases for. Next, you need to install two dev-dependencies in your project, namely chai and chai-as-promised. Both are needed to run the tests.

After installing these dependencies together with the tool, you can run the following example command.

$ syntest-solidity --include="<PATH_TO_YOUR_CONTRACTS_FOLDER>/contracts/**/*.sol" --search-time=10 --total_time=10

This will test all solidity contracts that are contained in the contracts folder. It will run for 10 seconds.

Note that currently the contracts folder has to be named "contracts" for the tool to work. This will be solved in a later version.

Syntest-Solidity 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:

module.exports = {
    population_size: 10,
    max_depth: 5,
    ...
}

The tool can be run via two modes, standalone or as a truffle plugin.

Standalone

$ syntest-solidity [options]

As a truffle plugin

To run syntest-solidity as a plugin of the truffle testing library, you need to create a truffle-config.js with the following contents:

This file is auto-generated when using the standalone tool.

module.exports = {
  test_directory: ".syntest/tests",
  plugins: ["syntest-solidity"],
};

Next, you can run the following truffle command.

$ truffle run @syntest/solidity [options]

Documentation

For questions and help with how to use this tool, please see the documentation.

Support

For questions and help with how to use this library, please see SUPPORT.md.

Contributing

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.

Authors and acknowledgment

  • Annibale Panichella (PI)
  • Mitchell Olsthoorn (Project Lead)
  • Dimitri Stallenberg (Developer)

License

The code within this project is licensed under the Apache-2.0 license.