Italian here :) I know that the oil is a well known trick everywhere ... but Italy. The main problem about pasta is that people just tend to cook it too much. The cooking time for pasta should be between 8 and 12 minutes, above this number it will be sticky. Spaghetti is the quickest kind of pasta to get ready, so just cook it around 8-9 minutes and it won't stick.
Al dente cooking is a transitional state that lasts for a very short amount of time (one minute longer in boiling water makes pasta too soft, one minute shorter and it's still crunchy). For this reason, authentic Italian pasta packages state a precise cooking time, which is very reliable to make a good al dente pasta.
A cooking time interval (e.g. "7 to 10 minutes") is usually given to accommodate to other countries taste, who may prefer a softer pasta, and therefore its presence could be a good indicator of an Italian look-alike pasta brand. In this case the lower figure indicates the al dente cooking.
Lacking this information, a good cooking time can be figured by cross section size, length and shape of pasta: obviously, thicker and squat formats require more time. Complex shapes, such as farfalle, can be trickier because a thick core could reach the al dente cooking while the thinner edges are already too soft.
As a rule of thumb, cooking times for common pasta formats are:
- Long and very thin (spaghettini, bavette): 6 min
- Long and thin (spaghetti, linguine, bucatini): 8 min
- Short and thick (maccheroni, rigatoni, fusilli): 12 min
- Small and thick (farfalle) : 8 min
- Small and thin (pasta usually boiled straight into broth): 6 min
These cooking times apply only for dry durum-wheat pasta; other types (such as fresh egg pasta) usually have a shorter cooking time.
After straining the boiling water, pasta continues to cook by its own heat; for this reason it has to be eaten as soon as possible. Only for some Italian regional recipes (typically pasta boiled straight into a thick vegetable juice, e.g. pasta with beans, pasta with potatoes) you may want to let it rest for up to 5 minutes after straining to let the juices coagulate.
Also, for recipes where pasta has to undergo a second cooking after boiling (e.g. stir frying in a pan with vegetables, shrimps, mushrooms, etc.) a better result is obtained by boiling pasta just one minute less than the cooking time given on the package.
Best Answer
Use the pasta cooking techniques in this answer: Pasta: is simmering equivalent to roiling boil?
Bring just enough water to cover the pasta to a boil, put the lid on and let it sit.
Use less water, less energy, and it can't boil over if it's not boiling.