A refrigerator comprising: a flow sensor configured to detect an amount of water supplied to a purified water tank; a carbonated water production module comprising: a carbonated water tank configured to store carbonated water; a valve assembly adapted to control a flow of purified water and carbonated water comprising: a purified water supply valve configured to open/close a water supply flow path to guide water from the purified water tank to the carbonated water tank; a purified water discharge valve to open/close a water flow path to guide water in the purified water tank to the outside of the refrigerator; and a carbonated water discharge valve to open/close a carbonated water discharge flow path to guide the carbonated water to the outside; a gas supply valve configured to open/close a gas supply flow path to guide carbon dioxide gas from a gas cylinder to the carbonated water tank; and a controller configured to open the purified water supply valve and the gas supply valve in sequence in order to produce carbonated water, wherein the controller is configured to determine whether water leakage occurs based on a result of detection by the flow sensor, wherein after closing the purified water supply valve, the purified water discharge valve, and the carbonated water discharge valve in the valve assembly, the controller is configured to determine whether water leakage of a first purified water supply flow path between the purified water tank and the valve assembly or water leakage of the valve assembly occurs based on whether the flow sensor detects the flow of water, and after opening the purified water supply valve, the controller is configured to determine whether water leakage of a second purified water supply flow path between the valve assembly and the carbonated water tank or water leakage of the valve assembly occurs based on whether the flow sensor detects the flow of water. a flow sensor configured to detect an amount of water supplied to a purified water tank; a carbonated water production module comprising: a carbonated water tank configured to store carbonated water; a valve assembly adapted to control a flow of purified water and carbonated water comprising: a purified water supply valve configured to open/close a water supply flow path to guide water from the purified water tank to the carbonated water tank; a purified water discharge valve to open/close a water flow path to guide water in the purified water tank to the outside of the refrigerator; and a carbonated water discharge valve to open/close a carbonated water discharge flow path to guide the carbonated water to the outside; a gas supply valve configured to open/close a gas supply flow path to guide carbon dioxide gas from a gas cylinder to the carbonated water tank; and a carbonated water tank configured to store carbonated water; a valve assembly adapted to control a flow of purified water and carbonated water comprising: a purified water supply valve configured to open/close a water supply flow path to guide water from the purified water tank to the carbonated water tank; a purified water discharge valve to open/close a water flow path to guide water in the purified water tank to the outside of the refrigerator; and a carbonated water discharge valve to open/close a carbonated water discharge flow path to guide the carbonated water to the outside; a purified water supply valve configured to open/close a water supply flow path to guide water from the purified water tank to the carbonated water tank; a purified water discharge valve to open/close a water flow path to guide water in the purified water tank to the outside of the refrigerator; and a carbonated water discharge valve to open/close a carbonated water discharge flow path to guide the carbonated water to the outside; a gas supply valve configured to open/close a gas supply flow path to guide carbon dioxide gas from a gas cylinder to the carbonated water tank; and a controller configured to open the purified water supply valve and the gas supply valve in sequence in order to produce carbonated water, wherein the controller is configured to determine whether water leakage occurs based on a result of detection by the flow sensor, wherein after closing the purified water supply valve, the purified water discharge valve, and the carbonated water discharge valve in the valve assembly, the controller is configured to determine whether water leakage of a first purified water supply flow path between the purified water tank and the valve assembly or water leakage of the valve assembly occurs based on whether the flow sensor detects the flow of water, and after opening the purified water supply valve, the controller is configured to determine whether water leakage of a second purified water supply flow path between the valve assembly and the carbonated water tank or water leakage of the valve assembly occurs based on whether the flow sensor detects the flow of water.