Benitez - 2012-07-25

Editor's Note: Xishan as a famous game studio, more than 10 years accumulation and precipitation of a lot of things, whether it is art or planning or procedure or test, whether it is early "Zhongguancun Apocalypse Now" or "JX "series. Jinshan official blog will be invited Xishanju art, planning and other colleagues to share bits and pieces of the game production process. I hope through these, so that everyone can understand the game more "refined" abercrombie shop into also hope to provide some guidance and advice through this, my friends interested in the games industry.

A pillar of the test: behind the scenes

Testing in the development of the game and even throughout the software development industry, which seems to be in a very prominent location, such as:
"This game is really fun, and inside the settings are too interesting." (Kwame planned)
"The characters in this game so nice." (Boast art)
"This game is really fast speed, can run in my broken machine." (Praise programmer)

But rarely heard to boast test. And if problems also seems to be planning, art and procedures scolded, will test not individually singled out the criticism. For example:

"Mentally retarded task ah ~" (wrong) planning
"The picture is really bad!" (Art's fault)
"Junk client, every day collapse." (The fault of the programmer)

For the outside world, the test seems to be transparent, does not seem to exist. And test the work done is not directly displayed to the user can see. But the entire game development process, testing is very important, because the testing is focused on the quality abercrombie shorts of the product. Products in the market, must be tested off. Like cars, I do not think people want to buy one just pieced together without any detection of the car.

so I say, the test is the game developer behind the pillar.

The two legs of the test: functional testing and test development

So how do you test the game? Directly into the game, the use of each function to see is not consistent with the design is a good idea, but it is a very important way. This test is known as functional testing. In theory, the functional test can be found all the problems: products out there, as long as the use of the product thoroughly, no matter how hidden, they can find. But in fact, it does not work.

First of all, the game is the vast amounts of data can not simply rely on people to verify. For example, the purchase price of the props in the game should not be negative, if you want the human eye to check again, time consuming, do not say, seeing things very easily, resulting in missed problem.

Second, functional testing is difficult to cover some of the test environment. Such as online games, a large number of players at the same time log server is not normal? To rely on real players logged on, the cost is too high, but not necessarily to achieve.

Therefore, a simple functional test to go up will be very hard, you also need the other leg: test development.

Test developed by the functions:

First, the code review

Programmers to write code, compile, as the program can be executed on the machine. Code in the executable program is equivalent to the relationship between the parts and cars. For the car, check the vehicle without check the spare parts is incredible. Programmers to write code but also checked. This part of the work falls on the body of test development.

There are many ways to check the code, one of which is code review, in short, do not run the source code, just check the code itself. Here to check source code format is not compliant, there is no low-level error, exception is not processing, program flow problems.

The reason to do this, because this method is relatively abercrombie swim simple to implement, but also directly in-depth within the source code, can be found some problems as soon as possible. Then the problems found, is the most easily modified, which means that the price paid for the bug minimum. Also, test developers are familiar with the source code to lay the foundation for further testing.

Second, write the test code

Code review is not a panacea, there are significant limitations. For example, the efficiency of code reviews is still relatively low. The most important point, the code review phase, the code is not up and running. The actual operation of the code is not expected match is not to say. Therefore, test developers need to think of a way to get the code up and running, look at the actual operating performance of a piece of code is not correct. Then we must write the test code.

For a function, test development, you want to check this function is not able to complete the work, different combinations of parameters is not able to correctly handle, for example, is done not to do things (and more work is also wrong) . To a thorough examination of this function, the test development is necessary to write specific code to test this function, the deliberate creation of a wide variety of environments to allow this function to run, and then analyze the results of the operation of the function. Such a test through a series of test code for this function, we will have confidence.

For example, we want to test a large number of the client at the same time linked server. Actually find a lot of players to take a lot of effort, efficiency and low. If you wait until the external testing has just started opening up the server, too late, but not at any time encountered such a situation. Test development comes in handy. Can write a program specifically to simulate a large number of concurrent, although many factors are ignored, but can be analyzed in a number of bottlenecks.

To write test code for the benefits is that you can often run the test. Programmers modify the code if you can quickly run the test, you can find problems early. Functional test is not easy to do this. Because sometimes developers submit code at the interface can not be manifested, and real-time performance, functional testing will be to arrange a test plan may not be able to immediately test the modified part.

Third, the preparation of test tools

Check props such as the previously mentioned sale prices, time-consuming and unreliable, the cost is also high by the naked eye. In fact, like this a lot of repetitive work can be handed over to the machine to do it, let us test developers to write tools, more props the price can quickly finished checking, and error-prone.

For example, we hope that the repetitive tasks time every day to run, can Windows Scheduler limitations, for example, many machines are furnished to each machine on the same task is very troublesome, but not easy to know what tasks each machine is running. So we wrote a tool of a management task, and only by a machine, you can assign a task to other machines on the implementation of each task, and can be observed at any time.