Code Monkey home page Code Monkey logo

prometheus's People

Contributors

ionuttamas avatar tamashionut avatar

Watchers

 avatar  avatar

prometheus's Issues

Currently we take first reacheable hit => must take all

If we have:

METHOD 1:
if (from1.Age == 12 && to1.Age == 14)

METHOD 2:
if (from2.Age == 12 && to2.Age == 14)

we take: from2 ~ from1 and to2 ~ from1.
We should also check to2 ~ to1 and from2 ~ to1 => all possible combinations.

Reason about collections

Count, contains checks:

if (lv != null && lv.SelectedItems != null && lv.SelectedItems.Count > 0)
            {
                SelectedItems = lv.SelectedItems.Cast<ListViewItem>().Select(x => x.Tag as WorkerTask).Where(x => x != null && x.Info != null).
                    Select(x => new UploadInfoStatus(x.Info)).ToArray();
            }

Implement conditions for return statements

  public static Customer GetFirstLinq(List<Customer> customers, Customer from, decimal amount)
    {
        if (from.AccountBalance > amount)
            return customers.First(x => x.Age > from.Age);

        if (from.Type == CustomerType.Gold)
            return from;

        return customers.First(x => x.DeliveryAddress == from.DeliveryAddress);
    }

the return customers.First(x => x.DeliveryAddress == from.DeliveryAddress); should have as conditions the negations of the 2 if statements.

Boolean functions in conditions

E.g. add support for

if ( IsValid(instance) )
 {
       ....
 }

or

if ( instance.IsValid() )
 {
       ....
 }

should elevate the IsValid return types as Z3 conditions.

Track variables read from external sources

If we have:

customer.Age = valueFromFile(...);
then customer.Age can have any value.

If a check is made, such as:

var value = valueFromFile(...);

if (value>0)
{
   customer.Age = value;
}

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.