Cook the spaghetti in salted water until al dente.
In the meantime, cut the tomatoes into 1 - 2 cm cubes and finely chop the garlic.
Drain and rinse the spaghetti. Heat the olive oil in a pan and lightly fry the garlic until it gets a little color. Then put the spaghetti in the pan and fry for about 2 minutes, turning.
Just before serving, add the fresh tomato cubes and the basil and season to taste with salt.