
The perfect cake should be neither overbaked, otherwise it will be hard and dry, nor underbaked, because in that case the texture will be rubbery and soft. To achieve the ideal softness and fluffiness, therefore, it is important to take the cake out of the oven at the right time, avoiding opening the door repeatedly, especially if it is a leavened cake. Here's how to tell if a cake is ready, with a few simple tricks.
1. The Browning

If the cake you're making isn't chocolate, simply peek into the oven and check the browning to see when it's done. The edges will be browner than the center and top, which will be golden. This browning depends primarily on the amount of sugar used: the more you use, the browner the cake will become once baked.
The issue becomes more thorny when dealing with chocolate desserts, due to the presence of cocoa powder. However, looking more closely, even in this case you will be able to notice a slight darkening of the edges and the top. Once baked, the cake will also take on a matte finish.
2. The Toothpick Test

This widely known test involves inserting a toothpick or paring knife into the center of the cake: if it comes out clean, the cake is cooked through. If you notice crumbs or debris on the toothpick, it means the cake is still raw inside. While simple and straightforward, this test isn't always reliable, as the toothpick may come out clean even when the cake needs a little more cooking.
3. The Edges

When the cake is almost ready, the edges, which set and cook first, tend to pull away from the pan, shrinking inward. As the rest of the cake bakes, the crust becomes firmer. Therefore, if you notice a gap between the cake and the sides of the pan, you can deduce that the outside is done, and that the inside may be too. Before removing the cake from the oven, however, make sure the center of the cake is truly done by performing further tests.
4. The Perfume

This is one of the most telling signs: when you start to smell the cake, you'll know it's almost ready. However, it's advisable not to rush it and to make sure to do other tests, such as inserting a toothpick or checking for browning, before removing it from the oven.
5. Elasticity

Another way to test for doneness is to gently press the center of the cake with your finger to see if the surface springs back. If it springs back, the cake is done. If the indentation remains, it needs a little more baking. You can repeat the test after 5 minutes.