Make the pesto, thinning with 1-2 tbsp water if needed. Prepare ingredients: slice tomatoes, cut corn off cobs, and cube or prepare mozzarella.
Cook pasta until al dente, then rinse in cold water. Simultaneously, boil water with salt and cook shrimp for 30 seconds to 3 minutes until pink, then cool in an ice bath.
Drain and cool pasta, then combine with shrimp, tomatoes, corn, mozzarella, and pesto in a large bowl. Toss gently to coat.
Serve immediately or chill for up to 2 hours. Garnish with fresh basil leaves before serving.
Notes
For best flavor, serve within 2 days to prevent mushy tomatoes.