A controller for an image forming system including a head in which a plurality of nozzles is formed, the controller comprising: a first communication interface configured to communicate with a line sensor including a plurality of imaging elements arranged along an element arrangement direction at a predetermined interval and having an element-lacking-part (LK IS) at which an interval between two elements, of the plurality of imaging elements, adjacent to each other is larger than the predetermined interval; and a second communication interface configured to communicate with the head; wherein the controller is configured to: form a test pattern on a medium by causing the head to discharge a liquid via the second communication interface, the test pattern including a plurality of patterns formed respectively by the plurality of nozzles; obtain a test pattern data from the line sensor via the first communication interface, the test pattern data being generated by imaging the test pattern formed on the medium with the line sensor; correct a position of the plurality of patterns on the test pattern data obtained from the line sensor based on a position of the element-lacking-part in the element arrangement direction; and detect a discharge-defect-nozzle of the plurality of nozzles based on the corrected test pattern data. a first communication interface configured to communicate with a line sensor including a plurality of imaging elements arranged along an element arrangement direction at a predetermined interval and having an element-lacking-part (LK IS) at which an interval between two elements, of the plurality of imaging elements, adjacent to each other is larger than the predetermined interval; and a second communication interface configured to communicate with the head; wherein the controller is configured to: form a test pattern on a medium by causing the head to discharge a liquid via the second communication interface, the test pattern including a plurality of patterns formed respectively by the plurality of nozzles; obtain a test pattern data from the line sensor via the first communication interface, the test pattern data being generated by imaging the test pattern formed on the medium with the line sensor; correct a position of the plurality of patterns on the test pattern data obtained from the line sensor based on a position of the element-lacking-part in the element arrangement direction; and detect a discharge-defect-nozzle of the plurality of nozzles based on the corrected test pattern data. form a test pattern on a medium by causing the head to discharge a liquid via the second communication interface, the test pattern including a plurality of patterns formed respectively by the plurality of nozzles; obtain a test pattern data from the line sensor via the first communication interface, the test pattern data being generated by imaging the test pattern formed on the medium with the line sensor; correct a position of the plurality of patterns on the test pattern data obtained from the line sensor based on a position of the element-lacking-part in the element arrangement direction; and detect a discharge-defect-nozzle of the plurality of nozzles based on the corrected test pattern data.