Application.java

1
// Copyright © 2004-2006 University of Helsinki, Department of Computer Science
2
// Copyright © 2012 various contributors
3
// This software is released under GNU Lesser General Public License 2.1.
4
// The license text is at http://www.gnu.org/licenses/lgpl-2.1.html
5
package fi.helsinki.cs.titokone;
6
7
import fi.helsinki.cs.ttk91.*;
8
9
import java.util.logging.Logger;
10
11
/**
12
 * This class represents a compiled TTK-91-application. It also contains
13
 * information about what has gotten printed during its running and
14
 * what it should be reading as various inputs during its run.
15
 */
16
public class Application implements TTK91Application {
17
    /**
18
     * This field lists the delimiters accepted as any-combination
19
     * delimitation markup in a string intended for either keyboard
20
     * or stdin input.
21
     */
22
    public static final String DELIMITERS = "[ \n\r\t\f,.:;]+";
23
24
    /**
25
     * This array contains the code to the application; one command
26
     * per line. The initial FP value can be calculated from
27
     * code.length - 1. If the code area is empty, this field contains
28
     * a zero-length array.
29
     */
30
    private MemoryLine[] code;
31
    /**
32
     * This array contains the initial data area of the application,
33
     * determined at compile time by DS and DC pseudocommands. The
34
     * initial SP value can be determined from code.length +
35
     * initialData.length - 1. (It points to the last reserved memory
36
     * address, since there is no "top of stack" yet.) If the data
37
     * area is empty, this field contains a zero-length array.
38
     * For reserved but uninitialized data rows, the array contains
39
     * null values.
40
     */
41
    private MemoryLine[] initialData;
42
    /**
43
     * This field stores the local symbol table of the application.
44
     */
45
    private SymbolTable symbols;
46
47
    /**
48
     * Stdout and crt store the outputs of this application.
49
     */
50 2
    private String stdout = "", crt = "";
51
    /**
52
     * Stdincontent and kbdcontent store the possible preset input
53
     * of this application, and stdinpointer and kbdpointer point to
54
     * the position that should be read next.
55
     */
56 6
    private int[] stdincontent = new int[0], kbdcontent = new int[0];
57 6
    private int stdinpointer = 0, kbdpointer = 0;
58
59
    /**
60
     * This constructor sets up a new Application. If an application is
61
     * compiled from source code, the compiler will know when various
62
     * symbols are used. This constructor enables the compiler or other
63
     * code/data source to store the symbolic commands as well as the
64
     * binary into instances of MemoryLine, which can contain either
65
     * only the integer values representing the command or both the
66
     * integer value and the symbolic form as a string. This way eg. a
67
     * command of the value 18874378, which means STORE R1, 10, can be
68
     * stored also as "STORE R1, LUKU" (where LUKU has been defined to be
69
     * a symbol for 10) to appear more readable to a human user.
70
     * If you do not have this symbolic data available, eg. because the
71
     * application is being parsed from its binary form, you can use the
72
     * other constructor instead.
73
     *
74
     * @param code    An array containing the compiled code as MemoryLines.
75
     *                The MemoryLines represent both the integer and the symbolic form
76
     *                of the commands. Including the symbolic form is optional. This
77
     *                value may be null or of length 0 in the unlikely case that there
78
     *                is no code area.
79
     * @param data    An array containing the initial data area and its
80
     *                contents as MemoryLines. The MemoryLines represent both the
81
     *                integer and the symbolic form of commands, but especially in
82
     *                the case of data, including the symbolic form is
83
     *                optional. This value may be null or of length 0 if there is no
84
     *                data area.
85
     * @param symbols An instance of SymbolTable, containing the
86
     *                symbol table for this application. This value can be null if
87
     *                there are no local symbols available. (Locally, an empty
88
     *                symboltable is created.)
89
     */
90
    public Application(MemoryLine[] code, MemoryLine[] data,
91
                       SymbolTable symbols) {
92 1
        if (code != null) {
93 1
            this.code = code;
94
        } else {
95 3
            this.code = new MemoryLine[0];
96
        }
97 1
        if (data != null) {
98 1
            this.initialData = data;
99
        } else {
100 3
            this.initialData = new MemoryLine[0];
101
        }
102 1
        if (symbols != null) {
103 1
            this.symbols = symbols;
104
        } else {
105 2
            this.symbols = new SymbolTable();
106
        }
107
    }
108
109
    /**
110
     * This method returns the (initial) code area of the application.
111
     * Any self-modifying code in the application will have no
112
     * effect on the return value; changes in the memory representation
113
     * of the code and in the initial code are thus separated.
114
     *
115
     * @return An array containing the code area of the application. The
116
     *         array will be of length 0 if for some reason this application has
117
     *         no code area.
118
     */
119
    public MemoryLine[] getCode() {
120 2
        return (MemoryLine[]) code.clone();
121
    }
122
123
    /**
124
     * This method returns the initial data area of the application with
125
     * its contents. Any modifications the code does to the data area
126
     * during its running have no effect on the return value; changes in
127
     * the memory representation of the data and the initial state of the
128
     * data for this application are thus separated.
129
     *
130
     * @return An array containing the data area with its contents as
131
     *         MemoryLines. The array will be of length 0 if this application has
132
     *         no initial data area.
133
     */
134
    public MemoryLine[] getInitialData() {
135 2
        return (MemoryLine[]) initialData.clone();
136
    }
137
138
    /**
139
     * This method returns the symbol table containing the application's
140
     * local symbols.
141
     *
142
     * @return The application's symbol table, minus global symbols like
143
     *         HALT, unless they have been overwritten.
144
     */
145
    public SymbolTable getSymbolTable() {
146 1
        return symbols; // Note: An actual pointer is returned here.
147
    }
148
149
    /**
150
     * This method stores one more line to the CRT ("screen") memory
151
     * of the application. The results can be queried by getCrt(); this
152
     * method will not actually make the line show on any physical screen.
153
     *
154
     * @param line A new line to "write to the screen".
155
     */
156
    public void writeToCrt(int line) {
157 8
        crt += "" + line + System.getProperty("line.separator", "\n");
158
    }
159
160
    /**
161
     * This method stores one more line to the StdOut ("file") memory
162
     * of the application. The results can be queried by getStdOut(); this
163
     * method will not actually make the line show on any file.
164
     *
165
     * @param line A new line to "write to the file".
166
     */
167
    public void writeToStdOut(int line) {
168 8
        stdout += "" + line + System.getProperty("line.separator", "\n");
169
    }
170
171
    /**
172
     * This method reads the next line from a keyboard "buffer" set up
173
     * before by setKbd(). If setKbd() is called after this method
174
     * has been called, the previous keyboard buffer is ignored and
175
     * reading continues from the beginning of the new input.
176
     *
177
     * @return The next integer corresponding to the kbd data set earlier
178
     *         by setKbd().
179
     * @throws TTK91NoKbdData If there is no more keyboard data
180
     *                        available in the buffer. The caller may then decide to get
181
     *                        their keyboard data via other routes, eg. the user.
182
     */
183
    public int readNextFromKbd() throws TTK91NoKbdData {
184
        Logger logger;
185 14
        String[] messageParams = {"" + kbdpointer, "" + kbdcontent.length};
186
187 2
        if (kbdpointer >= kbdcontent.length) {
188
            logger = Logger.getLogger(this.getClass().getPackage().getName());
189
            logger.fine(new Message("Application has no more keyboard data, " +
190
                    "read: {0}, buffer length {1}.",
191
                    messageParams).toString());
192 3
            throw new TTK91NoKbdData(new Message("No more keyboard data " +
193
                    "stored on " +
194
                    "application.").toString());
195
        } else {
196 5
            return kbdcontent[kbdpointer++]; // increment post-indexing.
197
        }
198
    }
199
200
    /**
201
     * This method reads the next line from a file read "buffer" set
202
     * up before by setStdIn(). If setStdIn() is called after this
203
     * method has been called, the previous file read buffer is
204
     * ignored and reading continues from the beginning of the new
205
     * input.
206
     *
207
     * @return The next integer corresponding to the file read data set
208
     *         earlier by setStdIn().
209
     * @throws TTK91NoStdInData If there is no more file read data
210
     *                          available in the buffer. The caller may then decide to get their
211
     *                          data via other routes, eg. by reading from some actual file.
212
     */
213
    public int readNextFromStdIn() throws TTK91NoStdInData {
214
        Logger logger;
215 14
        String[] messageParams = {"" + stdinpointer,
216
                "" + stdincontent.length};
217 2
        if (stdinpointer >= stdincontent.length) {
218
            logger = Logger.getLogger(this.getClass().getPackage().getName());
219
            logger.fine(new Message("Application has no more stdin data, read: " +
220
                    "{0}, buffer length {1}.",
221
                    messageParams).toString());
222 3
            throw new TTK91NoStdInData(new Message("No more stdin data " +
223
                    "stored on " +
224
                    "application.").toString());
225
        } else {
226 5
            return stdincontent[stdinpointer++]; // increment post-indexing.
227
        }
228
    }
229
230
    /**
231
     * This method checks whether input would be a valid string
232
     * to give to setKbd or setStdIn.
233
     *
234
     * @param input The string to check.
235
     * @return True if the string would be valid input, false
236
     *         otherwise.
237
     */
238
    public static boolean checkInput(String input) {
239
        String[] pieces;
240 1
        if (input == null) {
241 3
            return false;
242
        }
243 1
        pieces = input.split(DELIMITERS);
244 5
        for (int i = 0; i < pieces.length; i++) {
245
            try {
246 1
                Integer.parseInt(pieces[i]);
247
            } catch (NumberFormatException notParseableToInteger) {
248 3
                return false;
249
            }
250
        }
251 3
        return true;
252
    }
253
254
    /* The implementation of TTK91Application *************************/
255
256
    /**
257
     * This method returns what was written to a file during the
258
     * running of this application, and clears the buffer.
259
     *
260
     * @return What the application printed to a file during its last run,
261
     *         delimited with System.getProperty("line.separator", "\n").
262
     */
263
    public String readStdOut() {
264
        String result = stdout;
265 1
        stdout = "";
266 1
        return result;
267
    }
268
269
    /**
270
     * This method returns what was printed to the screen during the
271
     * running of this application, and clears the buffer.
272
     *
273
     * @return What the application printed to screen during its last
274
     *         run, delimited with System.getProperty("line.separator", "\n").
275
     */
276
    public String readCrt() {
277
        String result = crt;
278 1
        crt = "";
279 1
        return result;
280
    }
281
282
    /**
283
     * This method can be used to set in advance what values any
284
     * keyboard reads should return.
285
     *
286
     * @param input What (integers) the application should "read from the
287
     *              keyboard" during its run, delimited by '\n', '\r', '\r\n', '\f',
288
     *              '\t', ' ', ',', '.', ':', ';' or any length combination
289
     *              thereof.
290
     * @throws IllegalArgumentException If the input string is not valid.
291
     */
292
    public void setKbd(String input) {
293
        String errorMessage;
294 6
        String[] logMessageParams = {input, ""};
295
        String[] pieces;
296
        Logger logger;
297
298 2
        if (!checkInput(input)) {
299 2
            errorMessage = new Message("Keyboard input string \"{0}\" invalid, " +
300
                    "should be eg. \\n-separated list of " +
301
                    "integers.", input).toString();
302 1
            throw new IllegalArgumentException(errorMessage);
303
        } else {
304 1
            pieces = input.split(DELIMITERS);
305 3
            kbdpointer = 0;
306 1
            kbdcontent = new int[pieces.length];
307 5
            for (int i = 0; i < pieces.length; i++) {
308 1
                kbdcontent[i] = Integer.parseInt(pieces[i]);
309
            }
310
            logger = Logger.getLogger(this.getClass().getPackage().getName());
311 6
            logMessageParams[1] = "" + kbdcontent.length;
312
            logger.fine(new Message("Accepted \"{0}\" as keyboard input, " +
313
                    "tokens found: {1}.",
314
                    logMessageParams).toString());
315
        }
316
317
    }
318
319
    /**
320
     * This method can be used to set in advance what values any
321
     * file reads should return. The input is checked.
322
     *
323
     * @param input What (integers) the application should "read from
324
     *              a file" during its run, delimited by '\n', '\r', '\r\n', '\t', '\f',
325
     *              ' ', ',', '.', ':', ';' or any-length combination thereof.
326
     * @throws IllegalArgumentException If the input string is not valid.
327
     */
328
    public void setStdIn(String input) {
329
        String errorMessage;
330 6
        String[] logMessageParams = {input, ""};
331
        String[] pieces;
332
        Logger logger;
333
334 2
        if (!checkInput(input)) {
335 2
            errorMessage = new Message("Stdin input string \"{0}\" invalid, " +
336
                    "should be eg. \\n-separated list of " +
337
                    "integers.", input).toString();
338 1
            throw new IllegalArgumentException(errorMessage);
339
        } else {
340 1
            pieces = input.split(DELIMITERS);
341 3
            stdinpointer = 0;
342 1
            stdincontent = new int[pieces.length];
343 5
            for (int i = 0; i < pieces.length; i++) {
344 1
                stdincontent[i] = Integer.parseInt(pieces[i]);
345
            }
346
            logger = Logger.getLogger(this.getClass().getPackage().getName());
347 6
            logMessageParams[1] = "" + stdincontent.length;
348
            logger.fine(new Message("Accepted \"{0}\" as stdin input, " +
349
                    "tokens found: {1}.",
350
                    logMessageParams).toString());
351
        }
352
    }
353
}

