A flight recorder, colloquially known as a black box, although it is now orange-coloured, is an electronic recording device placed in an aircraft for the purpose of facilitating the investigation of aviation accidents and incidents.

Any type of aircraft in any condition of flight can be viewed in terms of its input parameters (e.g. control instructions) and output parameters (e.g. flight sensors), without any knowledge of its internal workings, as a black box model. The flight data recorder (FDR) is a device that preserves the recent history of the flight through the recording of dozens of parameters collected several times per second. The cockpit voice recorder (CVR) preserves the recent history of the sounds in the cockpit including the conversation of the pilots. The two recorders give an accurate testimony, narrating the aircraft's flight history, to assist in any later investigation.

More Info: en.wikipedia.org