Main.java

1
package edu.ucsb.cs156.student;
2
public class Main { // implicit: public class Main extends object
3
4
    public static void main(String[] args) {
5
6
        String usageMessage = "Usage: java Main name perm\n"
7
                + "  perm should be a positive integer between 1 and 9999999";
8
9 1 1. main : negated conditional → NO_COVERAGE
        if (args.length != 2) {
10 1 1. main : removed call to java/io/PrintStream::println → NO_COVERAGE
            System.err.println(usageMessage);
11 1 1. main : removed call to java/lang/System::exit → NO_COVERAGE
            System.exit(1);
12
        }
13
14
        String name = args[0];
15
        int perm = 0; // avoids the "perm may not have been assigned" error
16
        try {
17
            perm = Integer.parseInt(args[1]);
18
        } catch (NumberFormatException e) {
19 1 1. main : removed call to java/io/PrintStream::println → NO_COVERAGE
            System.err.println(usageMessage);
20 1 1. main : removed call to java/lang/System::exit → NO_COVERAGE
            System.exit(2);
21
        }
22
23
        Student s1 = new Student();
24
        Student s2 = new Student(name, perm);
25
26 1 1. main : removed call to java/io/PrintStream::println → NO_COVERAGE
        System.out.println("s1 = " + s1); // implicit: r1.toString()
27 1 1. main : removed call to java/io/PrintStream::println → NO_COVERAGE
        System.out.println("s2 = " + s2); // implicit: r2.toString()
28
29
    } // main
30
31
}

Mutations

9

1.1
Location : main
Killed by : none
negated conditional → NO_COVERAGE

10

1.1
Location : main
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

11

1.1
Location : main
Killed by : none
removed call to java/lang/System::exit → NO_COVERAGE

19

1.1
Location : main
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

20

1.1
Location : main
Killed by : none
removed call to java/lang/System::exit → NO_COVERAGE

26

1.1
Location : main
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

27

1.1
Location : main
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.5.2