A washing machine is disclosed. A washing machine according to one embodiment of the present invention comprises: a door for opening and closing a laundry inlet; a magnetic body included in the door; a processor; and a door lock switch including a door lock key which moves in accordance with the opening and closing of the door so as to lock or unlock the door, a first switch electrically connected on the basis of movement of the door lock key to a locked position, and a second switch connected in series with the first switch and electrically connected in response to an approach of the magnetic body, wherein the processor receives a signal generated by connecting the first switch and the second switch, detects the locking of the door, and proceeds to perform the washing cycle process of the washing machine. Other embodiments are possible.