An image forming apparatus for forming an image on a recording medium, comprising: an image forming unit configured to form an image according to image data and a test pattern image with developer on a primary transfer member, wherein the image data can include data for forming a first image and at least one second image subsequent to the first image; a conveying unit configured to convey the recording medium to cause the recording medium to face the primary transfer member; a secondary transfer unit configured to transfer the image according to the image data formed on the primary transfer member onto the recording medium in contact with the primary transfer member; a detector configured to detect the test pattern image formed on the primary transfer member; a controller configured to cause the image forming unit to form the first image on the primary transfer member, cause the image forming unit to form the test pattern image on the primary transfer member after the first image, and cause the image forming unit to form the at least one second image on the primary transfer member based on the detection of the test pattern image by the detector; a transfer separation unit configured to, after the secondary transfer unit transfers the first image formed on the primary transfer member onto the recording medium, separate the primary transfer member on which the test pattern image is formed and the recording medium from each other; a heating unit configured to heat the image according to the image data transferred onto the recording medium in contact with the recording medium; and a fixing separation unit configured to separate the heating unit and the recording medium from each other when the primary transfer member and the recording medium are separated from each other by the transfer separation unit and conveyance of the recording medium facing the primary transfer member by the conveying unit is stopped. an image forming unit configured to form an image according to image data and a test pattern image with developer on a primary transfer member, wherein the image data can include data for forming a first image and at least one second image subsequent to the first image; a conveying unit configured to convey the recording medium to cause the recording medium to face the primary transfer member; a secondary transfer unit configured to transfer the image according to the image data formed on the primary transfer member onto the recording medium in contact with the primary transfer member; a detector configured to detect the test pattern image formed on the primary transfer member; a controller configured to cause the image forming unit to form the first image on the primary transfer member, cause the image forming unit to form the test pattern image on the primary transfer member after the first image, and cause the image forming unit to form the at least one second image on the primary transfer member based on the detection of the test pattern image by the detector; a transfer separation unit configured to, after the secondary transfer unit transfers the first image formed on the primary transfer member onto the recording medium, separate the primary transfer member on which the test pattern image is formed and the recording medium from each other; a heating unit configured to heat the image according to the image data transferred onto the recording medium in contact with the recording medium; and a fixing separation unit configured to separate the heating unit and the recording medium from each other when the primary transfer member and the recording medium are separated from each other by the transfer separation unit and conveyance of the recording medium facing the primary transfer member by the conveying unit is stopped.