Preheat the oven to 230° C and line a baking tray with baking paper.
Wash the tomatoes and pat them dry. Peel the garlic and lightly crush it with the flat side of a knife. Put tomatoes and garlic on the baking tray and season with olive oil, salt and pepper. Roast for 20-25 minutes in the oven, turning them repeatedly.
In the meantime, cook the spaghetti according to the instructions until al dente – about 1 minute before the pasta is done add basil to the boiling water. Drain the pasta and reserve some of the cooking water. Put the pasta in a bowl and mix with the roasted tomatoes, olive oil and some of the cooking water. Serve with fresh parmesan cheese!