Input output relation test suite generation


#1

Hello I need help fixing this code, it's basically a test generation code where the program asks the user to enter a number of parameters and the strength of those parameters and based on what is entered the program will generate an interaction list, an example would be if the user enters 4 parameters (We'll denote the 4 parameters as 0, 1, 2, 3) and the values of these parameters are 2 ( so for parameter 0 the values are 0 and 1, for parameter 2 the values are 2 and 3, parameter 3 is 4 and 5 and parameter 4 is 6 and 7). The interaction list would be:

[[0, 2], [0, 3], [1, 2], [1, 3]]
[[0, 4], [0, 5], [1, 4], [1, 5]]
[[0, 6], [0, 7], [1, 6], [1, 7]]
[[2, 4], [2, 5], [3, 4], [3, 5]]
[[2, 6], [2, 7], [3, 6], [3, 7]]
[[4, 6], [4, 7], [5, 6], [5, 7]].

I need the code to then ask the user to choose a specific set of parameters from the 4 parameters entered and then output this specific interaction list as illustrated below , for example the user chooses parameter 0 and 1 so the values of parameter 0 and 1 are 0,1 for parameter 0 and 2, 3 for parameter 1 so the interaction list would be;

[[0, 2], [0, 3], [1, 2], [1, 3]]

A part of the code where the program generates the first interaction list is below I need some help editing this part of the code so it can work the way explained.


 ///System.out.println("Parameter Values Pair");
        for (int w = 0; w < parameterval.size() - 1; w++) {
            for (int x = w + 1; x <parameterval.size(); x++) {
                  ArrayList<ArrayList<Integer>> total_interactionpair = new ArrayList<ArrayList<Integer>>();
                for (int y = 0; y < parameterval.get(w).size(); y++) {
                    for (int z = 0; z < parameterval.get(x).size(); z++) {      
                   ArrayList<Integer> interactionpair = new ArrayList<Integer>();
                       //System.out.println("ParameterValue Interaction Pair " + number + " : " + parameterval.get(w).get(y) + " , " + parameterval.get(x).get(z));
                        number++;
                        count += 1;
                        for (int i = 0; i < 1; i++) {

                             interactionpair.add(parameterval.get(w).get(y));
                             interactionpair.add(parameterval.get(x).get(z));     
                        }
                        total_interactionpair.add(interactionpair);
                        interactionList.add(interactionpair);
                         
                    }
                    
                }
                total_interactionpairs_interval1.add(total_interactionpair);
               //System.out.println("Interaction: "+total_interactionpair_each_parameter);
            }
        }
        
        total = count;
        System.out.println("\nTotal Interaction Pairs Generated:"+count);
        if(count!=0)
        {
            System.out.println("\nInteraction pairs");
            for(int i=0;i<total_interactionpairs_interval1.size();i++)
            {
                 System.out.println(total_interactionpairs_interval1.get(i));
            }
        } else{}


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.