This image shows the a350 first takeoff high in the air and the landing gear is still down. Why didn't they retract it?
Test flying is thoroughly planned, and of the many things to test during development, the landing gear is just a minor part. In the first flight the goal is to check out basic functionality and how well the low-speed performance was predicted. The landing gear can wait for one of the later flights. You can see in the photo of the A350 that the slats are extended and the flaps are in take-off position. The pilots are busy testing handling in take-off configuration, and for that the gear must be down. You can be sure that they also tested the landing configuration at altitude before going down to land.
Generally, the tested envelope of the aircraft will be expanded step by step. Since every flight will contain a take-off segment, it is prudent to check out this part of the envelope first. Once the low-speed regime is tested, consecutive flights will take the aircraft to higher speeds, and only then will it be necessary to retract the gear.
Also, the first flight of a newly developed aircraft has become a ceremonial affair. After having spent hundreds of millions of dollars or euro, and with all the media attention, nobody wants to live through the embarrassement of a gear failure on occasion of the first flight.
This was not always the case. The F-100 went supersonic on its second flight; taking this kind of risk would be unimaginable today without the pressure of an arms race.
Aircraft flight testing a rigorous and elaborate affair, with the aircraft first tested at low dynamic pressures and as the performance data is received and analyzed, the flight envelope is expanded slowly.
During the first flight of test aircraft, the approach is to take minimal risk. Keeping the landing gear extended serves two functions:
- Landing gear systems are very complex in themselves and it serves no purpose to check them in the first flight. There is a possibility that they may not retract or may not extend after retracting. As Peter pointed out, this is not a good thing to happen in first flight.
- Also, in case the aircraft has to land in case of any emergency, it is better to keep the landing gear in extended position.
There are a few cases in which the landing gear malfunctioned during the first flight. In the first flight of YF-22, which went on to become the F-22, the landing gear retraction was not planned. However, when it was tried in subsequent flights, the gear did not retract due to software issues. However, it has to be noted that the while retraction was software controlled, extension was hardwired for safety.
Another case of landing gear failure is the NASA dream chaser plane, which suffered landing gear malfunction in its first free flight.
As the aircraft approached the runway, the left landing gear failed to deploy, and the aircraft skidded off the runway and was damaged.
The simple and easy answer is that the first of any new aircraft design, no matter how well-engineered, well-constructed and/or derivative of earlier designs, is a complete unknown. The first flight is always gear-down because if there's any problem, the test pilot/crew needs to be able to get the plane back down on the ground without having to deal with any additional issues (like not being able to get the gear back down). Gear extension, retraction and emergency release are all thoroughly tested many, many times with the aircraft on a lift prior to the first flight, but still, anything can happen, and better safe than sorry (especially in a civilian aircraft design without an ejection system).