官术网_书友最值得收藏!

Chapter 2. Debugging

Debugging is the process of finding, identifying, and fixing bugs (errors or mistakes) in your code, and there are many ways to achieve this. To script effectively, you'll need to be aware of the most common workflows and toolsets available to you for debugging in Unity. Before considering them further, however, it's important to be aware of the general limitations of debugging and what it cannot achieve. Debugging is not a magical cure-all to remove all bugs and guarantee an error-free application. The computer scientist Edsger W. Dijkstra said, "Program testing can be used to show the presence of bugs, but never to show their absence". The crucial point is that during testing, you might encounter one or more errors. These errors can be identified, tested, and repaired through debugging. Yet, your tests—though perhaps extensive and careful—will never cover every possible case or scenario on every hardware platform under all conditions, as these combinations could be practically infinite. So, you can never be absolutely certain to have found all the possible bugs. Even on the release day, there could still be bugs in your game, which your testing couldn't detect. Of course, there might actually be no bugs remaining at all, but you cannot know this with absolute certainty. So, debugging is not about achieving an error-free application. Its aims are more modest. It's about systematically testing your game in many common and reasonable situations to find and correct as many errors as you encounter or, at least, as many severe errors as your time and budget permits. In any case, debugging is a critical part of scripting, because without it, you will have no way of tracing and fixing errors. Debugging techniques range from simple to complex, and in this chapter, we'll cover a broad spectrum of them.

主站蜘蛛池模板: 五台县| 高尔夫| 河北省| 手游| 海南省| 枞阳县| 桂阳县| 嵩明县| 漳浦县| 合阳县| 安福县| 旺苍县| 无为县| 朝阳县| 法库县| 长白| 错那县| 吴川市| 临安市| 望都县| 保靖县| 苏尼特右旗| 中牟县| 桃园市| 封开县| 阳泉市| 罗江县| 珲春市| 潼关县| 朔州市| 安仁县| 和龙市| 周口市| 镶黄旗| 大化| 蛟河市| 紫云| 锡林郭勒盟| 彰化县| 康保县| 阿拉善右旗|