Cook the pasta in plenty of boiling salted water according to the pack instructions. Rinse under cold water, then drain.
Drain the mozzarella in a sieve.
Wash and halve the tomatoes.
Mix the pesto with the oil, vinegar, 3-4 tbsp cold water and salt and pepper to taste. Place the mozzarella in a bowl and pour over the dressing. Mix with the pasta and tomatoes.
Drain the basil, shake dry and pick off the leaves.
Tear the ham into strips and arrange over the salad. Serve garnished with basil.