Put on the water to boil in a saucepan. When it begins to boil, sprinkle in some salt according to taste. (Make sure you follow this order.)
Add the spaghetti, and cook it until it gets crisp and soft. When it is done, spoon it into a dish.
Ladle 5 tablespoons of the cooking water into a plate.
Spoon the spaghetti into the plate, add the pesto and mix it well with the pasta.