Code Monkey home page Code Monkey logo

awesome-bugs's Introduction

CI License Hits-of-Code Lines of code

DISCLAIMER: The work is still in progress!

This is a taxonomy of software defects and a benchmarking scripts which validates which of the mentioned defects can be detected by which static analyzers.

While building the taxonomy we took into account the following classifications:

We are not trying to make an exhaustive list of defects, but mostly focus on defects related to object-oriented structure of code. We classify by OO features being used in a defective program:

defects/
  classes/
  objects/
  inheritance/
  assertions/
  concurrency/
  null/
  operators/
    division/
      div-by-zero-when-reading-file.yml
      div-by-zero-in-simple-method.yml
    increment/
  loops/
  polymorphism/
  arrays/
  numbers/
  contracts/
  annotations/
  monads/
  traits/
  overloading/
  encapsulation/
  reflection/
  strings/
  pointers/

Each defect is presented in YAML format, similar to this one (in a file div-by-zero-in-simple-method.yml):

title: A division without checking for zero may lead to division by zero
description: An error can occur when divided by the value received as an argument to the method
features: 
  - operators/division
  - loops
language: java
bad:
  foo.java: |
    class Foo {
      int f(int x) {
        return 42 / x;
      }
    }
  foo.eo: |
    [] > Foo
      [] > new
        [x] > f
          42.div x > @
good:
  foo.java: |
    class Foo {
      int f(int x) {
        if(x!=0) {
          return 42 / x;
        }
       }
    }
  foo.eo: |
    [] > Foo
      [] > new
        [x] > f
          if. > @
            x.neq 0
            42.div x
            TRUE

Temporarily (until we have powerful enough Java/C++/Python to EO translators) we keep EO code snippets in the YAML files too. They are excluded from the testing process when, for example, Java code is being tested with Java-specific static analyzers. They only are used when Polystat is being tested.

Both bad and good sections are mandatory. Intuitively, the bad section contains a program with a bug, while the good one has a similar program but without a bug.

Analizers

The following static analyzers are participating in the comparison:

How to run

Before starting, make sure the following is installed:

  • Python 3.10+
  • Java 16+
  • TexLive 2022

To run benchmarking tool on Linux you need to execute a script:

sudo ./run.sh

The current report obtained using this script can be viewed here.

awesome-bugs's People

Contributors

alexpotyomkin avatar apotyomkin avatar fizruk avatar leosimetti avatar yegor256 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.