Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:25:34+00:00 2026-06-13T01:25:34+00:00

Suppose there is a method like this (C#): public static int Add(int x, int

  • 0

Suppose there is a method like this (C#):

public static int Add(int x, int y)
{
    return x + y;
}

If the sum does not fit into the int data type it is probably an error situation which is worth a unit test. Is Pex able to identify such errors and generate unit tests for those?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:25:36+00:00Added an answer on June 13, 2026 at 1:25 am

    Yes, it’s very good at it. When introducing Pex they will frequently use the bug found in the Java library’s binary sort routine where it would overflow for very large arrays when finding the new midpoint. A related set of bugs are the leap year bugs and they will commonly use a function from one of Microsoft’s own products (Azure?) which displayed one of these in the wild.

    Pex catches many different classes of bugs including Overflows, Underflows, Null References, Invalid Argument, and even any custom exceptions you throw in your application. I highly recommend reading the some of the getting started guides and then combine Pex with Code Contracts to make your life much easier in the long run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a Java class like this: public class Test { static {
Suppose there is a situation like : statement 1; statement 2; statement 3; statement
Suppose there is a System A which gives some output. This output is used
Suppose I have a method to return a list of keys in a dictionary,
Suppose I have a number of related classes that all have a method like
Suppose I have this class hierarchy: class A { public: virtual void foo(Base *b)
I have this method, that can return three different response. At first, it was
Suppose I have an interface like so public interface Foo<Ret, Arg> { public Ret
Let us suppose i have these three methods defined: int F1(int, int); int F1(float,
Suppose there is a script sth.py When i logged with 'root' account. type :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.