Git Product home page Git Product logo

annatester's Introduction

AnnaTester

AnnaTest is an automated frameork to recognize annotation-induced faults of static analyzers. Basically, it is implemented by annotation synthesis and metamorphic testing techniques. Until now, AnnaTester has found 43 bugs in known static analyzers (PMD, SpotBugs, SonarQube, CheckStyle, Infer, and Soot).

This is the source code repo of AnnaTester. The source code files are located in the folder src, tools and offset folder contains some auxiliary programs, e.g., crawl seed files from web, seed folder contains the downloaded seed files.

User Guideline

Project Description

  1. Src folder includes source code and test cases for our project.
  2. Seeds folder includes the initial input programs for our project.
  3. The pom.xml defines the third-party dependency libraries used in our project.

Install MVN Dependency

We use Maven 3.8.5 to build our project. Users should first install the dependency libraries using the following command:

mvn -f pom.xml dependency:copy-dependencies

Install Static Analyzer

Download different static analyzers by the following links:

PMD: https://github.com/pmd/pmd/releases/tag/pmd_releases/6.51.0
SpotBugs: https://github.com/spotbugs/spotbugs/releases
CheckStyle: https://github.com/checkstyle/checkstyle/releases/
Infer: https://github.com/facebook/infer/releases/tag/v1.1.0
SonarQube: https://www.sonarqube.org/downloads/
Soot: https://github.com/soot-oss/soot/releases

Config property & Execution

Create a config file called "config.properties" in the root folder of AnnaTester, and define the following properties in this file:

PROJECT_PATH=/PATH/TO/PROJECT
EVALUATION_PATH=/PATH/TO/EVALUATION
SEED_PATH=/PATH/TO/INPUT/PROGRAMS
TOOL_PATH=/PATH/TO/ANALYZERS
JAVAC_PATH=/PATH/TO/JAVAC
TEST_PMD=true
TEST_SPOTBUGS=false
TEST_CHECKSTYLE=false
TEST_INFER=false
TEST_SONARQUBE=false
TEST_SOOT=false
GOOGLE_FORMAT_PATH=/PATH/TO/GOOGLE/FORMAT
PMD_CONFIG_PATH=/PATH/TO/PMD_CONFIG
MOCK_ANNOTATION_JAR_PATH=/PATH/TO/DUMMY_ANNOTATION_JAR

Notice that, you should download Google format from Link. The PMD_CONFIG_PATH is designed by users, and we provide one example file in the tools folder. MOCK_ANNOTATION_JAR is available via compiling MockAnnotation in tools\org.

First use initEnv defined in Utility.java, then use the Schedule.java to select our checkers and test corresponding static analyzers, for instance:

Utility.initEnv();
Schedule schedule = Schedule.getInstance();
schedule.runInjectionChecker();

We have provided a shell script for running the project, you can use this file ./run.sh to assist running AnnaTester.

annatester's People

Contributors

cshezhang avatar

Watchers

 avatar

Forkers

haibowang1992

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.