//Copyright (C) 2013 Eric Quintane (
[email protected]) -‐ Unpublished work -‐ All Rights Reserved //This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as //published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. //You should have received a copy of the GNU General Public License along with this program. If not, see //. //This program uses a sequence of relational events with attributes of the sender, recipient and event to create a universe of observed //and potential events and their accompanying statistics. The statistics produced here are: Prior edge, Prior activity, Prior popularity, //Out-‐In Assortativity, Core Developer, Severe Bug, Core Severe and Four Cycle. import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; import java.util.Random; public class bug_fixing_code { public static void main(String[] args) throws FileNotFoundException, IOException { new rem_stats_calc (); } }
class rem_stats_calc { public rem_stats_calc (){ //DECLARE VARIABLES int ns, y, nevent, time, ia, ib, i, j, k, ndata, bugs, devs, totevent, cat, nattbugs, nattdevs; int nhe, nactivedev, nactivebug, nopenbug, nopendev; //INITITALISE VARIABLES USED TO READ DATAFILES ns=9; ndata=10; nattbugs=5; nattdevs=4; y=0; i=0; j=0; nhe=0; nactivedev=0; nactivebug=0; nopenbug=0; nopendev=0; bugs=1208;devs=194; totevent = 4348; //SET PATH FOR INPUT AND OUTPUT FILES String path = "XXXXXXXX"; String inputbugattf= path+"bugs.txt"; //bugs attributes file String inputdevsattf= path+"devs.txt"; //developers attributes file String inputdataf = path+"events.txt"; //events file //OUTPUT FILE String outputfile = path+"bugfixing.txt"; //ARRAY ALLOCATIONS int [][][] cx = new int [devs+1][bugs+1][3]; //event matrix int [] cs = new int [ns+1]; //statistics array int [] cshe = new int [ns+1]; //high effort statistics array int [] csle = new int [ns+1]; //low effort statistics array int [][] data = new int [totevent+1][ndata+1];//events array int [][] attbugs = new int [nattbugs+1][bugs+1];//bugs attributes array int [][] attdevs = new int [nattdevs+1][devs+1];//developers attributes array int [] activebug = new int [bugs+1];//active bugs array int [] activedev = new int [devs+1];//active developers array int [] openbug = new int [bugs+1];//bugs tenure array int [] opendev = new int [devs+1]; //developers tenure array
//INITIALISATION for (int counti = 0; counti