Much research has been carried out on fruit flies mating behaviour and the influence of genes on it. Despite their tiny size fruit flies can be easily watched performing their mating rituals on top of the rotting apples. Males are smaller and with a larger dark patch at the end of their abdomen. Females have a more stripy, and often distended abdomen.
According to Marla Sokolowski:
It might come as a surprise to some that D. melanogaster shows many exquisitely performed and complex patterns of behaviour. For example, the male fly shows courtship behaviour that is full of sensory stimuli and that requires the female to hear his song, feel his taps and licks, smell his odours and visually evaluate his stature...
As a primer, this figure (also from Sokolowski, 2001) illustrates the main steps of the fruit fly mating behaviour. Male 'song' is produced by wing vibration while keeping the wing tipped forward.
Check out the Drosophila melanogaster Wikipedia page for more info.