Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Ho do we select Valid/Interesting values for a test case?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Thanked 0 Times in 0 Posts

    Default Ho do we select Valid/Interesting values for a test case?

    Hi friends,
    This is SChavala from UK Studying Msc.Computing and information technology. Right now i am doing dissertation... title is "Automatic Generation of Test cases with Junit Frame work rules". When the time of generating test cases how can we select valid/interesting values for the test case. Please give me your suggestions for this problem.
    Thank you,

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: Ho do we select Valid/Interesting values for a test case?

    Please don't post duplicate threads. I deleted your other identical post.

    But the answer to your question depends entirely on the context of the problem you're testing, so it's not really an answerable question.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Thanked 0 Times in 0 Posts

    Default Re: Ho do we select Valid/Interesting values for a test case?

    I am doing research on automatic generation of test cases based on Junit rules framework. I developed a new tool i.e. automatically generating test cases for Java bean naming conventions(getters and setters). It generating test cases for only those methods. In market we have different types semi-automatic test tools . I tried a different one through JavaBean naming conventions, Reflection API and parameter space partition. It is working perfectly. But i am confused in what type of parameter values have to give for testing
    methods of given code.
    My question: How do we select valid/intersting values for the test case?

    Regarding my topic i found some information i,e.

    Boundary value analysis and equivalence partitioning both are test case design strategies in black box testing.

    Equivalence Partitioning:

    In this method the input domain data is divided into different equivalence data classes. This method is typically used to reduce the total number of test cases to a finite set of testable test cases, still covering maximum requirements.

    In short it is the process of taking all possible test cases and placing them into classes. One test value is picked from each class while testing.

    E.g.: If you are testing for an input box accepting numbers from 1 to 1000 then there is no use in writing thousand test cases for all 1000 valid input numbers plus other test cases for invalid data.

    Using equivalence partitioning method above test cases can be divided into three sets of input data called as classes. Each test case is a representative of respective class.

    So in above example we can divide our test cases into three equivalence classes of some valid and invalid inputs.

    Test cases for input box accepting numbers between 1 and 1000 using Equivalence Partitioning:
    1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient.

    2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case.

    3) Input data with any value greater than 1000 to represent third invalid input class.

    So using equivalence partitioning you have categorized all possible test cases into three classes. Test cases with other values from any class should give you the same result.

    We have selected one representative from every input class to design our test cases. Test case values are selected in such a way that largest number of attributes of equivalence class can be exercised.

    Equivalence partitioning uses fewest test cases to cover maximum requirements.

    Boundary value analysis:

    It’s widely recognized that input values at the extreme ends of input domain cause more errors in system. More application errors occur at the boundaries of input domain. ‘Boundary value analysis’ testing technique is used to identify errors at boundaries rather than finding those exist in center of input domain.

    Boundary value analysis is a next part of Equivalence partitioning for designing test cases where test cases are selected at the edges of the equivalence classes.

    Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:
    1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case.

    2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.

    3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001.

    Boundary value analysis is often called as a part of stress and negative testing.

    Note: There is no hard-and-fast rule to test only one value from each equivalence class you created for input domains. You can select multiple valid and invalid values from each equivalence class according to your needs and previous judgments.

    E.g. if you divided 1 to 1000 input values in valid data equivalence class, then you can select test case values like: 1, 11, 100, 950 etc. Same case for other test cases having invalid data classes.

    This should be a very basic and simple example to understand the Boundary value analysis and Equivalence partitioning concept.

    According to 1st point of equivalence partitioning method , suppose if i take the integer range range between 1 to Integer.MAX_VALUE it is successful in this case.
    But the 3rd point of equivalence partitioning method, if we have to give the value like Integer.MAX_VALUE+1. Here i am getting the error.....it is not working on my tool..........

Similar Threads

  1. This is Cool and interesting but i failed
    By Jhovarie in forum Java SE APIs
    Replies: 0
    Last Post: March 6th, 2011, 11:10 PM
  2. Ranging Case Values in Switch Construct
    By WhiteSoup12 in forum Loops & Control Statements
    Replies: 1
    Last Post: February 6th, 2011, 11:50 AM
  3. Again Interesting JButton query
    By ravjot28 in forum AWT / Java Swing
    Replies: 0
    Last Post: January 14th, 2010, 11:22 AM
  4. Get <SELECT> tag values on other jsp page
    By nehakuls in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: November 18th, 2009, 02:29 AM