Mutations

50

Removed assignment to member variable crt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable stdout : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

56

Substituted 0 with 1 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 0 with 1 : SURVIVED

Removed assignment to member variable stdincontent : SURVIVED

Removed assignment to member variable kbdcontent : SURVIVED

Substituted 0 with 1 : SURVIVED

57

Substituted 0 with 1 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 0 with 1 : SURVIVED

Removed assignment to member variable kbdpointer : SURVIVED

Removed assignment to member variable stdinpointer : SURVIVED

Substituted 0 with 1 : SURVIVED

92

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

93

Removed assignment to member variable code : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

95

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable code : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

97

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

98

Removed assignment to member variable initialData : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

100

Removed assignment to member variable initialData : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

102

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

103

Removed assignment to member variable symbols : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

105

removed call to fi/helsinki/cs/titokone/SymbolTable::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable symbols : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

120

removed call to [Lfi/helsinki/cs/titokone/MemoryLine;::clone : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

mutated return of Object value for fi/helsinki/cs/titokone/Application::getCode to ( if (x != null) null else throw new RuntimeException ) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

135

mutated return of Object value for fi/helsinki/cs/titokone/Application::getInitialData to ( if (x != null) null else throw new RuntimeException ) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

removed call to [Lfi/helsinki/cs/titokone/MemoryLine;::clone : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

146

mutated return of Object value for fi/helsinki/cs/titokone/Application::getSymbolTable to ( if (x != null) null else throw new RuntimeException ) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testConstructor(fi.helsinki.cs.titokone.ApplicationTest)

157

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable crt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/System::getProperty : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::toString : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

168

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable stdout : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::toString : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/System::getProperty : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

185

Substituted 1 with 0 : SURVIVED

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 2 with 3 : SURVIVED

Substituted 0 with 1 : SURVIVED

removed call to java/lang/StringBuilder::toString : SURVIVED

Substituted 1 with 0 : SURVIVED

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 2 with 3 : SURVIVED

Substituted 0 with 1 : SURVIVED

removed call to java/lang/StringBuilder::toString : SURVIVED

187

changed conditional boundary : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

192

removed call to fi/helsinki/cs/titokone/Message::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/ttk91/TTK91NoKbdData::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/titokone/Message::toString : SURVIVED

196

Replaced integer addition with subtraction : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable kbdpointer : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

replaced return of integer sized value with (x == 0 ? 1 : 0) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

215

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 1 with 0 : SURVIVED

Substituted 2 with 3 : SURVIVED

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : SURVIVED

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::toString : SURVIVED

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::toString : SURVIVED

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 2 with 3 : SURVIVED

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

217

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

changed conditional boundary : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

222

removed call to fi/helsinki/cs/titokone/Message::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/ttk91/TTK91NoStdInData::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/titokone/Message::toString : SURVIVED

226

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable stdinpointer : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Replaced integer addition with subtraction : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

replaced return of integer sized value with (x == 0 ? 1 : 0) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

240

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

241

Substituted 0 with 1 : NO_COVERAGE

Substituted 0 with 1 : NO_COVERAGE

replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE

243

removed call to java/lang/String::split : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

244

Changed increment from 1 to -1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ControlTest.testSetDefaultStdin(fi.helsinki.cs.titokone.ControlTest)

changed conditional boundary : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ControlTest.testSetDefaultStdin(fi.helsinki.cs.titokone.ControlTest)

246

removed call to java/lang/Integer::parseInt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

248

replaced return of integer sized value with (x == 0 ? 1 : 0) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

251

replaced return of integer sized value with (x == 0 ? 1 : 0) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testInputCheck(fi.helsinki.cs.titokone.ApplicationTest)

265

Removed assignment to member variable stdout : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

266

mutated return of Object value for fi/helsinki/cs/titokone/Application::readStdOut to ( if (x != null) null else throw new RuntimeException ) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

278

Removed assignment to member variable crt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

279

mutated return of Object value for fi/helsinki/cs/titokone/Application::readCrt to ( if (x != null) null else throw new RuntimeException ) : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testWrites(fi.helsinki.cs.titokone.ApplicationTest)

294

Substituted 0 with 1 : SURVIVED

Substituted 2 with 3 : SURVIVED

Substituted 1 with 0 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 1 with 0 : SURVIVED

Substituted 2 with 3 : SURVIVED

298

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/titokone/Application::checkInput : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

299

removed call to fi/helsinki/cs/titokone/Message::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/titokone/Message::toString : SURVIVED

302

removed call to java/lang/IllegalArgumentException::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

304

removed call to java/lang/String::split : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

305

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable kbdpointer : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

306

Removed assignment to member variable kbdcontent : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

307

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

changed conditional boundary : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Changed increment from 1 to -1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

308

removed call to java/lang/Integer::parseInt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

311

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : SURVIVED

removed call to java/lang/StringBuilder::toString : SURVIVED

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testKbdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : SURVIVED

330

Substituted 1 with 0 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 2 with 3 : SURVIVED

Substituted 0 with 1 : SURVIVED

Substituted 1 with 0 : SURVIVED

Substituted 2 with 3 : SURVIVED

334

removed call to fi/helsinki/cs/titokone/Application::checkInput : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

335

removed call to fi/helsinki/cs/titokone/Message::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to fi/helsinki/cs/titokone/Message::toString : KILLED -> fi.helsinki.cs.titokone.ControlTest.testLoad(fi.helsinki.cs.titokone.ControlTest)

338

removed call to java/lang/IllegalArgumentException::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

340

removed call to java/lang/String::split : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

341

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Removed assignment to member variable stdinpointer : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

342

Removed assignment to member variable stdincontent : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

343

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

negated conditional : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

changed conditional boundary : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 0 with 1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Changed increment from 1 to -1 : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

344

removed call to java/lang/Integer::parseInt : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

347

Substituted 1 with 0 : SURVIVED

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::toString : SURVIVED

removed call to java/lang/StringBuilder::<init> : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

removed call to java/lang/StringBuilder::append : KILLED -> fi.helsinki.cs.titokone.ApplicationTest.testStdInputBuffer(fi.helsinki.cs.titokone.ApplicationTest)

Substituted 1 with 0 : SURVIVED

Active mutators

Tests examined


Report generated by PIT 0.27